flow  3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
flow::monotonous_timer Class Reference

Concrete timer that notifies listeners repeatedly at a set interval of time. More...

#include <timer.h>

Inheritance diagram for flow::monotonous_timer:
Inheritance graph
[legend]
Collaboration diagram for flow::monotonous_timer:
Collaboration graph
[legend]

Public Member Functions

template<typename Duration >
 monotonous_timer (const Duration &interval)
 
virtual void stop ()
 Stop the timer.
 
virtual void operator() ()
 Implementation of timer::operator()().
 
- Public Member Functions inherited from flow::timer
virtual bool stopped () const
 Returns true if the timer is stopped.
 
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.
 

Additional Inherited Members

- Protected Types inherited from flow::timer
typedef std::map< size_t,
const std::function< void()> > 
listeners_t
 Convenience typedef.
 
- Protected Attributes inherited from flow::timer
listeners_t d_listeners
 Listeners of this timer.
 
size_t d_next_index
 The token tat maps to a listener.
 
std::mutex d_listeners_m
 Mutex to protect modifications to d_listeners.
 

Detailed Description

Concrete timer that notifies listeners repeatedly at a set interval of time.

Constructor & Destructor Documentation

template<typename Duration >
flow::monotonous_timer::monotonous_timer ( const Duration &  interval)
inline
Parameters
intervalThe time to wait between notifications. Must be a duration typedef from <chrono>.

The documentation for this class was generated from the following file: