mn_itimer.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_INTERFACE_TIMER_
20 #define MINLIB_INTERFACE_TIMER_
21 
22 #include "mn_config.hpp"
23 
24 namespace mn {
28  class ITimer {
29  public:
39  virtual int create() = 0;
40 
47  virtual int destroy(unsigned int timeout = (unsigned int) 0xffffffffUL) = 0;
48 
57  virtual int active(unsigned int timeout = (unsigned int) 0xffffffffUL) = 0;
58 
67  virtual int inactive(unsigned int timeout = (unsigned int) 0xffffffffUL) = 0;
68 
77  virtual int reset(unsigned int timeout = (unsigned int) 0xffffffffUL) = 0;
78 
86  virtual bool set_period(unsigned int uiNewPeriod, unsigned int timeout = (unsigned int) 0xffffffffUL) = 0;
92  virtual unsigned int get_period() = 0;
93 
98  virtual void* get_handle() = 0;
99 
100  virtual void set_id(int nId) = 0;
101 
108  virtual bool is_running() = 0;
109 
110  virtual operator bool() { return is_running(); }
111  protected:
116  virtual void on_timer() = 0;
117 
121  virtual void on_enter() = 0;
125  virtual void on_exit() = 0;
126 
127  };
128 }
129 
130 #endif
Definition: mn_itimer.hpp:28
virtual void on_timer()=0
virtual bool set_period(unsigned int uiNewPeriod, unsigned int timeout=(unsigned int) 0xffffffffUL)=0
virtual int inactive(unsigned int timeout=(unsigned int) 0xffffffffUL)=0
virtual int active(unsigned int timeout=(unsigned int) 0xffffffffUL)=0
virtual int reset(unsigned int timeout=(unsigned int) 0xffffffffUL)=0
virtual void * get_handle()=0
virtual void on_enter()=0
virtual bool is_running()=0
virtual void set_id(int nId)=0
virtual int destroy(unsigned int timeout=(unsigned int) 0xffffffffUL)=0
virtual void on_exit()=0
virtual unsigned int get_period()=0
virtual int create()=0
Definition: mn_allocator_typetraits.hpp:25