|
| template<typename... Args> |
| | basic_methods_impl_mixin (Args &&... args) |
| | Constructor with all parameters. More...
|
| |
| timer_holder | allocate () |
| | Allocate of new timer object. More...
|
| |
| template<class Duration_1 > |
| void | activate (timer_holder timer, Duration_1 pause, timer_action action) |
| | Activate timer and schedule it for execution. More...
|
| |
| template<class Duration_1 > |
| void | reschedule (timer_holder timer, Duration_1 pause, timer_action action) |
| | Perform an attempt to reschedule a timer. More...
|
| |
| template<class Duration_1 > |
| void | activate (scoped_timer_object &timer, Duration_1 pause, timer_action action) |
| | Activate a scoped timer and schedule it for execution. More...
|
| |
| template<class Duration_1 > |
| void | activate (Duration_1 pause, timer_action action) |
| | Activate timer and schedule it for execution. More...
|
| |
| template<class Duration_1 , class Duration_2 > |
| void | activate (timer_holder timer, Duration_1 pause, Duration_2 period, timer_action action) |
| | Activate timer and schedule it for execution. More...
|
| |
| template<class Duration_1 , class Duration_2 > |
| void | reschedule (timer_holder timer, Duration_1 pause, Duration_2 period, timer_action action) |
| | Perform an attempt to reschedule a timer. More...
|
| |
| template<class Duration_1 , class Duration_2 > |
| void | activate (scoped_timer_object &timer, Duration_1 pause, Duration_2 period, timer_action action) |
| | Activate a scoped timer and schedule it for execution. More...
|
| |
| template<class Duration_1 , class Duration_2 > |
| void | activate (Duration_1 pause, Duration_2 period, timer_action action) |
| | Activate timer and schedule it for execution. More...
|
| |
| void | deactivate (timer_holder timer) |
| | Deactivate timer and remove it from the list. More...
|
| |
| void | deactivate (scoped_timer_object &timer) |
| | Deactivate timer and remove it from the list. More...
|
| |
| timer_quantities | get_timer_quantities () |
| | Count of timers of various types. More...
|
| |
| bool | empty () |
| | Check for emptiness. More...
|
| |
template<typename Engine, typename Consumer>
class timertt::details::basic_methods_impl_mixin< Engine, Consumer >
A implementation of basic methods for timer managers and timer threads.
- Template Parameters
-
- Since
- v.1.1.0
template<typename Engine, typename Consumer>
template<class Duration_1 >
Activate timer and schedule it for execution.
There is no need to preallocate timer object. It will be allocated automatically, but not be shown to user.
- Exceptions
-
| std::exception | If timer thread is not started. |
- Template Parameters
-
| Duration_1 | actual type which represents time duration. |
- Parameters
-
| pause | Pause for timer execution. |
| action | Action for the timer. |
template<typename Engine, typename Consumer>
template<class Duration_1 , class Duration_2 >
Activate timer and schedule it for execution.
There is no need to preallocate timer object. It will be allocated automatically, but not be shown to user.
- Exceptions
-
| std::exception | If timer thread is not started. |
- Template Parameters
-
| Duration_1 | actual type which represents time duration. |
| Duration_2 | actual type which represents time duration. |
- Parameters
-
| pause | Pause for timer execution. |
| period | Repetition period. If Duration_2::zero() == period then timer will be single-shot. |
| action | Action for the timer. |
template<typename Engine, typename Consumer>
template<class Duration_1 >
Perform an attempt to reschedule a timer.
Before v.1.2.1 there was just one way to reschedule a timer: method deactivate() must be called first and then method activate() must be called for the same timer. This approach is not fast because in the case of thread-safe engines it requires two operations on a mutex.
Since v.1.2.1 there is a reschedule() method which does deactivation of a timer (if it is active) and then new activation of this timer. All actions are performed by using just one operation on a mutex.
- Note
- This operation can fail if the timer to be rescheduled is in processing. Because of that it is recommended to use such operation for timer_managers only. But even with timer_managers this operation should be used with care.
- Attention
- It move operator for a timer_action throws then timer will be deactivated. The state for a timer_action itself will be unknown.
- Exceptions
-
| std::exception | If timer thread is not started. |
| std::exception | If timer is in processing right now. |
- Template Parameters
-
| Duration_1 | actual type which represents time duration. |
- Since
- v.1.2.1
- Parameters
-
| timer | Timer to be rescheduled. |
| pause | Pause for timer execution. |
| action | Action for the timer. |
template<typename Engine, typename Consumer>
template<class Duration_1 , class Duration_2 >
Perform an attempt to reschedule a timer.
Before v.1.2.1 there was just one way to reschedule a timer: method deactivate() must be called first and then method activate() must be called for the same timer. This approach is not fast because in the case of thread-safe engines it requires two operations on a mutex.
Since v.1.2.1 there is a reschedule() method which does deactivation of a timer (if it is active) and then new activation of this timer. All actions are performed by using just one operation on a mutex.
- Note
- This operation can fail if the timer to be rescheduled is in processing. Because of that it is recommended to use such operation for timer_managers only. But even with timer_managers this operation should be used with care.
- Attention
- It move operator for a timer_action throws then timer will be deactivated. The state for a timer_action itself will be unknown.
- Exceptions
-
| std::exception | If timer thread is not started. |
| std::exception | If timer is in processing right now. |
- Template Parameters
-
| Duration_1 | actual type which represents time duration. |
| Duration_2 | actual type which represents time duration. |
- Since
- v.1.2.1
- Parameters
-
| timer | Timer to be activated. |
| pause | Pause for timer execution. |
| period | Repetition period. If Duration_2::zero() == period then timer will be single-shot. |
| action | Action for the timer. |