SObjectizer  5.5
Public Member Functions | Private Member Functions | List of all members
so_5::timer_thread_t Class Referenceabstract

Timer thread interface. More...

#include <timers.hpp>

Inheritance diagram for so_5::timer_thread_t:
so_5::timers_details::actual_thread_t< Timer_Thread >

Public Member Functions

 timer_thread_t ()=default
 
virtual ~timer_thread_t ()=default
 
virtual void start ()=0
 Launch timer. More...
 
virtual void finish ()=0
 Finish timer and wait for full stop. More...
 
virtual timer_id_t schedule (const std::type_index &type_index, const mbox_t &mbox, const message_ref_t &msg, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period)=0
 Push delayed/periodic message to the timer queue. More...
 
virtual void schedule_anonymous (const std::type_index &type_index, const mbox_t &mbox, const message_ref_t &msg, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period)=0
 Push anonymous delayed/periodic message to the timer queue. More...
 
virtual timer_thread_stats_t query_stats ()=0
 Get statistics for run-time monitoring. More...
 

Private Member Functions

 timer_thread_t (const timer_thread_t &)=delete
 
timer_thread_toperator= (const timer_thread_t &)=delete
 

Detailed Description

Timer thread interface.

All timer threads for SObjectizer must be derived from this class.

A real timer may not be implemented as a thread. The name of this class is just a consequence of some historic reasons.

A timer is started by timer_thread_t::start() method. To stop timer the timer_thread_t::finish() method is used. The finish() method should block caller until all timer resources will be released and all dedicated timer threads (if any) are completelly stopped.

Constructor & Destructor Documentation

◆ timer_thread_t() [1/2]

so_5::timer_thread_t::timer_thread_t ( const timer_thread_t )
privatedelete

◆ timer_thread_t() [2/2]

so_5::timer_thread_t::timer_thread_t ( )
default

◆ ~timer_thread_t()

virtual so_5::timer_thread_t::~timer_thread_t ( )
virtualdefault

Member Function Documentation

◆ finish()

virtual void so_5::timer_thread_t::finish ( )
pure virtual

Finish timer and wait for full stop.

Implemented in so_5::timers_details::actual_thread_t< Timer_Thread >.

◆ operator=()

timer_thread_t& so_5::timer_thread_t::operator= ( const timer_thread_t )
privatedelete

◆ query_stats()

virtual timer_thread_stats_t so_5::timer_thread_t::query_stats ( )
pure virtual

Get statistics for run-time monitoring.

Since
v.5.5.4

Implemented in so_5::timers_details::actual_thread_t< Timer_Thread >.

◆ schedule()

virtual timer_id_t so_5::timer_thread_t::schedule ( const std::type_index &  type_index,
const mbox_t mbox,
const message_ref_t msg,
std::chrono::steady_clock::duration  pause,
std::chrono::steady_clock::duration  period 
)
pure virtual

Push delayed/periodic message to the timer queue.

A timer can be deactivated later by using returned timer_id.

Parameters
type_indexType of message to be sheduled.
mboxMbox for message delivery.
msgMessage to be sent.
pausePause before first message delivery.
periodPeriod for message repetition. Zero value means single shot delivery.

Implemented in so_5::timers_details::actual_thread_t< Timer_Thread >.

◆ schedule_anonymous()

virtual void so_5::timer_thread_t::schedule_anonymous ( const std::type_index &  type_index,
const mbox_t mbox,
const message_ref_t msg,
std::chrono::steady_clock::duration  pause,
std::chrono::steady_clock::duration  period 
)
pure virtual

Push anonymous delayed/periodic message to the timer queue.

A timer cannot be deactivated later.

Parameters
type_indexType of message to be sheduled.
mboxMbox for message delivery.
msgMessage to be sent.
pausePause before first message delivery.
periodPeriod for message repetition. Zero value means single shot delivery.

Implemented in so_5::timers_details::actual_thread_t< Timer_Thread >.

◆ start()

virtual void so_5::timer_thread_t::start ( )
pure virtual

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