File: thetimerobjectbase.h

package info (click to toggle)
sinfo 0.0.48-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 3,332 kB
  • sloc: sh: 11,213; cpp: 6,722; makefile: 271; xml: 151; perl: 149
file content (30 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _thetimerobjectbase_h
#define _thetimerobjectbase_h

#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/function.hpp>


typedef boost::function< void() > TimerEventFunctor;


/**
* @brief base class to manipulate a timer.
* This class can be implemented for operating system or simulated timers.
*
*/
class TheTimerObjectBase
{
protected:
  TimerEventFunctor * myFunctorPointer;

public:
  virtual ~TheTimerObjectBase() {};
  virtual void startAlarmAt(const boost::posix_time::ptime & time, TimerEventFunctor * functor)=0;
  virtual void startAlarmAfter(const boost::posix_time::time_duration & expiry_time, TimerEventFunctor * functor)=0;
  virtual void stop()=0;
  virtual bool isRunning()=0;
};


#endif // _thetimerobjectbase_h