Managed timer thread.
More...
#include <thread_group.h>
|
template<typename SecondaryFunction > |
static bool | launch_run (std::shared_ptr< TimerThread< Duration >> pThis, SecondaryFunction secondary_function) |
| Launch to the 'run' function which will, in turn, call the class' 'run' function, passing it the given 'secondary_function' for it to call as needed. More...
|
|
template<typename Function > |
static void | start (std::shared_ptr< TimerThread > timer_thread, Duration duration, Function function) |
| Start a given timer thread. More...
|
|
template<typename StartFunction , typename... Args> |
static bool | launch (std::shared_ptr< Thread > pThis, bool autoRemove, StartFunction start_function, Args...args) |
| Launch the given Thread object. More...
|
|
template<typename Duration>
class dmlc::TimerThread< Duration >
Managed timer thread.
- Template Parameters
-
Duration | Duration type (ie seconds, microseconds, etc) |
template<typename Duration >
Constructor.
- Parameters
-
name | Name of the timer thread |
owner | ThreadGroup owner if the timer thread |
template<typename Duration >
template<typename Duration >
template<typename SecondaryFunction >
static bool dmlc::TimerThread< Duration >::launch_run |
( |
std::shared_ptr< TimerThread< Duration >> |
pThis, |
|
|
SecondaryFunction |
secondary_function |
|
) |
| |
|
inlinestatic |
Launch to the 'run' function which will, in turn, call the class' 'run' function, passing it the given 'secondary_function' for it to call as needed.
- Template Parameters
-
SecondaryFunction | Type of the secondary function for 'run' override to call as needed |
- Parameters
-
pThis | Pointer to the managed thread to launch |
secondary_function | secondary function for 'run' override to call as needed |
- Returns
- true if thread is launched successfully and added to the ThreadGroup
template<typename Duration >
template<typename OnTimerFunction >
Internal timer execution function.
- Template Parameters
-
OnTimerFunction | Type of function to call each time the timer expires |
- Parameters
-
on_timer_function | Function to call each time the timer expires |
- Returns
- Exit code of the thread
template<typename Duration >
template<typename Function >
static void dmlc::TimerThread< Duration >::start |
( |
std::shared_ptr< TimerThread< Duration > > |
timer_thread, |
|
|
Duration |
duration, |
|
|
Function |
function |
|
) |
| |
|
inlinestatic |
Start a given timer thread.
- Template Parameters
-
Function | Type of the timer function |
- Parameters
-
timer_thread | Thread object to perform the timer events |
duration | Duration between the end end of the timer function and the next timer event |
function | Function to call when the timer expires |
- Note
- Calling shutdown_requested() will cause the thread to exit the next time that the timer expires.
The documentation for this class was generated from the following file: