rad 6.2.0
|
#include <timer.hpp>
Public Member Functions | |
Timer (boost::asio::io_context &ios, SMAdapter &sm, UniqueEvent &&event) | |
virtual | ~Timer () |
void | Install (const long timeout) |
void | Cancel () |
Timer (const Timer &)=delete | |
Timer & | operator= (const Timer &)=delete |
This class can be used to trigger an event when a timer expires.
rad::Timer::Timer | ( | boost::asio::io_context & | ios, |
SMAdapter & | sm, | ||
UniqueEvent && | event ) |
[in] | ios | Event loop used by the application. |
[in] | sm | Reference to the SM adapter used to trigger events. |
[in] | event | Event to be triggered when the timer expires. |
|
virtual |
Cancel the timer if it is active.
|
delete |
void rad::Timer::Cancel | ( | ) |
Cancel an installed deadline timer.
void rad::Timer::Install | ( | const long | timeout | ) |
Install a deadline timer that expires after the given time.
[in] | timeout | Deadline time in msec. from now. |