SObjectizer 5.8
Loading...
Searching...
No Matches
timertt::details::thread_impl_template< Engine > Class Template Reference

Template-based implementation of timer thread. More...

#include <all.hpp>

Inheritance diagram for timertt::details::thread_impl_template< Engine >:
timertt::details::basic_methods_impl_mixin< Engine, consumer_type::thread >

Public Member Functions

template<typename... Args>
 thread_impl_template (Args &&... args)
 Constructor with all parameters.
 
 ~thread_impl_template ()
 Destructor.
 
void start ()
 Start timer thread.
 
void shutdown ()
 Initiate shutdown for the timer thread without waiting for completion.
 
void join ()
 Wait for completion of timer thread.
 
void shutdown_and_join ()
 Initiate shutdown and wait for completion.
 
- Public Member Functions inherited from timertt::details::basic_methods_impl_mixin< Engine, consumer_type::thread >
 basic_methods_impl_mixin (Args &&... args)
 Constructor with all parameters.
 
timer_holder allocate ()
 Allocate of new timer object.
 
void activate (timer_holder timer, Duration_1 pause, timer_action action)
 Activate timer and schedule it for execution.
 
void activate (scoped_timer_object &timer, Duration_1 pause, timer_action action)
 Activate a scoped timer and schedule it for execution.
 
void activate (Duration_1 pause, timer_action action)
 Activate timer and schedule it for execution.
 
void activate (timer_holder timer, Duration_1 pause, Duration_2 period, timer_action action)
 Activate timer and schedule it for execution.
 
void activate (scoped_timer_object &timer, Duration_1 pause, Duration_2 period, timer_action action)
 Activate a scoped timer and schedule it for execution.
 
void activate (Duration_1 pause, Duration_2 period, timer_action action)
 Activate timer and schedule it for execution.
 
void reschedule (timer_holder timer, Duration_1 pause, timer_action action)
 Perform an attempt to reschedule a timer.
 
void reschedule (timer_holder timer, Duration_1 pause, Duration_2 period, timer_action action)
 Perform an attempt to reschedule a timer.
 
void deactivate (timer_holder timer)
 Deactivate timer and remove it from the list.
 
void deactivate (scoped_timer_object &timer)
 Deactivate timer and remove it from the list.
 
timer_quantities get_timer_quantities ()
 Count of timers of various types.
 
bool empty ()
 Check for emptiness.
 

Protected Member Functions

void body ()
 Thread body.
 
void sleep_for_next_event (typename base_type::lock_guard &lock)
 Waiting for next event to process.
 

Protected Attributes

Object's attributes.
bool m_shutdown = false
 Shutdown flag.
 
- Protected Attributes inherited from timertt::details::basic_methods_impl_mixin< Engine, consumer_type::thread >
Engine m_engine
 Actual timer engine instance.
 

Private Types

using base_type
 Shorthand for base type.
 

Additional Inherited Members

- Public Types inherited from timertt::details::basic_methods_impl_mixin< Engine, consumer_type::thread >
using thread_safety
 A typedef for thread safety type from Engine.
 
using timer_action
 An alias for timer_action type.
 
using scoped_timer_object
 An alias for scoped timer objects.
 
using timer_holder
 Shorthand for timer objects' smart pointer.
 

Detailed Description

template<typename Engine>
class timertt::details::thread_impl_template< Engine >

Template-based implementation of timer thread.

Template Parameters
Engineactual type of engine to be used.
Since
v.1.1.0

Definition at line 3513 of file 3rd_party/timertt/all.hpp.

Member Typedef Documentation

◆ base_type

template<typename Engine >
using timertt::details::thread_impl_template< Engine >::base_type
private
Initial value:

Shorthand for base type.

Definition at line 3517 of file 3rd_party/timertt/all.hpp.

Constructor & Destructor Documentation

◆ thread_impl_template()

template<typename Engine >
template<typename... Args>
timertt::details::thread_impl_template< Engine >::thread_impl_template ( Args &&... args)
inline

Constructor with all parameters.

Definition at line 3524 of file 3rd_party/timertt/all.hpp.

◆ ~thread_impl_template()

template<typename Engine >
timertt::details::thread_impl_template< Engine >::~thread_impl_template ( )
inline

Destructor.

Calls shutdown_and_join()

Definition at line 3534 of file 3rd_party/timertt/all.hpp.

Member Function Documentation

◆ body()

template<typename Engine >
void timertt::details::thread_impl_template< Engine >::body ( )
inlineprotected

Thread body.

Definition at line 3612 of file 3rd_party/timertt/all.hpp.

◆ join()

template<typename Engine >
void timertt::details::thread_impl_template< Engine >::join ( )
inline

Wait for completion of timer thread.

Method shutdown() must be called somewhere else.

Definition at line 3575 of file 3rd_party/timertt/all.hpp.

◆ shutdown()

template<typename Engine >
void timertt::details::thread_impl_template< Engine >::shutdown ( )
inline

Initiate shutdown for the timer thread without waiting for completion.

Definition at line 3559 of file 3rd_party/timertt/all.hpp.

◆ shutdown_and_join()

template<typename Engine >
void timertt::details::thread_impl_template< Engine >::shutdown_and_join ( )
inline

Initiate shutdown and wait for completion.

Definition at line 3593 of file 3rd_party/timertt/all.hpp.

◆ sleep_for_next_event()

template<typename Engine >
void timertt::details::thread_impl_template< Engine >::sleep_for_next_event ( typename base_type::lock_guard & lock)
inlineprotected

Waiting for next event to process.

If the list is not emply the thread will sleep until time point of the first timer in the list.

Parameters
lockObject's lock. The lock is necessary for waiting on condition variable.

Definition at line 3633 of file 3rd_party/timertt/all.hpp.

◆ start()

template<typename Engine >
void timertt::details::thread_impl_template< Engine >::start ( )
inline

Start timer thread.

Exceptions
std::runtime_errorif thread is already started.

Definition at line 3544 of file 3rd_party/timertt/all.hpp.

Member Data Documentation

◆ m_shutdown

template<typename Engine >
bool timertt::details::thread_impl_template< Engine >::m_shutdown = false
protected

Shutdown flag.

Definition at line 3605 of file 3rd_party/timertt/all.hpp.


The documentation for this class was generated from the following file: