00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 #ifndef GBXICEUTILACFR_THREAD_H00012 #define GBXICEUTILACFR_THREAD_H00013 00014 #include <IceUtil/Thread.h>00015 #include <gbxutilacfr/stoppable.h>00016 00017 00018 #include <gbxsickacfr/gbxiceutilacfr/threadutils.h>00019 00020 namespace gbxiceutilacfr {00021 00072 class Thread : public IceUtil::Thread, public gbxutilacfr::Stoppable00073 {00074 public:00075 00076 Thread();00077 00080 void stop();00081 00082 00084 virtual bool isStopping();00085 00087 bool isStarted();00088 00092 bool isActive() { return !isStopping(); };00093 00094 protected:00095 00100 void waitForStop();00101 00102 private:00103 bool isStopping_;00104 };00106 typedef IceUtil::Handle<gbxiceutilacfr::Thread> ThreadPtr;00107 00110 void stop( gbxiceutilacfr::Thread* thread );00111 00114 void stopAndJoin( gbxiceutilacfr::Thread* thread );00115 00118 inline void stop( const gbxiceutilacfr::ThreadPtr& thread )00119 { stop(thread.get()); }00120 00123 inline void stopAndJoin( const gbxiceutilacfr::ThreadPtr& thread )00124 { stopAndJoin(thread.get()); }00125 00126 } 00127 00128 #endif