SObjectizer 5.8
Loading...
Searching...
No Matches
timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler > Class Template Reference

A timer wheel thread template. More...

#include <all.hpp>

Inheritance diagram for timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler >:
timertt::details::thread_impl_template< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler > > timertt::details::basic_methods_impl_mixin< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler >, consumer_type::thread > timertt::details::timer_wheel_engine_defaults

Public Member Functions

 timer_wheel_thread_template ()
 Default constructor.
 
 timer_wheel_thread_template (unsigned int wheel_size, monotonic_clock::duration granularity)
 Constructor with wheel size and granularity parameters.
 
 timer_wheel_thread_template (unsigned int wheel_size, monotonic_clock::duration granularity, Error_Logger error_logger, Actor_Exception_Handler exception_handler)
 Constructor with all parameters.
 
- Public Member Functions inherited from timertt::details::thread_impl_template< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler > >
 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< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler >, 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.
 

Private Types

using base_type
 

Additional Inherited Members

- Public Types inherited from timertt::details::basic_methods_impl_mixin< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler >, 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.
 
- Static Public Member Functions inherited from timertt::details::timer_wheel_engine_defaults
static unsigned int default_wheel_size ()
 Default wheel size.
 
static monotonic_clock::duration default_granularity ()
 Default tick duration.
 
- Protected Member Functions inherited from timertt::details::thread_impl_template< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler > >
void body ()
 Thread body.
 
void sleep_for_next_event (typename base_type::lock_guard &lock)
 Waiting for next event to process.
 
- Protected Attributes inherited from timertt::details::thread_impl_template< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler > >
bool m_shutdown
 Shutdown flag.
 
- Protected Attributes inherited from timertt::details::basic_methods_impl_mixin< details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler >, consumer_type::thread >
details::timer_wheel_engine< ::timertt::thread_safety::safe, Timer_Action, Error_Logger, Actor_Exception_Handler > m_engine
 Actual timer engine instance.
 

Detailed Description

template<typename Timer_Action, typename Error_Logger, typename Actor_Exception_Handler>
class timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler >

A timer wheel thread template.

Please see description of details::timer_wheel_engine for the details of the timer wheel mechanism.

Template Parameters
Timer_Actiontype of functor to perform an user-defined action when timer expires. This must be Moveable and MoveConstructible type.
Error_Loggertype of logger for errors detected during timer thread execution. Interface for error logger is defined by default_error_logger class.
Actor_Exception_Handlertype of handler for dealing with exceptions thrown from timer actors. Interface for exception handler is defined by default_actor_exception_handler.

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

Member Typedef Documentation

◆ base_type

template<typename Timer_Action , typename Error_Logger , typename Actor_Exception_Handler >
using timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler >::base_type
private
Initial value:
details::thread_impl_template<
details::timer_wheel_engine<
Timer_Action,
Error_Logger,
Actor_Exception_Handler > >
Indicator for thread-safe implemetation.

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

Constructor & Destructor Documentation

◆ timer_wheel_thread_template() [1/3]

template<typename Timer_Action , typename Error_Logger , typename Actor_Exception_Handler >
timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler >::timer_wheel_thread_template ( )
inline

Default constructor.

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

◆ timer_wheel_thread_template() [2/3]

template<typename Timer_Action , typename Error_Logger , typename Actor_Exception_Handler >
timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler >::timer_wheel_thread_template ( unsigned int wheel_size,
monotonic_clock::duration granularity )
inline

Constructor with wheel size and granularity parameters.

Parameters
wheel_sizeSize of the wheel.
granularitySize of time step for the timer_wheel.

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

◆ timer_wheel_thread_template() [3/3]

template<typename Timer_Action , typename Error_Logger , typename Actor_Exception_Handler >
timertt::timer_wheel_thread_template< Timer_Action, Error_Logger, Actor_Exception_Handler >::timer_wheel_thread_template ( unsigned int wheel_size,
monotonic_clock::duration granularity,
Error_Logger error_logger,
Actor_Exception_Handler exception_handler )
inline

Constructor with all parameters.

Parameters
wheel_sizeSize of the wheel.
granularitySize of time step for the timer_wheel.
error_loggerAn error logger for timer thread.
exception_handlerAn actor exception handler for timer thread.

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


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