SSP21-CPP
Public Member Functions | Static Public Member Functions | List of all members
exe4cpp::StrandExecutor Class Referencefinal

#include <exe4cpp/asio/StrandExecutor.h>

Public Member Functions

 StrandExecutor (const std::shared_ptr< asio::io_service > &io_service)
 
std::shared_ptr< StrandExecutorfork ()
 
virtual Timer start (const duration_t &duration, const action_t &action) override
 
virtual Timer start (const steady_time_t &expiration, const action_t &action) override
 
virtual void post (const action_t &action) override
 
virtual steady_time_t get_time () override
 
std::shared_ptr< asio::io_service > get_service ()
 
template<typename handler_t >
asio::detail::wrapped_handler< asio::strand, handler_t, asio::detail::is_continuation_if_running > wrap (const handler_t &handler)
 

Static Public Member Functions

static std::shared_ptr< StrandExecutorcreate (const std::shared_ptr< asio::io_service > &io_service)
 

Detailed Description

Implementation of openpal::IExecutor backed by asio::strand

Shutdown life-cycle guarantees are provided by using std::shared_ptr

Definition at line 43 of file StrandExecutor.h.

Member Function Documentation

◆ start() [1/2]

virtual Timer exe4cpp::StrandExecutor::start ( const duration_t &  duration,
const action_t &  action 
)
inlineoverridevirtual
Returns
start a new timer based on a relative time duration

Implements exe4cpp::IExecutor.

Definition at line 67 of file StrandExecutor.h.

◆ start() [2/2]

virtual Timer exe4cpp::StrandExecutor::start ( const steady_time_t &  expiration,
const action_t &  action 
)
inlineoverridevirtual
Returns
start a new timer based on an absolute timestamp of the steady clock

Implements exe4cpp::IExecutor.

Definition at line 72 of file StrandExecutor.h.

◆ post()

virtual void exe4cpp::StrandExecutor::post ( const action_t &  action)
inlineoverridevirtual
Returns
Thread-safe way to post an event to be handled asynchronously

Implements exe4cpp::IExecutor.

Definition at line 92 of file StrandExecutor.h.

◆ get_time()

virtual steady_time_t exe4cpp::StrandExecutor::get_time ( )
inlineoverridevirtual
Returns
a non-absolute timestamp for the monotonic time source

Implements exe4cpp::ISteadyTimeSource.

Definition at line 102 of file StrandExecutor.h.