SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
All Classes Files Functions Variables Typedefs Enumerations
Public Member Functions | Protected Member Functions | List of all members
SPSP::Timer Class Reference

Simple timer for SPSP purposes. More...

#include <timer.hpp>

Public Member Functions

 Timer (const std::chrono::milliseconds interval, std::function< void()> cb)
 Constructs a new timer. More...
 
 ~Timer ()
 Destroys the timer. More...
 

Protected Member Functions

void handlerThread ()
 Timer handler thread. More...
 

Detailed Description

Simple timer for SPSP purposes.

(... but you can also use it outside of SPSP.)

Definition at line 27 of file timer.hpp.

Constructor & Destructor Documentation

◆ Timer()

SPSP::Timer::Timer ( const std::chrono::milliseconds  interval,
std::function< void()>  cb 
)

Constructs a new timer.

First execution of cb will be after first interval expires (not immediately).

Parameters
intervalInterval of timer
cbCallback (std::bind can be used)

◆ ~Timer()

SPSP::Timer::~Timer ( )

Destroys the timer.

Member Function Documentation

◆ handlerThread()

void SPSP::Timer::handlerThread ( )
protected

Timer handler thread.


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