Main Page   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

TimerTarget.h

Go to the documentation of this file.
00001 /*
00002  * TimerTarget.h
00003  *
00004  * Copyright 2003, MobileSpear Inc. (www.mobilespear.com). All rights reserved.
00005  * Copyright 2003, David Resnick. All rights reserved.
00006  *
00007  * See the file doc\license.txt for the terms of usage and distribution.
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         // returns target type of object
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         // ID of current state of timertarget
00045         int  m_iStateId;
00046 
00047         // id of target instance
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

Generated on Tue Aug 12 12:41:30 2003 for bogotel by doxygen 1.3. Hosted by SourceForge.net Logo