SObjectizer  5.8
Loading...
Searching...
No Matches
so_5::execution_hint_t Class Reference

A hint for a dispatcher for execution of event for the concrete execution_demand. More...

#include <execution_demand.hpp>

Public Types

using direct_func_t
 Type of function for calling event handler directly.
 

Public Member Functions

 execution_hint_t (execution_demand_t &demand, direct_func_t direct_func, thread_safety_t thread_safety)
 Initializing constructor.
 
void exec (current_thread_id_t working_thread_id) const
 Call event handler directly.
 
bool is_thread_safe () const
 Is thread safe handler?
 

Static Public Member Functions

static execution_hint_t create_empty_execution_hint (execution_demand_t &demand)
 

Private Member Functions

 execution_hint_t (execution_demand_t &demand)
 

Private Attributes

execution_demand_tm_demand
 A reference to demand for which that hint has been created.
 
direct_func_t m_direct_func
 Function for call event handler directly.
 
thread_safety_t m_thread_safety
 Thread safety for event handler.
 

Detailed Description

A hint for a dispatcher for execution of event for the concrete execution_demand.

An instance of execution hint can be in two "states":

  • holds actual event handler. In that case an invocation of exec() method will decrement message limit counter and then will call the event handler;
  • empty. In that case an invocation of exec() method will only decrement message limit counter and nothing more.
Since
v.5.4.0

Definition at line 129 of file execution_demand.hpp.

Member Typedef Documentation

◆ direct_func_t

Initial value:
std::function<
void( execution_demand_t &, current_thread_id_t ) >
std::thread::id current_thread_id_t
Type of the current thread id.

Type of function for calling event handler directly.

Definition at line 133 of file execution_demand.hpp.

Constructor & Destructor Documentation

◆ execution_hint_t() [1/2]

so_5::execution_hint_t::execution_hint_t ( execution_demand_t & demand,
direct_func_t direct_func,
thread_safety_t thread_safety )
inline

Initializing constructor.

Definition at line 137 of file execution_demand.hpp.

◆ execution_hint_t() [2/2]

so_5::execution_hint_t::execution_hint_t ( execution_demand_t & demand)
inlineprivate

A special constructor for the case when there is no handler for message.

Definition at line 191 of file execution_demand.hpp.

Member Function Documentation

◆ create_empty_execution_hint()

static execution_hint_t so_5::execution_hint_t::create_empty_execution_hint ( execution_demand_t & demand)
inlinestatic

Create execution_hint object for the case when event handler not found.

This hint is necessary only for decrementing the counter of messages if message limit is used for the message to be processed.

Definition at line 174 of file execution_demand.hpp.

◆ exec()

void so_5::execution_hint_t::exec ( current_thread_id_t working_thread_id) const
inline

Call event handler directly.

Definition at line 148 of file execution_demand.hpp.

◆ is_thread_safe()

bool so_5::execution_hint_t::is_thread_safe ( ) const
inline

Is thread safe handler?

Definition at line 162 of file execution_demand.hpp.

Member Data Documentation

◆ m_demand

execution_demand_t& so_5::execution_hint_t::m_demand
private

A reference to demand for which that hint has been created.

Definition at line 181 of file execution_demand.hpp.

◆ m_direct_func

direct_func_t so_5::execution_hint_t::m_direct_func
private

Function for call event handler directly.

Definition at line 184 of file execution_demand.hpp.

◆ m_thread_safety

thread_safety_t so_5::execution_hint_t::m_thread_safety
private

Thread safety for event handler.

Definition at line 187 of file execution_demand.hpp.


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