SObjectizer  5.5
Namespaces | Classes | Typedefs | Functions
so_5::impl Namespace Reference

Details of SObjectizer run-time implementations. More...

Namespaces

 adaptive_subscr_storage
 An adaptive storage for agent's subscriptions information.
 
 agent_core_details
 Implementation details related to cooperations and agents repository.
 
 anonymous_namespace{coop.cpp}
 
 anonymous_namespace{coop_repository_basis.cpp}
 
 anonymous_namespace{mbox_core.cpp}
 
 anonymous_namespace{process_unhandled_exception.cpp}
 
 coop_dereg
 Details of cooperation deregistration implementation.
 
 hash_table_subscr_storage
 A hash_table-based storage for agent's subscriptions information.
 
 local_mbox_details
 Implementation details for MPMC mboxes.
 
 map_based_subscr_storage
 A map-based storage for agent's subscriptions information.
 
 msg_tracing_helpers
 Various helpers for message delivery tracing mechanism.
 
 subscription_storage_common
 Common stuff for various subscription storage implementations.
 
 vector_based_subscr_storage
 A vector-based storage for agent's subscriptions information.
 

Classes

class  coop_impl_t
 An internal class with real implementation of coop's logic. More...
 
class  coop_private_iface_t
 A special class for accessing private members of agent_coop. More...
 
class  coop_repository_basis_t
 A basic part for various implementations of coop_repository. More...
 
class  delivery_filter_storage_t
 Storage for message delivery filters. More...
 
struct  event_handler_data_t
 Information about event_handler and its properties. More...
 
struct  instantiator_and_sender
 
struct  instantiator_and_sender_base
 
struct  instantiator_and_sender_base< Message, true >
 
class  internal_agent_iface_t
 A special class for access to private/protected members of agent class. More...
 
class  internal_env_iface_t
 A helper class for accessing the functionality of environment-class which is specific for SObjectizer internals only. More...
 
class  layer_core_t
 An utility class for working with layers. More...
 
class  limitful_mpsc_mbox_template
 A multi-producer/single-consumer mbox with message limit control. More...
 
class  limitless_mpsc_mbox_template
 A multi-producer/single-consumer mbox definition. More...
 
class  local_mbox_template
 A template with implementation of local mbox. More...
 
class  mbox_core_ref_t
 Smart reference to the mbox_core_t. More...
 
struct  mbox_core_stats_t
 Statistics from mbox_core for run-time monitoring. More...
 
class  mbox_core_t
 A utility class for the work with mboxes. More...
 
class  mbox_iface_for_timers_t
 Helper class for accessing protected members from mbox interface. More...
 
class  named_local_mbox_t
 A class for the named local mbox. More...
 
class  so_quick_environment_t
 Auxiliary class for the SObjectizer launching. More...
 
class  state_listener_controller_t
 
class  state_switch_guard_t
 
class  stop_guard_repository_t
 Repository of stop_guards. More...
 
class  subscription_storage_t
 An interface of subscription storage. More...
 
struct  typed_layer_ref_t
 A special wrapper to store a layer with its type. More...
 

Typedefs

using internal_state_listener_unique_ptr_t = std::unique_ptr< agent_state_listener_t, void(*)(agent_state_listener_t *) >
 Name of unique-ptr to be used inside SObjectizer. More...
 
using so_layer_list_t = std::vector< typed_layer_ref_t >
 Typedef for typed_layer_ret container. More...
 
using local_mbox_without_tracing = local_mbox_template< msg_tracing_helpers::tracing_disabled_base >
 Alias for local mbox without message delivery tracing. More...
 
using local_mbox_with_tracing = local_mbox_template< msg_tracing_helpers::tracing_enabled_base >
 Alias for local mbox with message delivery tracing. More...
 
using limitless_mpsc_mbox_without_tracing = limitless_mpsc_mbox_template< msg_tracing_helpers::tracing_disabled_base >
 Alias for limitless_mpsc_mbox without message delivery tracing. More...
 
using limitless_mpsc_mbox_with_tracing = limitless_mpsc_mbox_template< msg_tracing_helpers::tracing_enabled_base >
 Alias for limitless_mpsc_mbox with message delivery tracing. More...
 
using limitful_mpsc_mbox_without_tracing = limitful_mpsc_mbox_template< msg_tracing_helpers::tracing_disabled_base >
 Alias for limitful_mpsc_mbox without message delivery tracing. More...
 
using limitful_mpsc_mbox_with_tracing = limitful_mpsc_mbox_template< msg_tracing_helpers::tracing_enabled_base >
 Alias for limitful_mpsc_mbox with message delivery tracing. More...
 
using subscription_storage_unique_ptr_t = std::unique_ptr< subscription_storage_t >
 Typedef for unique pointer to subscription_storage object. More...
 

Functions

so_layer_list_t::const_iterator search_for_layer (const so_layer_list_t &layers, const std::type_index &type)
 Find layer in container. More...
 
void call_shutdown (typed_layer_ref_t &tl)
 
void call_wait (typed_layer_ref_t &tl)
 
void process_unhandled_exception ( current_thread_id_t working_thread_id, const std::exception &ex, agent_t &a_exception_producer)
 Processor of unhandled exception from agent's event handler. More...
 
void process_unhandled_unknown_exception ( current_thread_id_t working_thread_id, agent_t &a_exception_producer) noexcept
 Processor of unhandled exception of unknown type from agent's event handler. More...
 
bool special_agent_ptr_compare (const agent_t &a, const agent_t &b) noexcept
 
so_5::disp::mpsc_queue_traits::lock_factory_t default_lock_factory (environment_t &env, const so_5::disp::mpsc_queue_traits::lock_factory_t &)
 Helper function to be used for extraction of lock_factory for MPSC queues. More...
 
