Base class for an object that notifies listeners at some interval.
More...
#include <timer.h>
|
virtual bool | stopped () const |
| Returns true if the timer is stopped.
|
|
virtual void | stop () |
| Stop the timer.
|
|
virtual size_t | listen (const std::function< void()> &listener) |
| Adds a listener to this timer.
|
|
virtual void | ignore (const size_t token) |
| Removes a previously added listener.
|
|
virtual void | operator() ()=0 |
| Execution function to be implemented by concrete timers.
|
|
|
typedef std::map< size_t,
const std::function< void()> > | listeners_t |
| Convenience typedef.
|
|
Base class for an object that notifies listeners at some interval.
virtual size_t flow::timer::listen |
( |
const std::function< void()> & |
listener | ) |
|
|
inlinevirtual |
Adds a listener to this timer.
- Parameters
-
listener | A functor that will be called at interval. |
- Returns
- The token to pass to ignore.
virtual void flow::timer::ignore |
( |
const size_t |
token | ) |
|
|
inlinevirtual |
Removes a previously added listener.
- Parameters
-
token | A value previously returned by listen. |
virtual void flow::timer::operator() |
( |
| ) |
|
|
pure virtual |
Execution function to be implemented by concrete timers.
This function must return as soon as possible after the timer is stopped.
Implemented in flow::monotonous_timer.
The documentation for this class was generated from the following file: