SObjectizer  5.5
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
so_5::environment_params_t Class Reference

Parameters for the SObjectizer Environment initialization. More...

#include <environment.hpp>

Public Member Functions

 environment_params_t ()
 Constructor. More...
 
 environment_params_t (environment_params_t &&other)
 Move constructor. More...
 
 ~environment_params_t ()
 
environment_params_toperator= (environment_params_t &&other)
 Move operator. More...
 
environment_params_ttimer_thread (so_5::timer_thread_factory_t factory)
 Set the timer_thread factory. More...
 
template<class SO_Layer >
environment_params_tadd_layer (std::unique_ptr< SO_Layer > layer_ptr)
 Add an additional layer to the SObjectizer Environment. More...
 
environment_params_tcoop_listener (coop_listener_unique_ptr_t coop_listener)
 Set cooperation listener object. More...
 
environment_params_tevent_exception_logger (event_exception_logger_unique_ptr_t logger)
 Set exception logger object. More...
 
environment_params_tdisable_autoshutdown ()
 Do not shutdown SO Environment when it is becomes empty. More...
 
SO_5_NODISCARD bool autoshutdown_disabled () const
 Is autoshutdown disabled? More...
 
environment_params_terror_logger (error_logger_shptr_t logger)
 Set error logger for the environment. More...
 
environment_params_tmessage_delivery_tracer (so_5::msg_tracing::tracer_unique_ptr_t tracer)
 Set message delivery tracer for the environment. More...
 
environment_params_tmessage_delivery_tracer_filter (so_5::msg_tracing::filter_shptr_t filter)
 Set message tracer filter for the environment. More...
 
environment_params_tdefault_disp_params (so_5::disp::one_thread::disp_params_t params)
 Set parameters for the default dispatcher. More...
 
const so_5::disp::one_thread::disp_params_tdefault_disp_params () const
 Get the parameters for the default dispatcher. More...
 
environment_params_twork_thread_activity_tracking (work_thread_activity_tracking_t flag)
 Set activity tracking flag for the whole SObjectizer Environment. More...
 
work_thread_activity_tracking_t work_thread_activity_tracking () const
 Get activity tracking flag for the whole SObjectizer Environment. More...
 
environment_params_tturn_work_thread_activity_tracking_on ()
 Helper for turning work thread activity tracking on. More...
 
environment_params_tturn_work_thread_activity_tracking_off ()
 Helper for turning work thread activity tracking off. More...
 
environment_params_tqueue_locks_defaults_manager (queue_locks_defaults_manager_unique_ptr_t manager)
 Set manager for queue locks defaults. More...
 
const environment_infrastructure_factory_tinfrastructure_factory () const
 Get the current environment infrastructure factory. More...
 
environment_params_tinfrastructure_factory (environment_infrastructure_factory_t factory)
 Set new environment infrastructure factory. More...
 
void event_queue_hook (event_queue_hook_unique_ptr_t hook)
 Set event_queue_hook object. More...
 
Exception reaction flag management methods.
exception_reaction_t exception_reaction () const
 Get exception reaction flag value. More...
 
environment_params_texception_reaction (exception_reaction_t value)
 Set exception reaction flag value. More...
 
Methods for internal use only.
const layer_map_tso5__layers_map () const
 Get map of default SObjectizer's layers. More...
 
coop_listener_unique_ptr_t so5__giveout_coop_listener ()
 Get cooperation listener. More...
 
event_exception_logger_unique_ptr_t so5__giveout_event_exception_logger ()
 Get exception logger. More...
 
so_5::timer_thread_factory_t so5__giveout_timer_thread_factory ()
 Get the timer_thread factory. More...
 
const error_logger_shptr_tso5__error_logger () const
 Get error logger for the environment. More...
 
so_5::msg_tracing::tracer_unique_ptr_t so5__giveout_message_delivery_tracer ()
 Get message delivery tracer for the environment. More...
 
so_5::msg_tracing::filter_shptr_t so5__giveout_message_delivery_tracer_filter ()
 Get message delivery tracer filter for the environment. More...
 
queue_locks_defaults_manager_unique_ptr_t so5__giveout_queue_locks_defaults_manager ()
 Take out queue locks defaults manager. More...
 
event_queue_hook_unique_ptr_t so5__giveout_event_queue_hook ()
 Take out event_queue_hook object. More...
 

Private Member Functions

void add_layer (const std::type_index &type, layer_unique_ptr_t layer_ptr)
 Add an additional layer. More...
 

Private Attributes

so_5::timer_thread_factory_t m_timer_thread_factory
 Timer thread factory. More...
 
layer_map_t m_so_layers
 Additional layers. More...
 
coop_listener_unique_ptr_t m_coop_listener
 Cooperation listener. More...
 
event_exception_logger_unique_ptr_t m_event_exception_logger
 Exception logger. More...
 
exception_reaction_t m_exception_reaction
 Exception reaction flag for the whole SO Environment. More...
 
bool m_autoshutdown_disabled
 Is autoshutdown when there is no more cooperation disabled? More...
 
error_logger_shptr_t m_error_logger
 Error logger for the environment. More...
 
so_5::msg_tracing::tracer_unique_ptr_t m_message_delivery_tracer
 Tracer for message delivery. More...
 
so_5::msg_tracing::filter_shptr_t m_message_delivery_tracer_filter
 Message delivery tracer filter to be used with environment. More...
 
so_5::disp::one_thread::disp_params_t m_default_disp_params
 Parameters for the default dispatcher. More...
 
work_thread_activity_tracking_t m_work_thread_activity_tracking
 Work thread activity tracking for the whole Environment. More...
 
queue_locks_defaults_manager_unique_ptr_t m_queue_locks_defaults_manager
 Manager for defaults of queue locks. More...
 
environment_infrastructure_factory_t m_infrastructure_factory
 A factory for environment infrastructure entity. More...
 
event_queue_hook_unique_ptr_t m_event_queue_hook
 An event_queue_hook object. More...
 

Friends

SO_5_FUNC void swap (environment_params_t &a, environment_params_t &b)
 Swap operation. More...
 

Detailed Description

Parameters for the SObjectizer Environment initialization.

This class is used for setting SObjectizer Parameters.

See also
http://www.parashift.com/c++-faq/named-parameter-idiom.html
Examples:
so_5/chstate_msg_tracing/main.cpp, so_5/coop_listener/main.cpp, so_5/custom_error_logger/main.cpp, so_5/hello_world_simple_not_mtsafe/main.cpp, so_5/many_timers/main.cpp, so_5/nohandler_msg_tracing/main.cpp, so_5/selective_msg_tracing/main.cpp, and so_5/wrapped_env_demo_3/main.cpp.

Constructor & Destructor Documentation

◆ environment_params_t() [1/2]

so_5::environment_params_t::environment_params_t ( )

Constructor.

Sets default values for parameters.

◆ environment_params_t() [2/2]

so_5::environment_params_t::environment_params_t ( environment_params_t &&  other)

Move constructor.

Since
v.5.2.3

◆ ~environment_params_t()

so_5::environment_params_t::~environment_params_t ( )

Member Function Documentation

◆ add_layer() [1/2]

template<class SO_Layer >
environment_params_t& so_5::environment_params_t::add_layer ( std::unique_ptr< SO_Layer >  layer_ptr)
inline

Add an additional layer to the SObjectizer Environment.

If this layer is already added it will be replaced by layer_ptr.

The method distinguishes layers from each other by the type SO_LAYER.

Parameters
layer_ptrA layer to be added.

◆ add_layer() [2/2]

void so_5::environment_params_t::add_layer ( const std::type_index &  type,
layer_unique_ptr_t  layer_ptr 
)
private

Add an additional layer.

If this layer is already added it will be replaced by layer_ptr.

The method distinguishes layers from each other by the type SO_LAYER.

Parameters
typeType identification for layer.
layer_ptrA layer to be added.

◆ autoshutdown_disabled()

SO_5_NODISCARD bool so_5::environment_params_t::autoshutdown_disabled ( ) const
inline

Is autoshutdown disabled?

Since
v.5.4.0
See also
disable_autoshutdown()

◆ coop_listener()

environment_params_t & so_5::environment_params_t::coop_listener ( coop_listener_unique_ptr_t  coop_listener)

Set cooperation listener object.

Examples:
so_5/coop_listener/main.cpp.

◆ default_disp_params() [1/2]

environment_params_t& so_5::environment_params_t::default_disp_params ( so_5::disp::one_thread::disp_params_t  params)
inline

Set parameters for the default dispatcher.

Since
v.5.5.10
Usage example:
so_5::launch( []( so_5::environment_t & env ) { ... },
[]( so_5::environment_params_t & env_params ) {
using namespace so_5::disp::one_thread;
// Event queue for the default dispatcher must use mutex as lock.
env_params.default_disp_params( disp_params_t{}.tune_queue_params(
[]( queue_traits::queue_params_t & queue_params ) {
} ) );
} );

◆ default_disp_params() [2/2]

const so_5::disp::one_thread::disp_params_t& so_5::environment_params_t::default_disp_params ( ) const
inline

Get the parameters for the default dispatcher.

Since
v.5.5.10

◆ disable_autoshutdown()

environment_params_t& so_5::environment_params_t::disable_autoshutdown ( )
inline

Do not shutdown SO Environment when it is becomes empty.

Since
v.5.4.0
Description
Since v.5.4.0 SO Environment checks count of live cooperations after every cooperation deregistration. If there is no more live cooperations then SO Environment will be shutted down. If it is not appropriate then this method must be called. It disables autoshutdown of SO Environment. Event if there is no more live cooperations SO Environment will work until explisit call to environment_t::stop() method.

◆ error_logger()

environment_params_t& so_5::environment_params_t::error_logger ( error_logger_shptr_t  logger)
inline

Set error logger for the environment.

Since
v.5.5.0

◆ event_exception_logger()

environment_params_t & so_5::environment_params_t::event_exception_logger ( event_exception_logger_unique_ptr_t  logger)

Set exception logger object.

◆ event_queue_hook()

void so_5::environment_params_t::event_queue_hook ( event_queue_hook_unique_ptr_t  hook)
inline

Set event_queue_hook object.

Since v.5.5.24 it is possible to use special event_queue_hook object. If it is used it should be set for SObjectizer Environment before the Environment will be started. This method allows to specify event_queue_hook object for a new Environment object.

Usage example:

[](so_5::environment_t & env) {...}, // Some stating actions.
// Set my own event_queue hook object.
so_5::make_event_queue_hook<my_hook>(
// Object is created dynamically and should be
// destroyed the normal way.
arg1, arg3, arg3 // and all other arguments for my_hook's constructor.
);
});
Note
The previous event_queue_hook object (if it was set earlier) will just be dropped.
Since
v.5.5.24

◆ exception_reaction() [1/2]

exception_reaction_t so_5::environment_params_t::exception_reaction ( ) const
inline

Get exception reaction flag value.

Since
v.5.3.0

◆ exception_reaction() [2/2]

environment_params_t& so_5::environment_params_t::exception_reaction ( exception_reaction_t  value)
inline

Set exception reaction flag value.

Since
v.5.3.0

◆ infrastructure_factory() [1/2]

const environment_infrastructure_factory_t& so_5::environment_params_t::infrastructure_factory ( ) const
inline

Get the current environment infrastructure factory.

Since
v.5.5.19
Examples:
so_5/wrapped_env_demo_3/main.cpp.

◆ infrastructure_factory() [2/2]

environment_params_t& so_5::environment_params_t::infrastructure_factory ( environment_infrastructure_factory_t  factory)
inline

Set new environment infrastructure factory.

Since
v.5.5.19

◆ message_delivery_tracer()

environment_params_t& so_5::environment_params_t::message_delivery_tracer ( so_5::msg_tracing::tracer_unique_ptr_t  tracer)
inline

Set message delivery tracer for the environment.

Usage example:

so_5::launch( [](so_5::environment_t & env) { ... },
params.message_delivery_tracer( so_5::msg_tracing::std_cout_tracer() );
...
} );
Since
v.5.5.9

◆ message_delivery_tracer_filter()

environment_params_t& so_5::environment_params_t::message_delivery_tracer_filter ( so_5::msg_tracing::filter_shptr_t  filter)
inline

Set message tracer filter for the environment.

Since
v.5.5.22

◆ operator=()

environment_params_t & so_5::environment_params_t::operator= ( environment_params_t &&  other)

Move operator.

Since
v.5.2.3

◆ queue_locks_defaults_manager()

environment_params_t& so_5::environment_params_t::queue_locks_defaults_manager ( queue_locks_defaults_manager_unique_ptr_t  manager)
inline

Set manager for queue locks defaults.

Since
v.5.5.18

◆ so5__error_logger()

const error_logger_shptr_t& so_5::environment_params_t::so5__error_logger ( ) const
inline

Get error logger for the environment.

◆ so5__giveout_coop_listener()

coop_listener_unique_ptr_t so_5::environment_params_t::so5__giveout_coop_listener ( )
inline

Get cooperation listener.

◆ so5__giveout_event_exception_logger()

event_exception_logger_unique_ptr_t so_5::environment_params_t::so5__giveout_event_exception_logger ( )
inline

Get exception logger.

◆ so5__giveout_event_queue_hook()

event_queue_hook_unique_ptr_t so_5::environment_params_t::so5__giveout_event_queue_hook ( )
inline

Take out event_queue_hook object.

Since
v.5.5.24

◆ so5__giveout_message_delivery_tracer()

so_5::msg_tracing::tracer_unique_ptr_t so_5::environment_params_t::so5__giveout_message_delivery_tracer ( )
inline

Get message delivery tracer for the environment.

Since
v.5.5.9

◆ so5__giveout_message_delivery_tracer_filter()

so_5::msg_tracing::filter_shptr_t so_5::environment_params_t::so5__giveout_message_delivery_tracer_filter ( )
inline

Get message delivery tracer filter for the environment.

Since
v.5.5.22

◆ so5__giveout_queue_locks_defaults_manager()

queue_locks_defaults_manager_unique_ptr_t so_5::environment_params_t::so5__giveout_queue_locks_defaults_manager ( )
inline

Take out queue locks defaults manager.

Since
v.5.5.18

◆ so5__giveout_timer_thread_factory()

so_5::timer_thread_factory_t so_5::environment_params_t::so5__giveout_timer_thread_factory ( )
inline

Get the timer_thread factory.

◆ so5__layers_map()

const layer_map_t& so_5::environment_params_t::so5__layers_map ( ) const
inline

Get map of default SObjectizer's layers.

◆ timer_thread()

environment_params_t & so_5::environment_params_t::timer_thread ( so_5::timer_thread_factory_t  factory)

Set the timer_thread factory.

If factory is a null then the default timer thread will be used.

Parameters
factorytimer_thread factory to be used.

◆ turn_work_thread_activity_tracking_off()

environment_params_t& so_5::environment_params_t::turn_work_thread_activity_tracking_off ( )
inline

Helper for turning work thread activity tracking off.

Since
v.5.5.18

◆ turn_work_thread_activity_tracking_on()

environment_params_t& so_5::environment_params_t::turn_work_thread_activity_tracking_on ( )
inline

Helper for turning work thread activity tracking on.

Since
v.5.5.18

◆ work_thread_activity_tracking() [1/2]

environment_params_t& so_5::environment_params_t::work_thread_activity_tracking ( work_thread_activity_tracking_t  flag)
inline

Set activity tracking flag for the whole SObjectizer Environment.

Since
v.5.5.18

◆ work_thread_activity_tracking() [2/2]

work_thread_activity_tracking_t so_5::environment_params_t::work_thread_activity_tracking ( ) const
inline

Get activity tracking flag for the whole SObjectizer Environment.

Since
v.5.5.18

Friends And Related Function Documentation

◆ swap

SO_5_FUNC void swap ( environment_params_t a,
environment_params_t b 
)
friend

Swap operation.

Since
v.5.2.3

Member Data Documentation

◆ m_autoshutdown_disabled

bool so_5::environment_params_t::m_autoshutdown_disabled
private

Is autoshutdown when there is no more cooperation disabled?

See also
disable_autoshutdown()
Since
v.5.4.0

◆ m_coop_listener

coop_listener_unique_ptr_t so_5::environment_params_t::m_coop_listener
private

Cooperation listener.

◆ m_default_disp_params

so_5::disp::one_thread::disp_params_t so_5::environment_params_t::m_default_disp_params
private

Parameters for the default dispatcher.

Since
v.5.5.10

◆ m_error_logger

error_logger_shptr_t so_5::environment_params_t::m_error_logger
private

Error logger for the environment.

Since
v.5.5.0

◆ m_event_exception_logger

event_exception_logger_unique_ptr_t so_5::environment_params_t::m_event_exception_logger
private

Exception logger.

◆ m_event_queue_hook

event_queue_hook_unique_ptr_t so_5::environment_params_t::m_event_queue_hook
private

An event_queue_hook object.

Note
It can be a nullptr. It means that no event_queue_hook should be used.
Since
v.5.5.24

◆ m_exception_reaction

exception_reaction_t so_5::environment_params_t::m_exception_reaction
private

Exception reaction flag for the whole SO Environment.

Since
v.5.3.0

◆ m_infrastructure_factory

environment_infrastructure_factory_t so_5::environment_params_t::m_infrastructure_factory
private

A factory for environment infrastructure entity.

Since
v.5.5.19

◆ m_message_delivery_tracer

so_5::msg_tracing::tracer_unique_ptr_t so_5::environment_params_t::m_message_delivery_tracer
private

Tracer for message delivery.

Since
v.5.5.9

◆ m_message_delivery_tracer_filter

so_5::msg_tracing::filter_shptr_t so_5::environment_params_t::m_message_delivery_tracer_filter
private

Message delivery tracer filter to be used with environment.

Since
v.5.5.22

◆ m_queue_locks_defaults_manager

queue_locks_defaults_manager_unique_ptr_t so_5::environment_params_t::m_queue_locks_defaults_manager
private

Manager for defaults of queue locks.

Since
v.5.5.18

◆ m_so_layers

layer_map_t so_5::environment_params_t::m_so_layers
private

Additional layers.

◆ m_timer_thread_factory

so_5::timer_thread_factory_t so_5::environment_params_t::m_timer_thread_factory
private

Timer thread factory.

◆ m_work_thread_activity_tracking

work_thread_activity_tracking_t so_5::environment_params_t::m_work_thread_activity_tracking
private

Work thread activity tracking for the whole Environment.

Since
v.5.5.18

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