00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _BOGOTEL_TIMERTARGET_H
00011 #define _BOGOTEL_TIMERTARGET_H
00012
00013 #include <string>
00014
00015 #include <boost/thread/mutex.hpp>
00016 #include <boost/thread/recursive_mutex.hpp>
00017
00018 namespace bogotel {
00019
00024 class CTimerTarget {
00025 public:
00026 CTimerTarget();
00027 virtual ~CTimerTarget();
00028
00029 void timerExpired(int timerType, int stateId);
00030
00031 void setTimer(int period, int timerType);
00032
00033
00034 virtual std::string toString() = 0;
00035
00036 void incStateId();
00037 bool timerValid(int stateId);
00038
00039 protected:
00040 virtual void _timerExpired(int timerType, int stateId) = 0;
00041
00042 private:
00043 int getStateId();
00044
00045 int m_iStateId;
00046
00047
00048 long m_lId;
00049 public:
00050 long getId();
00051
00052 private:
00053 static boost::mutex s_mtxId;
00054 static long s_lId;
00055
00056 };
00057 }
00058
00059 #endif // ! _BOGOTEL_TIMERTARGET_H