template<typename Init_Fn >
void wrap_init_fn_call (Init_Fn init_fn)
 A special wrapper for calling init function. More...
 
template<typename Init_Fn , typename Deinit_Fn , typename Next_Stage >
void run_stage (const std::string &stage_name, Init_Fn &&init_fn, Deinit_Fn &&deinit_fn, Next_Stage &&next_stage)
 Helper template function for doing initialization phase with rollback on failure. More...
 
void ensure_join_from_different_thread (current_thread_id_t thread_to_be_joined)
 Ensures that join will be called from different thread. More...
 

Detailed Description

Details of SObjectizer run-time implementations.

Typedef Documentation

◆ internal_state_listener_unique_ptr_t

Name of unique-ptr to be used inside SObjectizer.

Internal unique-ptr to agent_state_listener_t should have a custom deleter. It allows to use the same unique_ptr for destroyable and non-destroyable listeners.

Since
v.5.6.0

◆ limitful_mpsc_mbox_with_tracing

Alias for limitful_mpsc_mbox with message delivery tracing.

Since
v.5.5.9

◆ limitful_mpsc_mbox_without_tracing

Alias for limitful_mpsc_mbox without message delivery tracing.

Since
v.5.5.9

◆ limitless_mpsc_mbox_with_tracing

Alias for limitless_mpsc_mbox with message delivery tracing.

Since
v.5.5.9

◆ limitless_mpsc_mbox_without_tracing

Alias for limitless_mpsc_mbox without message delivery tracing.

Since
v.5.5.9

◆ local_mbox_with_tracing

Alias for local mbox with message delivery tracing.

Since
v.5.5.9

◆ local_mbox_without_tracing

Alias for local mbox without message delivery tracing.

Since
v.5.5.9

◆ so_layer_list_t

using so_5::impl::so_layer_list_t = typedef std::vector< typed_layer_ref_t >

Typedef for typed_layer_ret container.

◆ subscription_storage_unique_ptr_t

Typedef for unique pointer to subscription_storage object.

Since
v.5.5.3

Function Documentation

◆ call_shutdown()

void so_5::impl::call_shutdown ( typed_layer_ref_t tl)

◆ call_wait()

void so_5::impl::call_wait ( typed_layer_ref_t tl)

◆ default_lock_factory()

so_5::disp::mpmc_queue_traits::lock_factory_t so_5::impl::default_lock_factory ( environment_t env,
const so_5::disp::mpsc_queue_traits::lock_factory_t  
)
inline

Helper function to be used for extraction of lock_factory for MPSC queues.

Note
Intended to be used in template code:
template< typename Disp_Params >
auto
safe_get_lock_factory( so_5::environment_t & env, Disp_Params & params )
{
auto lf = params.queue_params().lock_factory();
if( !lf )
return lf;
}
A call to default_lock_factory() will return appropriate lock_factory for MPSC or MPMC queues.
Since
v.5.5.18

◆ ensure_join_from_different_thread()

void so_5::impl::ensure_join_from_different_thread ( current_thread_id_t  thread_to_be_joined)
inline

Ensures that join will be called from different thread.

It's a mistake if thread::join() is called from the context of thread to be joined. Unfortunately, different implementations of stdlib work differently. There can be an exception. Or there can be deadlock, or there can be memory damage.

It is better to check for that error manually and throw an exception if the error is detected.

Since
v.5.6.0

◆ process_unhandled_exception()

void so_5::impl::process_unhandled_exception ( current_thread_id_t  working_thread_id,
const std::exception &  ex,
agent_t a_exception_producer 
)

Processor of unhandled exception from agent's event handler.

Since
v.5.4.0
Parameters
working_thread_idID of working thread for the problematic agent. NULL thread id means that agent is multithreadded. For such cases only subset of exception_reaction is allowed (ignore_exception, abort_on_exception).
exRaised and caught exception.
a_exception_producerAgent who is the producer of the exception.

◆ process_unhandled_unknown_exception()

void so_5::impl::process_unhandled_unknown_exception ( current_thread_id_t  working_thread_id,
agent_t a_exception_producer 
)
noexcept

Processor of unhandled exception of unknown type from agent's event handler.

Since
v.5.5.24.3
Note
This function will be called from catch(...) and because of that there is no actual exception object.
Parameters
working_thread_idID of working thread for the problematic agent. NULL thread id means that agent is multithreadded. For such cases only subset of exception_reaction is allowed (ignore_exception, abort_on_exception).
a_exception_producerAgent who is the producer of the exception.

◆ run_stage()

template<typename Init_Fn , typename Deinit_Fn , typename Next_Stage >
void so_5::impl::run_stage ( const std::string &  stage_name,
Init_Fn &&  init_fn,
Deinit_Fn &&  deinit_fn,
Next_Stage &&  next_stage 
)

Helper template function for doing initialization phase with rollback on failure.

Since
v.5.5.19

◆ search_for_layer()

so_layer_list_t::const_iterator so_5::impl::search_for_layer ( const so_layer_list_t layers,
const std::type_index &  type 
)
inline

Find layer in container.

◆ special_agent_ptr_compare()

bool so_5::impl::special_agent_ptr_compare ( const agent_t a,
const agent_t b 
)
inlinenoexcept

◆ wrap_init_fn_call()

template<typename Init_Fn >
void so_5::impl::wrap_init_fn_call ( Init_Fn  init_fn)

A special wrapper for calling init function.

This wrapper calls init function and catch exception. If an exception is derived from std::exception it will be rethrown. If an exception is caught by catch(...) statement then an instance of so_5::exception_t will be thrown instead of caught exception.

Since
v.5.5.24.3