clan::Timer Class Reference

Timer class that invokes a callback on a specified interval. More...

#include <timer.h>

Public Member Functions

 Timer ()
 Creates a timer object. More...
 
std::function< void()> & func_expired ()
 Callback invoked every time the timer interval occurs. More...
 
unsigned int get_timeout () const
 Returns the current timeout. In milliseconds. More...
 
bool is_repeating () const
 Returns true if the timer repeats until it is stopped. More...
 
void start (unsigned int timeout, bool repeat=true)
 Starts the timer. Timeout in milliseconds. More...
 
void stop ()
 Stop the timer. More...
 

Detailed Description

Timer class that invokes a callback on a specified interval.

Constructor & Destructor Documentation

clan::Timer::Timer ( )

Creates a timer object.

Member Function Documentation

std::function<void()>& clan::Timer::func_expired ( )

Callback invoked every time the timer interval occurs.

unsigned int clan::Timer::get_timeout ( ) const

Returns the current timeout. In milliseconds.

bool clan::Timer::is_repeating ( ) const

Returns true if the timer repeats until it is stopped.

void clan::Timer::start ( unsigned int  timeout,
bool  repeat = true 
)

Starts the timer. Timeout in milliseconds.

void clan::Timer::stop ( )

Stop the timer.


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