random_utils/include/random_utils/SleepyObject.h

Go to the documentation of this file.
00001 #ifndef _RU_SLEEPY_OBJECT_H_
00002 #define _RU_SLEEPY_OBJECT_H_
00003 
00004 #include <SDL.h>
00005 
00006 namespace random_utils
00007 {
00008 
00014 class SleepyObject
00015 {
00016     SDL_cond*   m_finishedUpdateCondition;
00017     SDL_mutex*  m_finishedUpdateMutex;
00018     SDL_cond*   m_wakeUpCondition;
00019     SDL_mutex*  m_requestMutex;
00020 
00021     bool m_sleepRequested;
00022 
00023 protected:
00027     virtual void update() = 0;
00028 
00029 public:
00033     SleepyObject();
00034 
00035     virtual ~SleepyObject();
00036 
00040     void runUpdate();
00041 
00046     void sleep();
00047 
00051     void wakeUp();
00052 
00056     bool sleepRequested(void);
00057 };
00058 
00059 }
00060 
00061 #endif

Generated on Fri May 11 21:01:58 2007 for Random Racer by  doxygen 1.5.1