Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

stagetime.h

Go to the documentation of this file.
00001 /*
00002  *  Player - One Hell of a Robot Server
00003  *  Copyright (C) 2000  
00004  *     Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
00005  *                      
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 /*
00024  * $Id: stagetime.h,v 1.3 2003/10/16 22:06:11 rtv Exp $
00025  *
00026  * this is the StageTime class, which gets current simulated time from
00027  * shared memory
00028  *
00029  */
00030 #ifndef _STAGETIME_H
00031 #define _STAGETIME_H
00032 
00033 #include <sys/time.h>
00034 #include "playertime.h"
00035 #include "stage1p3.h"
00036 
00037 class StageTime : public PlayerTime
00038 {
00039   private:
00040     // the location in shared memory of the time feed
00041     struct timeval* simtimep;
00042 
00043     // Simulator lock bookkeeping data and init method
00044     //
00045     int lock_fd;
00046     int lock_byte;
00047     void InstallLock( int fd, int index )
00048               {lock_fd = fd; lock_byte = index;}
00049     void Lock();
00050     void Unlock();
00051 
00052   public:
00053     StageTime(const char *directory);
00054     ~StageTime() { } // empty destructor
00055 
00056     int GetTime(struct timeval* time);
00057 
00058 };
00059 
00060 #endif
00061 
00062 

Generated on Tue May 3 14:15:36 2005 for Player by doxygen 1.3.6