SObjectizer  5.5
Public Member Functions | Protected Member Functions | Private Types | List of all members
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. More...
 
 ~thread_impl_template ()
 Destructor. More...
 
void start ()
 Start timer thread. More...
 
void shutdown ()
 Initiate shutdown for the timer thread without waiting for completion. More...
 
void join ()
 Wait for completion of timer thread. More...
 
void shutdown_and_join ()
 Initiate shutdown and wait for completion. More...
 
- 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. More...
 
timer_holder allocate ()
 Allocate of new timer object. More...
 
void activate (timer_holder timer, Duration_1 pause, timer_action action)
 Activate timer and schedule it for execution. More...
 
void activate (scoped_timer_object &timer, Duration_1 pause, timer_action action)
 Activate a scoped timer and schedule it for execution. More...
 
void activate (Duration_1 pause, timer_action action)
 Activate timer and schedule it for execution. More...
 
void activate (timer_holder timer, Duration_1 pause, Duration_2 period, timer_action action)
 Activate timer and schedule it for execution. More...
 
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...
 
void activate (Duration_1 pause, Duration_2 period, timer_action action)
 Activate timer and schedule it for execution. More...
 
void reschedule (timer_holder timer, Duration_1 pause, timer_action action)
 Perform an attempt to reschedule a timer. More...
 
void reschedule (timer_holder timer, Duration_1 pause, Duration_2 period, timer_action action)
 Perform an attempt to reschedule a timer. 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...
 

Protected Member Functions

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

Protected Attributes

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

Private Types

using base_type = basic_methods_impl_mixin< Engine, consumer_type::thread >
 Shorthand for base type. More...
 

Additional Inherited Members

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

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

Member Typedef Documentation

◆ base_type

template<typename Engine>
using timertt::details::thread_impl_template< Engine >::base_type = basic_methods_impl_mixin< Engine, consumer_type::thread >
private

Shorthand for base type.

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.

◆ ~thread_impl_template()

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

Destructor.

Calls shutdown_and_join()

Member Function Documentation

◆ body()

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

Thread body.

◆ 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.

◆ shutdown()

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

Initiate shutdown for the timer thread without waiting for completion.

◆ shutdown_and_join()

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

Initiate shutdown and wait for completion.

◆ 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.

◆ start()

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

Start timer thread.

Exceptions
std::runtime_errorif thread is already started.

Member Data Documentation

◆ m_shutdown

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

Shutdown flag.


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