|
SObjectizer
5.8
|
An indentificator for the timer. More...
#include <timers.hpp>
Public Member Functions | |
| timer_id_t () noexcept=default | |
| Default constructor. | |
| timer_id_t (so_5::intrusive_ptr_t< timer_t > &&timer) noexcept | |
| Initializing constructor. | |
| bool | is_active () const noexcept |
| void | release () noexcept |
| Release the timer event. | |
Private Attributes | |
| so_5::intrusive_ptr_t< timer_t > | m_timer |
| Actual timer. | |
Friends | |
| void | swap (timer_id_t &a, timer_id_t &b) noexcept |
| Swapping. | |
An indentificator for the timer.
This type is Copyable and Moveable.
Instances of this type work like smart pointers: a reference counter for a timer event is used. When a timer_id is copied this counter is incremented. When a timer_id dies this counter is decremented. When the last timer_id dies then the timer event if cancelled (released).
The timer event can be cancelled explicitly by calling release() method.
The method is_active() allows to check if timer event is not cancelled yet.
Definition at line 81 of file timers.hpp.
|
defaultnoexcept |
Default constructor.
|
inlinenoexcept |
Initializing constructor.
Definition at line 87 of file timers.hpp.
|
inlinenoexcept |
Is this timer event is active?
| true | if timer event wasn't cancelled yet. |
| false | if timer event was cancelled by release() call. |
true even if timer event is already fired. The false will be returned only if release() was called explicitly. Definition at line 108 of file timers.hpp.
|
inlinenoexcept |
Release the timer event.
Definition at line 115 of file timers.hpp.
|
friend |
Swapping.
Definition at line 94 of file timers.hpp.
|
private |
Actual timer.
Definition at line 123 of file timers.hpp.