|
| Timer (const std::shared_ptr< Service > &service) |
| Initialize timer with a given Asio service. More...
|
|
| Timer (const std::shared_ptr< Service > &service, const CppCommon::UtcTime &time) |
| Initialize timer with a given Asio service and absolute expiry time. More...
|
|
| Timer (const std::shared_ptr< Service > &service, const CppCommon::Timespan ×pan) |
| Initialize timer with a given Asio service and expiry time relative to now. More...
|
|
| Timer (const std::shared_ptr< Service > &service, const std::function< void(bool)> &action) |
| Initialize timer with a given Asio service and action function. More...
|
|
| Timer (const std::shared_ptr< Service > &service, const std::function< void(bool)> &action, const CppCommon::UtcTime &time) |
| Initialize timer with a given Asio service, action function and absolute expiry time. More...
|
|
| Timer (const std::shared_ptr< Service > &service, const std::function< void(bool)> &action, const CppCommon::Timespan ×pan) |
| Initialize timer with a given Asio service, action function and expiry time relative to now. More...
|
|
| Timer (const Timer &)=delete |
|
| Timer (Timer &&)=delete |
|
virtual | ~Timer ()=default |
|
Timer & | operator= (const Timer &)=delete |
|
Timer & | operator= (Timer &&)=delete |
|
std::shared_ptr< Service > & | service () noexcept |
| Get the Asio service. More...
|
|
std::shared_ptr< asio::io_service > & | io_service () noexcept |
| Get the Asio IO service. More...
|
|
asio::io_service::strand & | strand () noexcept |
| Get the Asio service strand for serialized handler execution. More...
|
|
CppCommon::UtcTime | expire_time () const |
| Get the timer's expiry time as an absolute time. More...
|
|
CppCommon::Timespan | expire_timespan () const |
| Get the timer's expiry time relative to now. More...
|
|
virtual bool | Setup (const CppCommon::UtcTime &time) |
| Setup the timer with absolute expiry time. More...
|
|
virtual bool | Setup (const CppCommon::Timespan ×pan) |
| Setup the timer with expiry time relative to now. More...
|
|
virtual bool | Setup (const std::function< void(bool)> &action) |
| Setup the timer with an action function. More...
|
|
virtual bool | Setup (const std::function< void(bool)> &action, const CppCommon::UtcTime &time) |
| Setup the timer with an action function and absolute expiry time. More...
|
|
virtual bool | Setup (const std::function< void(bool)> &action, const CppCommon::Timespan ×pan) |
| Setup the timer with an action function and expiry time relative to now. More...
|
|
virtual bool | WaitAsync () |
| Wait for the timer (asynchronous) More...
|
|
virtual bool | WaitSync () |
| Wait for the timer (synchronous) More...
|
|
virtual bool | Cancel () |
| Cancel any wait operation on the timer. More...
|
|
Timer.
Timer is used to plan and perform delayed operation.
Thread-safe.
- Examples
- asio_timer.cpp.
Definition at line 29 of file timer.h.