SObjectizer
5.5
|
Public part of message limit implementation. More...
Namespaces | |
anonymous_namespace{agent.cpp} | |
anonymous_namespace{environment.cpp} | |
anonymous_namespace{event_exception_logger.cpp} | |
anonymous_namespace{queue_locks_defaults_manager.cpp} | |
anonymous_namespace{wrapped_env.cpp} | |
api | |
Public API functions of SObjectizer-5. | |
custom_mbox_details | |
delivery_filter_templates | |
Template-based implementations of delivery filters. | |
dereg_reason | |
Enumeration of cooperation deregistration reasons. | |
details | |
Some reusable and low-level classes/functions which can be used in public header files. | |
disp | |
Event dispatchers. | |
env_infrastructures | |
Various implementations of environment_infrastructure. | |
enveloped_msg | |
experimental | |
impl | |
Details of SObjectizer run-time implementations. | |
internal_timer_helpers | |
log_msg_details | |
Implementation details of error_logging facility. | |
low_level_api | |
mchain_auto_close_details | |
mchain_props | |
Various properties and parameters of message chains. | |
msg_tracing | |
Public part of message delivery tracing mechanism. | |
prio | |
Helpers for working with priorities. | |
rt | |
All code related to implementation of SObjectizer run-time. | |
send_functions_details | |
Implementation details for send-family and request_future/value helper functions. | |
stats | |
All stuff related to run-time monitoring and statistics. | |
thread_auto_join_details | |
timer_thread | |
Old timer thread related stuff. | |
timers_details | |
Timers implementation details. | |
Classes | |
class | abstract_message_box_t |
Mail box class. More... | |
class | abstract_message_chain_t |
An interace of message chain. More... | |
class | agent_context_t |
A context for agent construction and tuning. More... | |
class | agent_state_listener_t |
Interface of the agent state listener. More... | |
class | agent_t |
A base class for agents. More... | |
class | agent_tuning_options_t |
A collector for agent tuning options. More... | |
class | atomic_refcounted_t |
The base class for the object with a reference counting. More... | |
class | coop_dereg_notificators_container_t |
Container for cooperation deregistration notificators. More... | |
class | coop_dereg_reason_t |
class | coop_handle_t |
Type of smart handle for a cooperation. More... | |
class | coop_listener_t |
Interface for the cooperation listener. More... | |
class | coop_reg_notificators_container_t |
Container for cooperation registration notificators. More... | |
class | coop_t |
Agent cooperation. More... | |
class | coop_unique_holder_t |
A special type that plays role of unique_ptr for coop. More... | |
class | delivery_filter_t |
An interface of delivery filter object. More... | |
class | disp_binder_t |
Interface for dispatcher binders. More... | |
class | environment_infrastructure_t |
An interface for environment_infrastructure entity. More... | |
class | environment_params_t |
Parameters for the SObjectizer Environment initialization. More... | |
class | environment_t |
SObjectizer Environment. More... | |
class | error_logger_t |
An interface for logging error messages. More... | |
class | event_exception_logger_t |
An interface for the exception logging. More... | |
class | event_queue_hook_t |
Interface of event_queue_hook object. More... | |
class | event_queue_t |
An interface of event queue for agent. More... | |
class | exception_t |
The base class for all SObjectizer exceptions. More... | |
struct | execution_demand_t |
A description of event execution demand. More... | |
class | execution_hint_t |
A hint for a dispatcher for execution of event for the concrete execution_demand. More... | |
class | extensible_select_t |
Special container for holding select parameters and select cases. More... | |
struct | immutable_msg |
A special marker for immutable message. More... | |
struct | initial_substate_of |
Helper for marking initial substate of composite state. More... | |
class | intrusive_ptr_t |
Template class for smart reference wrapper on the atomic_refcounted_t. More... | |
struct | is_classical_message |
A helper class for checking that message is a classical message derived from message_t class. More... | |
struct | is_mutable_message |
A helper class for checking that message is a mutable message. More... | |
struct | is_mutable_message< mutable_msg< T > > |
struct | is_signal |
A helper class for checking that message is a signal. More... | |
struct | is_user_type_message |
A helper for detection presence of message of user type. More... | |
struct | is_user_type_message< user_type_message_t< M > > |
class | layer_t |
An interface of the additional SObjectizer Environment layer. More... | |
struct | mbox_creation_data_t |
An information which is necessary for creation of a new mbox. More... | |
class | mchain_bulk_processing_params_t |
Basic parameters for advanced receive from mchain and for multi chain select. More... | |
class | mchain_master_handle_t |
Helper class for automatic close of a mchain at the destruction of master handle instance. More... | |
class | mchain_params_t |
Parameters for message chain. More... | |
class | mchain_receive_params_t |
Parameters for advanced receive from mchain. More... | |
class | mchain_receive_result_t |
A result of receive from mchain. More... | |
class | mchain_select_params_t |
Parameters for advanced select from multiple mchains. More... | |
class | message_holder_t |
A class for holding an instance of a message. More... | |
struct | message_payload_type |
A helper class for detection of payload type of message. More... | |
struct | message_payload_type< user_type_message_t< T > > |
struct | message_payload_type_impl |
Implementation details for message_payload_type. More... | |
struct | message_payload_type_impl< T, false > |
Implementation details for message_payload_type. More... | |
class | message_t |
A base class for agent messages. More... | |
class | mhood_t |
A message wrapped to be used as type of argument for event handlers. More... | |
struct | msg_coop_deregistered |
Message about cooperation deregistration completion. More... | |
struct | msg_coop_registered |
Message about cooperation registration completion. More... | |
struct | mutable_msg |
A special marker for mutable message. More... | |
class | nonempty_name_t |
A class for the name which cannot be empty. More... | |
class | null_mutex_t |
A class which is like std::mutex but does not do any real actions. More... | |
class | outliving_reference_t |
Helper class for indication of long-lived reference via its type. More... | |
class | pause_backoff_t |
An implementation of backoff object using assembly instruction. More... | |
class | prepared_receive_t |
Special container for holding receive parameters and receive cases. More... | |
class | prepared_select_t |
Special container for holding select parameters and select cases. More... | |
class | queue_locks_defaults_manager_t |
A base class for manager of default locks for event queues. More... | |
class | read_lock_guard_t |
Scoped guard for shared locks. More... | |
class | rw_spinlock_t |
A simple multi-readers/single-writer spinlock (analog of std::shared_mutex). More... | |
class | signal_t |
A base class for agent signals. More... | |
class | spinlock_t |
A simple spinlock (analog of std::mutex). More... | |
class | state_t |
Class for the representing agent state. More... | |
class | stderr_logger_t |
A standard implementation of error_logger interface. More... | |
class | stop_guard_t |
An interface of stop_guard entity. More... | |
class | subscription_bind_t |
A class for creating a subscription to messages from the mbox. More... | |
struct | substate_of |
Helper for marking a substate of composite state. More... | |
class | timer_id_t |
An indentificator for the timer. More... | |
class | timer_manager_t |
Timer manager interface. More... | |
class | timer_t |
A base class for timer identificator. More... | |
struct | timer_thread_stats_t |
Statistics for run-time monitoring. More... | |
class | timer_thread_t |
Timer thread interface. More... | |
struct | user_type_message_t |
Template class for representing object of user type as a message. More... | |
class | wrapped_env_t |
A wrapped environment. More... | |
class | yield_backoff_t |
An implementation of backoff object with usage of std::yield. More... | |
Typedefs | |
using | agent_ref_t = intrusive_ptr_t< agent_t > |
A smart reference to an agent. More... | |
using | agent_state_listener_unique_ptr_t = std::unique_ptr< agent_state_listener_t > |
Typedef for the agent_state_listener autopointer. More... | |
using | generic_simple_init_t = std::function< void(so_5::environment_t &) > |
Generic type for a simple SObjectizer-initialization function. More... | |
using | generic_simple_so_env_params_tuner_t = std::function< void(so_5::environment_params_t &) > |
Generic type for a simple SO Environment paramenters tuning function. More... | |
using | coop_reg_notificator_t = std::function< void(environment_t &, const coop_handle_t &) > |
Type of cooperation registration notificator. More... | |
using | coop_reg_notificators_container_ref_t = intrusive_ptr_t< coop_reg_notificators_container_t > |
Typedef for smart pointer to notificators_container. More... | |
using | coop_dereg_notificator_t = std::function< void(environment_t &, const coop_handle_t &, const coop_dereg_reason_t &) > |
Type of cooperation deregistration notificator. More... | |
using | coop_dereg_notificators_container_ref_t = intrusive_ptr_t< coop_dereg_notificators_container_t > |
Typedef for smart pointer to notificators_container. More... | |
using | coop_shptr_t = std::shared_ptr< coop_t > |
Typedef for the agent_coop smart pointer. More... | |
using | coop_listener_unique_ptr_t = std::unique_ptr< coop_listener_t > |
Typedef for the coop_listener autopointer. More... | |
using | current_thread_id_t = std::thread::id |
Type of the current thread id. More... | |
using | disp_binder_shptr_t = std::shared_ptr< disp_binder_t > |
Typedef for the disp_binder smart pointer. More... | |
using | environment_infrastructure_deleter_fnptr_t = void(*)(environment_infrastructure_t *) |
A type for deleter for environment_infrastructure objects. More... | |
using | environment_infrastructure_unique_ptr_t = std::unique_ptr< environment_infrastructure_t, environment_infrastructure_deleter_fnptr_t > |
A type of unique pointer for environment_infrastructure entity. More... | |
using | environment_infrastructure_factory_t = std::function< environment_infrastructure_unique_ptr_t(environment_t &, environment_params_t &, mbox_t) > |
Type of factory for environment infrastructure. More... | |
using | error_logger_shptr_t = std::shared_ptr< error_logger_t > |
An alias for shared_ptr to error_logger. More... | |
using | event_exception_logger_unique_ptr_t = std::unique_ptr< event_exception_logger_t > |
Typedef for the event_exception_logger autopointer. More... | |
using | event_queue_hook_deleter_fnptr_t = void(*)(event_queue_hook_t *) |
A type for deleter of event_queue_hook object. More... | |
using | event_queue_hook_unique_ptr_t = std::unique_ptr< event_queue_hook_t, event_queue_hook_deleter_fnptr_t > |
Alias for unique pointer to event_queue_hook. More... | |
using | event_handler_method_t = std::function< void(message_ref_t &) > |
Type of event handler method. More... | |
using | demand_handler_pfn_t = void(*)(current_thread_id_t, execution_demand_t &) |
Demand handler prototype. More... | |
using | delivery_filter_unique_ptr_t = std::unique_ptr< delivery_filter_t > |
An alias of unique_ptr for delivery_filter. More... | |
using | mbox_t = intrusive_ptr_t< abstract_message_box_t > |
Smart reference for the abstract_message_box. More... | |
using | mchain_t = intrusive_ptr_t< abstract_message_chain_t > |
Short name for smart pointer to message chain. More... | |
using | message_ref_t = intrusive_ptr_t< message_t > |
A smart reference to the message. More... | |
template<typename M > | |
using | mutable_mhood_t = mhood_t< mutable_msg< M > > |
A short name for message hood for mutable message. More... | |
using | queue_locks_defaults_manager_unique_ptr_t = std::unique_ptr< queue_locks_defaults_manager_t > |
An alias of unique_ptr for queue_locks_defaults_manager. More... | |
using | layer_unique_ptr_t = std::unique_ptr< layer_t > |
Typedef for the layer's autopointer. More... | |
using | layer_ref_t = std::shared_ptr< layer_t > |
Typedef for the layer's smart pointer. More... | |
using | layer_map_t = std::map< std::type_index, layer_ref_t > |
Typedef for the map from a layer typeid to the layer. More... | |
using | default_spinlock_t = spinlock_t< pause_backoff_t > |
using | default_rw_spinlock_t = rw_spinlock_t< pause_backoff_t > |
using | stop_guard_shptr_t = std::shared_ptr< stop_guard_t > |
An alias of shared_ptr for stop_guard. More... | |
using | subscription_storage_factory_t = std::function< impl::subscription_storage_unique_ptr_t(agent_t *) > |
Type of subscription_storage factory. More... | |
using | timer_thread_unique_ptr_t = std::unique_ptr< timer_thread_t > |
Auxiliary typedef for timer_thread autopointer. More... | |
using | timer_thread_factory_t = std::function< timer_thread_unique_ptr_t(error_logger_shptr_t) > |
Type of factory for creating timer_thread objects. More... | |
using | timer_manager_unique_ptr_t = std::unique_ptr< timer_manager_t > |
Auxiliary typedef for timer_manager autopointer. More... | |
using | timer_manager_factory_t = std::function< timer_manager_unique_ptr_t(error_logger_shptr_t, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t >) > |
Type of factory for creating timer_manager objects. More... | |
using | atomic_counter_t = std::atomic_ulong |
Atomic counter type. More... | |
using | atomic_flag_t = std::atomic_ulong |
Atomic flag type. More... | |
using | mbox_id_t = unsigned long long |
A type for mbox indentifier. More... | |
using | coop_id_t = std::uint_fast64_t |
ID of cooperation. More... | |
Functions | |
SO_5_FUNC void | swap (environment_params_t &a, environment_params_t &b) |
SO_5_FUNC error_logger_shptr_t | create_stderr_logger () |
A factory for creating error_logger implemenation which uses std::stderr as log stream. More... | |
SO_5_FUNC event_exception_logger_unique_ptr_t | create_std_event_exception_logger () |
Create the default exception logger. More... | |
SO_5_FUNC subscription_storage_factory_t | adaptive_subscription_storage_factory ( std::size_t threshold) |
Factory for adaptive subscription storage. More... | |
SO_5_FUNC subscription_storage_factory_t | adaptive_subscription_storage_factory ( std::size_t threshold, const subscription_storage_factory_t &small_storage_factory, const subscription_storage_factory_t &large_storage_factory) |
Factory for adaptive subscription storage. More... | |
SO_5_FUNC subscription_storage_factory_t | default_subscription_storage_factory () |
Factory for default subscription storage object. More... | |
SO_5_FUNC subscription_storage_factory_t | hash_table_based_subscription_storage_factory () |
Factory for default subscription storage based on std::unordered_map. More... | |
SO_5_FUNC subscription_storage_factory_t | map_based_subscription_storage_factory () |
Factory for subscription storage based on std::map. More... | |
SO_5_FUNC subscription_storage_factory_t | vector_based_subscription_storage_factory ( std::size_t initial_capacity) |
Factory for subscription storage based on std::vector. More... | |
SO_5_FUNC queue_locks_defaults_manager_unique_ptr_t | make_defaults_manager_for_simple_locks () |
A factory for queue_locks_defaults_manager with generators for simple locks. More... | |
SO_5_FUNC queue_locks_defaults_manager_unique_ptr_t | make_defaults_manager_for_combined_locks () |
A factory for queue_locks_defaults_manager with generators for combined locks. More... | |
void | operator>>= (agent_t *agent, const state_t &new_state) |
A shortcat for switching the agent state. More... | |
template<typename Option > | |
agent_context_t | operator+ (environment_t &env, Option arg) |
A plus operator for creating agent_context object from a reference to Environment and single agent tuning option. More... | |
auto | make_coop_reg_notificator (mbox_t target) noexcept |
Create notificator about cooperation registration completion. More... | |
auto | make_coop_dereg_notificator (mbox_t target) noexcept |
Create notificator about cooperation deregistration completion. More... | |
template<typename Init_Routine > | |
void | launch (Init_Routine &&init_routine) |
Launch a SObjectizer Environment with default parameters. More... | |
template<typename Init_Routine , typename Params_Tuner > | |
void | launch (Init_Routine &&init_routine, Params_Tuner &¶ms_tuner) |
Launch a SObjectizer Environment with explicitely specified parameters. More... | |
template<typename T > | |
intrusive_ptr_t (std::unique_ptr< T >) -> intrusive_ptr_t< T > | |
current_thread_id_t | query_current_thread_id () |
Get the ID of the current thread. More... | |
current_thread_id_t | null_current_thread_id () |
Get NULL thread id. More... | |
std::thread::id | raw_id_from_current_thread_id (const current_thread_id_t &w) |
Get the raw thread id from current_thread_id. More... | |
template<typename... Args> | |
SO_5_NODISCARD coop_unique_holder_t | create_child_coop (agent_t &owner, Args &&... args) |
A simple way for creating child cooperation. More... | |
template<typename... Args> | |
SO_5_NODISCARD coop_unique_holder_t | create_child_coop (coop_handle_t parent, Args &&... args) |
A simple way for creating child cooperation when there is a reference to the parent cooperation object. More... | |
template<typename... Args> | |
decltype(auto) | introduce_child_coop (agent_t &owner, Args &&... args) |
A simple way for creating and registering child cooperation. More... | |
template<typename... Args> | |
decltype(auto) | introduce_child_coop (coop_handle_t parent, Args &&... args) |
A simple way for creating and registering child cooperation when there is a reference to parent coop. More... | |
disp_binder_shptr_t | make_default_disp_binder (environment_t &env) |
Create an instance of the default dispatcher binder. More... | |
template<typename Hook_Type , typename... Args> | |
event_queue_hook_unique_ptr_t | make_event_queue_hook (event_queue_hook_deleter_fnptr_t deleter, Args &&...args) |
Helper function for simplify creation of event_queue_hook object. More... | |
SO_5_NODISCARD event_queue_hook_unique_ptr_t | make_empty_event_queue_hook_unique_ptr () |
Helper function for creation of empty unique_ptr for event_queue_hook. More... | |
template<typename Method_Pointer > | |
std::enable_if< details::is_agent_method_pointer< details::method_arity::unary, Method_Pointer >::value, details::msg_type_and_handler_pair_t >::type | preprocess_agent_event_handler (const mbox_t &mbox, agent_t &agent, Method_Pointer pfn) |
Do preprocessing and some verification of event handler and return msg_type_and_handler_pair for it. More... | |
template<typename Lambda > | |
std::enable_if< details::lambda_traits::is_lambda< Lambda >::value, details::msg_type_and_handler_pair_t >::type | preprocess_agent_event_handler (const mbox_t &mbox, agent_t &, Lambda &&lambda) |
Do preprocessing and some verification of event handler and return msg_type_and_handler_pair for it. More... | |
void | close_drop_content (const mchain_t &ch) |
Helper function for closing a message chain with dropping all its content. More... | |
void | close_retain_content (const mchain_t &ch) |
Helper function for closing a message chain with retaining all its content. More... | |
mchain_receive_params_t< mchain_props::msg_count_status_t::undefined > | from (mchain_t chain) |
A helper function for simplification of creation of mchain_receive_params instance. More... | |
template<mchain_props::msg_count_status_t Msg_Count_Status, typename... Handlers> | |
mchain_receive_result_t | receive (const mchain_receive_params_t< Msg_Count_Status > ¶ms, Handlers &&... handlers) |
Advanced version of receive from mchain. More... | |
template<mchain_props::msg_count_status_t Msg_Count_Status, typename... Handlers> | |
prepared_receive_t< sizeof...(Handlers) > | prepare_receive (const mchain_receive_params_t< Msg_Count_Status > ¶ms, Handlers &&... handlers) |
Create parameters for receive function to be used later. More... | |
template<std::size_t Handlers_Count> | |
mchain_receive_result_t | receive (const prepared_receive_t< Handlers_Count > &prepared) |
A receive operation to be done on previously prepared receive params. More... | |
mchain_t | create_mchain (environment_t &env, mchain_props::duration_t waiting_time, std::size_t max_size, mchain_props::memory_usage_t memory_usage, mchain_props::overflow_reaction_t overflow_reaction) |
Create size-limited chain with waiting on overflow. More... | |
mchain_t | create_mchain (wrapped_env_t &sobj, mchain_props::duration_t waiting_time, std::size_t max_size, mchain_props::memory_usage_t memory_usage, mchain_props::overflow_reaction_t overflow_reaction) |
Create size-limited chain without waiting on overflow. More... | |
template<typename... Tail> | |
mchain_auto_close_details::auto_closer_t< sizeof...(Tail) > | auto_close_mchains (mchain_props::close_mode_t close_mode, Tail &&... tail) |
Helper function for creation of automatic closer of mchains. More... | |
template<typename... Tail> | |
mchain_auto_close_details::auto_closer_t< sizeof...(Tail) > | auto_close_retain_content (Tail &&... tail) |
Helper function for automatic closing of mchains with retaining their content. More... | |
template<typename... Tail> | |
mchain_auto_close_details::auto_closer_t< sizeof...(Tail) > | auto_close_drop_content (Tail &&... tail) |
Helper function for automatic closing of mchains with dropping their content. More... | |
mchain_select_params_t< mchain_props::msg_count_status_t::undefined > | from_all () |
Helper function for creation of mchain_select_params instance with default values. More... | |
template<typename... Handlers> | |
mchain_props::select_case_unique_ptr_t | case_ (mchain_t chain, Handlers &&... handlers) |
A helper for creation of select_case object for one multi chain select. More... | |
template<mchain_props::msg_count_status_t Msg_Count_Status, typename... Cases> | |
mchain_receive_result_t | select (const mchain_select_params_t< Msg_Count_Status > ¶ms, Cases &&... cases) |
An advanced form of multi chain select. More... | |
template<mchain_props::msg_count_status_t Msg_Count_Status, typename... Cases> | |
prepared_select_t< sizeof...(Cases) > | prepare_select (mchain_select_params_t< Msg_Count_Status > params, Cases &&... cases) |
Create prepared select statement to be used later. More... | |
template<std::size_t Cases_Count> | |
mchain_receive_result_t | select (const prepared_select_t< Cases_Count > &prepared) |
A select operation to be done on previously prepared select params. More... | |
template<mchain_props::msg_count_status_t Msg_Count_Status, typename... Cases> | |
extensible_select_t | make_extensible_select (mchain_select_params_t< Msg_Count_Status > params, Cases &&... cases) |
Creation of extensible-select instance. More... | |
template<typename... Cases> | |
void | add_select_cases (extensible_select_t &extensible_select, Cases &&... cases) |
Add a portion of cases to extensible-select instance. More... | |
mchain_receive_result_t | select (const extensible_select_t &extensible_select) |
A select operation to be done on previously prepared extensible-select object. More... | |
template<class Msg > | |
void | ensure_not_signal () |
A special compile-time checker to guarantee that the message class is not a signal class. More... | |
template<class Msg > | |
void | ensure_message_with_actual_data (const Msg *m) |
A special checker to guarantee that the message is an instance of the message_t (not signal_t) and has a not-null pointer to the message data. More... | |
template<class S > | |
void | ensure_not_mutable_signal () |
A special compile-time checker to guarantee that S is not a mutable signal. More... | |
template<class Msg > | |
void | ensure_signal () |
A special compile-time checker to guarantee that the Msg is derived from the signal_t. More... | |
template<typename Msg > | |
void | ensure_classical_message () |
A special compile-time checker to guarantee that Msg is derived from message_t. More... | |
template<typename M > | |
std::enable_if< !is_signal< M >::value, mhood_t< immutable_msg< M > > >::type | to_immutable (mhood_t< mutable_msg< M > > msg) |
Transform mutable message instance into immutable. More... | |
template<typename M > | |
std::enable_if< is_signal< M >::value, mhood_t< immutable_msg< M > > >::type | to_immutable (mhood_t< mutable_msg< M > >) |
template<typename T > | |
outliving_reference_t< T > | outliving_mutable (T &r) |
Make outliving_reference wrapper for mutable reference. More... | |
template<typename T > | |
outliving_reference_t< const T > | outliving_const (T const &r) |
Make outliving_reference wrapper for const reference. More... | |
template<typename T > | |
outliving_reference_t< const T > | outliving_const (outliving_reference_t< T > r) |
Make outliving_reference wrapper for const reference. More... | |
std::size_t | to_size_t (priority_t priority) |
Helper function for conversion from priority to size_t. More... | |
priority_t | to_priority_t (std::size_t v) |
Helper function for conversion from size_t to priority. More... | |
template<typename Message , typename Target , typename... Args> | |
void | send (Target &&to, Args &&... args) |
A utility function for creating and delivering a message or a signal. More... | |
template<typename Target , typename Message > | |
std::enable_if< !is_signal< Message >::value >::type | send (Target &&to, mhood_t< Message > what) |
A version of send function for redirection of a message from exising message hood. More... | |
template<typename Target , typename Message > | |
std::enable_if< is_signal< Message >::value >::type | send (Target &&to, mhood_t< Message >) |
A version of send function for redirection of a signal from exising message hood. More... | |
template<typename Target , typename Message , message_ownership_t Ownership> | |
void | send (Target &&to, message_holder_t< Message, Ownership > what) |
A version of send function for redirection of a message from exising message_holder instance. More... | |
template<typename Message , typename Target , typename... Args> | |
void | send_delayed (Target &&target, std::chrono::steady_clock::duration pause, Args &&... args) |
A utility function for creating and delivering a delayed message to the specified destination. More... | |
template<typename Target , typename Message > | |
std::enable_if< !message_payload_type< Message >::is_signal >::type | send_delayed (Target &&to, std::chrono::steady_clock::duration pause, mhood_t< Message > msg) |
A utility function for delayed redirection of a message from existing message hood. More... | |
template<typename Target , typename Message > | |
std::enable_if< message_payload_type< Message >::is_signal >::type | send_delayed (Target &&to, std::chrono::steady_clock::duration pause, mhood_t< Message >) |
A utility function for delayed redirection of a signal from existing message hood. More... | |
template<typename Target , typename Message , message_ownership_t Ownership> | |
void | send_delayed (Target &&to, std::chrono::steady_clock::duration pause, message_holder_t< Message, Ownership > msg) |
A version of send_delayed function for redirection of a message from exising message_holder instance. More... | |
template<typename Message , typename Target , typename... Args> | |
SO_5_NODISCARD timer_id_t | send_periodic (Target &&target, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period, Args &&... args) |
A utility function for creating and delivering a periodic message to the specified destination. More... | |
template<typename Target , typename Message > | |
SO_5_NODISCARD std::enable_if< !is_signal< Message >::value, timer_id_t >::type | send_periodic (Target &&target, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period, mhood_t< Message > mhood) |
A utility function for delivering a periodic from an existing message hood. More... | |
template<typename Target , typename Message > | |
SO_5_NODISCARD std::enable_if< is_signal< Message >::value, timer_id_t >::type | send_periodic (Target &&target, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period, mhood_t< Message >) |
A utility function for periodic redirection of a signal from existing message hood. More... | |
template<typename Target , typename Message , message_ownership_t Ownership> | |
SO_5_NODISCARD timer_id_t | send_periodic (Target &&target, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period, message_holder_t< Message, Ownership > what) |
A version of send_periodic function for redirection of a message from exising message_holder instance. More... | |
template<typename... Tail> | |
thread_auto_join_details::auto_joiner_t< 1+sizeof...(Tail) > | auto_join (std::thread &first_thread, Tail &&... tail) |
Helper function for creation of automatic joiner of std::threads. More... | |
mbox_id_t | null_mbox_id () |
Default value for null mbox_id. More... | |
Tools for creating timer threads. | |
SO_5_FUNC timer_thread_unique_ptr_t | create_timer_wheel_thread ( error_logger_shptr_t logger) |
Create timer thread based on timer_wheel mechanism. More... | |
SO_5_FUNC timer_thread_unique_ptr_t | create_timer_wheel_thread ( error_logger_shptr_t logger, unsigned int wheel_size, std::chrono::steady_clock::duration granuality) |
Create timer thread based on timer_wheel mechanism. More... | |
SO_5_FUNC timer_thread_unique_ptr_t | create_timer_heap_thread ( error_logger_shptr_t logger) |
Create timer thread based on timer_heap mechanism. More... | |
SO_5_FUNC timer_thread_unique_ptr_t | create_timer_heap_thread ( error_logger_shptr_t logger, std::size_t initial_heap_capacity) |
Create timer thread based on timer_heap mechanism. More... | |
SO_5_FUNC timer_thread_unique_ptr_t | create_timer_list_thread ( error_logger_shptr_t logger) |
Create timer thread based on timer_list mechanism. More... | |
Tools for creating timer managers. | |
SO_5_FUNC timer_manager_unique_ptr_t | create_timer_wheel_manager ( error_logger_shptr_t logger, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > collector) |
Create timer manager based on timer_wheel mechanism. More... | |
SO_5_FUNC timer_manager_unique_ptr_t | create_timer_wheel_manager ( error_logger_shptr_t logger, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > collector, unsigned int wheel_size, std::chrono::steady_clock::duration granuality) |
Create timer manager based on timer_wheel mechanism. More... | |
SO_5_FUNC timer_manager_unique_ptr_t | create_timer_heap_manager ( error_logger_shptr_t logger, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > collector) |
Create timer manager based on timer_heap mechanism. More... | |
SO_5_FUNC timer_manager_unique_ptr_t | create_timer_heap_manager ( error_logger_shptr_t logger, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > collector, std::size_t initial_heap_capacity) |
Create timer manager based on timer_heap mechanism. More... | |
SO_5_FUNC timer_manager_unique_ptr_t | create_timer_list_manager ( error_logger_shptr_t logger, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > collector) |
Create timer thread based on timer_list mechanism. More... | |
Operators for tuning agent_context. | |
agent_context_t | operator+ (agent_context_t ctx, subscription_storage_factory_t factory) |
template<class M > | |
agent_context_t | operator+ (agent_context_t ctx, message_limit::drop_indicator_t< M > limit) |
template<class M > | |
agent_context_t | operator+ (agent_context_t ctx, message_limit::abort_app_indicator_t< M > limit) |
template<class M , class L > | |
agent_context_t | operator+ (agent_context_t ctx, message_limit::log_then_abort_app_indicator_t< M, L > limit) |
template<class M , class L > | |
agent_context_t | operator+ (agent_context_t ctx, message_limit::redirect_indicator_t< M, L > limit) |
template<class M > | |
agent_context_t | operator+ (agent_context_t ctx, message_limit::transform_indicator_t< M > limit) |
agent_context_t | operator+ (agent_context_t ctx, so_5::priority_t agent_priority) |
Helper functions for creating parameters for mchain. | |
mchain_params_t | make_unlimited_mchain_params () |
Create parameters for size-unlimited mchain. More... | |
mchain_params_t | make_limited_without_waiting_mchain_params (std::size_t max_size, mchain_props::memory_usage_t memory_usage, mchain_props::overflow_reaction_t overflow_reaction) |
Create parameters for size-limited mchain without waiting on overflow. More... | |
mchain_params_t | make_limited_with_waiting_mchain_params (std::size_t max_size, mchain_props::memory_usage_t memory_usage, mchain_props::overflow_reaction_t overflow_reaction, mchain_props::duration_t wait_timeout) |
Create parameters for size-limited mchain with waiting on overflow. More... | |
Helper functions for mchain creation. | |
mchain_t | create_mchain (environment_t &env) |
Create size-unlimited chain. More... | |
mchain_t | create_mchain (wrapped_env_t &sobj) |
Create size-unlimited chain. More... | |
mchain_t | create_mchain (environment_t &env, std::size_t max_size, mchain_props::memory_usage_t memory_usage, mchain_props::overflow_reaction_t overflow_reaction) |
Create size-limited chain without waiting on overflow. More... | |
mchain_t | create_mchain (wrapped_env_t &sobj, std::size_t max_size, mchain_props::memory_usage_t memory_usage, mchain_props::overflow_reaction_t overflow_reaction) |
Create size-limited chain without waiting on overflow. More... | |
Standard timer thread factories. | |
timer_thread_factory_t | timer_wheel_factory () |
Factory for timer_wheel thread with default parameters. More... | |
timer_thread_factory_t | timer_wheel_factory (unsigned int wheel_size, std::chrono::steady_clock::duration granularity) |
Factory for timer_wheel thread with explicitely specified parameters. More... | |
timer_thread_factory_t | timer_heap_factory () |
Factory for timer_heap thread with default parameters. More... | |
timer_thread_factory_t | timer_heap_factory (std::size_t initial_heap_capacity) |
Factory for timer_heap thread with explicitely specified parameters. More... | |
timer_thread_factory_t | timer_list_factory () |
Factory for timer_list thread with default parameters. More... | |
Standard timer manager factories. | |
timer_manager_factory_t | timer_wheel_manager_factory () |
Factory for timer_wheel manager with default parameters. More... | |
timer_manager_factory_t | timer_wheel_manager_factory (unsigned int wheel_size, std::chrono::steady_clock::duration granularity) |
Factory for timer_wheel manager with explicitely specified parameters. More... | |
timer_manager_factory_t | timer_heap_manager_factory () |
Factory for timer_heap manager with default parameters. More... | |
timer_manager_factory_t | timer_heap_manager_factory (std::size_t initial_heap_capacity) |
Factory for timer_heap manager with explicitely specified parameters. More... | |
timer_manager_factory_t | timer_list_manager_factory () |
Factory for timer_list manager with default parameters. More... | |
Variables | |
const int | rc_environment_error = 1 |
so_environment launch is failed. More... | |
const int | rc_another_state_switch_in_progress = 170 |
An attempt to switch agent state when another switch operation is in progress. More... | |
const int | rc_autoshutdown_must_be_enabled = 171 |
An attempt to launch environment with autoshutdown disabled in conditions where autoshutdown must be enabled. More... | |
const int | rc_mutable_msg_cannot_be_delivered_via_mpmc_mbox = 172 |
An attempt to deliver mutable message via MPMC mbox. More... | |
const int | rc_mutable_msg_cannot_be_periodic = 173 |
An attempt to send mutable message as a periodic message. More... | |
const int | rc_subscription_to_mutable_msg_from_mpmc_mbox = 174 |
An attempt to make subscription on mutable message from MPMC mbox. More... | |
const int | rc_cannot_set_stop_guard_when_stop_is_started = 175 |
An attempt to set up a new stop_guard when the stop operation is already in progress. More... | |
const int | rc_negative_value_for_pause = 176 |
An attempt to use negative value for pause argument for delayed or periodic message/signal. More... | |
const int | rc_negative_value_for_period = 177 |
An attempt to use negative value for period argument for periodic message/signal. More... | |
const int | rc_transfer_to_state_loop = 178 |
A loop in transfer_to_state detected. More... | |
const int | rc_attempt_to_cast_to_envelope_on_nullptr = 180 |
An attempt to cast message to message envelope when a pointer to message is NULL. More... | |
const int | rc_unable_to_define_new_step = 181 |
New step can't be defined if testing scenario is already started or finished. More... | |
const int | rc_scenario_must_be_completed = 182 |
Testing scenario must be completed before an attempt to do the current operation. More... | |
const int | rc_stored_state_name_not_found = 183 |
There is no stored state name in the testing scenario. More... | |
const int | rc_coop_already_destroyed = 184 |
An attempt to get a pointer to already destroyed cooperation. More... | |
const int | rc_coop_is_not_in_registered_state = 185 |
An attempt to do something with coop that is not in registered state. More... | |
const int | rc_unable_to_join_thread_by_itself = 186 |
An attempt to call join() from the joinable thread itself. More... | |
const int | rc_extensible_select_is_active_now = 187 |
An attempt to modify or activate extensible-select when an operation on that extensible-select object is already active. More... | |
const int | rc_prepared_select_is_active_now = 188 |
An attempt to activate prepared-select when an operation on that prepared-select object is already active. More... | |
const thread_safety_t | not_thread_safe = thread_safety_t::unsafe |
Shorthand for thread unsafety indicator. More... | |
const thread_safety_t | thread_safe = thread_safety_t::safe |
Shorthand for thread safety indicator. More... | |
const infinite_wait_indication | infinite_wait |
A special indicator for infinite waiting on service request or on receive from mchain. More... | |
const no_wait_indication | no_wait = no_wait_indication::no_wait |
A special indicator for no waiting on service request or on receive from mchain. More... | |
Error codes for agent's methods. | |
const int | rc_agent_unknown_state = 10 |
Trying to switch to the unknown state. More... | |
const int | rc_agent_is_already_bind_to_env = 11 |
Agent is already bound to the SObjectizer Environment. More... | |
const int | rc_agent_is_already_bind_to_disp = 12 |
Agent is already bound to the dispatcher. More... | |
const int | rc_named_disp_not_found = 13 |
Dispatcher with that name is not found. More... | |
const int | rc_agent_has_no_cooperation = 14 |
Agent is not bound to a cooperation. More... | |
const int | rc_agent_incompatible_type_conversion = 15 |
It is impossible to make a cast to that type. More... | |
const int | rc_operation_enabled_only_on_agent_working_thread = 16 |
An attempt to perform an operation which is enabled only on agent's working thread. More... | |
const int | rc_no_initial_substate = 17 |
An attempt to change agent state to a new composite state which have no initial state defined. More... | |
const int | rc_state_nesting_is_too_deep = 18 |
Nesting of agent states is too deep. More... | |
const int | rc_initial_substate_already_defined = 19 |
Initial substate for a composite state is already defined. More... | |
Error codes for cooperations of agents. | |
const int | rc_zero_ptr_to_coop = 20 |
A zero pointer is detected. More... | |
const int | rc_coop_with_specified_name_is_already_registered = 21 |
Cooperation name is not unique. More... | |
const int | rc_coop_has_references_to_null_agents_or_binders = 22 |
Cooperation has the null reference to an agent or dispatcher binding. More... | |
const int | rc_coop_has_not_found_among_registered_coop = 23 |
There is no registered cooperation with that name. More... | |
const int | rc_coop_define_agent_failed = 24 |
Cooperation couldn't be registered. More... | |
const int | rc_agent_to_disp_binding_failed = 27 |
Binding of agent to dispatcher failed. More... | |
const int | rc_unable_to_register_coop_during_shutdown = 28 |
It is impossible to register cooperation during SObjectizer Environment shutdown. More... | |
Error codes for dispatchers. | |
const int | rc_disp_start_failed = 30 |
Unable to start a dispatcher. More... | |
const int | rc_disp_create_failed = 31 |
Unable to create a dispatcher. More... | |
const int | rc_disp_type_mismatch = 32 |
const int | rc_disp_cannot_be_added = 34 |
New dispatcher cannot be added because of illegal state of SObjectizer Environment. More... | |
Error codes for event handlers and message interceptors registration. | |
const int | rc_evt_handler_already_provided = 40 |
A handler for that event/mbox/state is already registered. More... | |
const int | rc_no_event_handler_provided = 41 |
const int | rc_event_handler_match_error = 42 |
Unable to deregister that handler. More... | |
const int | rc_agent_is_not_the_state_owner = 43 |
Agent doesn't own this state. More... | |
const int | rc_intercept_handler_already_provided = 44 |
An interceptor for the event/mbox/state is already registered. More... | |
const int | rc_no_interception_handler_provided = 45 |
const int | rc_interception_handler_match_error = 46 |
Unable to deregister this interceptor. More... | |
const int | rc_illegal_subscriber_for_mpsc_mbox = 47 |
An attempt to create illegal subscription to mpsc_mbox. More... | |
const int | rc_message_has_no_limit_defined = 48 |
An attempt to create subscription to message without predefined limit for that message type. More... | |
const int | rc_several_limits_for_one_message_type = 49 |
An attempt to define several limits for one message type. More... | |
Error codes for mboxes. | |
const int | rc_mbox_duplicating_name = 80 |
The mbox name is not unique. More... | |
const int | rc_mbox_unable_to_find_mbox = 81 |
The name of mbox is unknown. More... | |
const int | rc_null_message_data = 82 |
Null message data. More... | |
const int | rc_no_svc_handlers = 83 |
No handlers for service request found. More... | |
const int | rc_more_than_one_svc_handler = 84 |
There are more then one handler for service request. More... | |
const int | rc_svc_not_handled = 85 |
Service request has not been handled. Service handler is disabled in the current agent state. More... | |
const int | rc_svc_result_not_received_yet = 86 |
Service request result has not beed received yet. More... | |
const int | rc_msg_service_request_bad_cast = 87 |
Unable to cast service call description object to the appropriate type. More... | |
const int | rc_svc_request_cannot_be_transfomred_on_overlimit = 88 |
Unable to transform service request as part of overlimit reaction. More... | |
const int | rc_delivery_filter_cannot_be_used_on_mpsc_mbox = 89 |
Delivery filter is not applicable to MPSC-mboxes. More... | |
Error codes for delayed or repeated events. | |
const int | rc_unable_to_schedule_timer_act = 90 |
Unable to schedule a timer event. More... | |
Error codes for layers. | |
const int | rc_layer_not_binded_to_so_env = 100 |
The layer is not bound to the SObjectizer Environment. More... | |
const int | rc_trying_to_add_nullptr_extra_layer = 101 |
Unable to bind a layer by the null pointer to it. More... | |
const int | rc_trying_to_add_extra_layer_that_already_exists_in_default_list = 102 |
The layer is already bound to the SObjectizer Environment as a default layer. More... | |
const int | rc_trying_to_add_extra_layer_that_already_exists_in_extra_list = 103 |
The layer is already bound to the SObjectizer Environment as an extra layer. More... | |
const int | rc_unable_to_start_extra_layer = 104 |
Layer initialization is failed. More... | |
const int | rc_layer_does_not_exist = 105 |
A layer with the specified type doesn't exist. More... | |
Error codes for priorities. | |
const int | rc_priority_quote_illegal_value = 120 |
Illegal value of quote for a priority. More... | |
Error codes for SObjectizer Environment related errors. | |
const int | rc_msg_tracing_disabled = 140 |
Message delivery tracing is disabled and cannot be used. More... | |
Error codes for message chains. | |
const int | rc_msg_chain_is_empty = 160 |
Attempt to get message from empty message queue. More... | |
const int | rc_msg_chain_is_full = 161 |
Attempt to push a message to full message queue. More... | |
const int | rc_msg_chain_doesnt_support_subscriptions = 162 |
Attempt to make subscription for message chain. More... | |
const int | rc_msg_chain_doesnt_support_delivery_filters = 163 |
Attempt to set delivery_filter for message chain. More... | |
const int | rc_msg_chain_overflow = 164 |
const int | rc_several_handlers_for_one_message_type = 165 |
Attempt to define several handlers for one msg_type. More... | |
Common error codes. | |
const int | rc_empty_name = 500 |
The empty name doesn't allowed. More... | |
const int | rc_invalid_time_limit_for_state = 501 |
Invalid value of time limit for an agent's state. More... | |
const int | rc_not_implemented = 502 |
Feature or method has no implementation yet. More... | |
const int | rc_unknown_exception_type = 503 |
An exception of unknown type is caught. More... | |
const int | rc_unexpected_error = 0xFFFFFF |
Unclassified error. More... | |
Public part of message limit implementation.
Private part of message limit implementation.
Main SObjectizer-5 namespace.
using so_5::agent_ref_t = typedef intrusive_ptr_t< agent_t > |
A smart reference to an agent.
using so_5::agent_state_listener_unique_ptr_t = typedef std::unique_ptr< agent_state_listener_t > |
Typedef for the agent_state_listener autopointer.
using so_5::atomic_counter_t = typedef std::atomic_ulong |
Atomic counter type.
using so_5::atomic_flag_t = typedef std::atomic_ulong |
Atomic flag type.
using so_5::coop_dereg_notificator_t = typedef std::function< void( environment_t &, const coop_handle_t &, const coop_dereg_reason_t &) > |
Type of cooperation deregistration notificator.
Cooperation notificator should be a function with the following prototype:
using so_5::coop_dereg_notificators_container_ref_t = typedef intrusive_ptr_t< coop_dereg_notificators_container_t > |
Typedef for smart pointer to notificators_container.
using so_5::coop_id_t = typedef std::uint_fast64_t |
ID of cooperation.
using so_5::coop_listener_unique_ptr_t = typedef std::unique_ptr< coop_listener_t > |
Typedef for the coop_listener autopointer.
using so_5::coop_reg_notificator_t = typedef std::function< void(environment_t &, const coop_handle_t &) > |
Type of cooperation registration notificator.
Cooperation notificator should be a function with the following prototype:
using so_5::coop_reg_notificators_container_ref_t = typedef intrusive_ptr_t< coop_reg_notificators_container_t > |
Typedef for smart pointer to notificators_container.
using so_5::coop_shptr_t = typedef std::shared_ptr< coop_t > |
Typedef for the agent_coop smart pointer.
using so_5::current_thread_id_t = typedef std::thread::id |
Type of the current thread id.
using so_5::default_rw_spinlock_t = typedef rw_spinlock_t< pause_backoff_t > |
using so_5::default_spinlock_t = typedef spinlock_t< pause_backoff_t > |
using so_5::delivery_filter_unique_ptr_t = typedef std::unique_ptr< delivery_filter_t > |
An alias of unique_ptr for delivery_filter.
using so_5::demand_handler_pfn_t = typedef void (*)( current_thread_id_t, execution_demand_t & ) |
Demand handler prototype.
using so_5::disp_binder_shptr_t = typedef std::shared_ptr< disp_binder_t > |
Typedef for the disp_binder smart pointer.
using so_5::environment_infrastructure_deleter_fnptr_t = typedef void (*)(environment_infrastructure_t *) |
A type for deleter for environment_infrastructure objects.
using so_5::environment_infrastructure_factory_t = typedef std::function< environment_infrastructure_unique_ptr_t( environment_t &, environment_params_t &, mbox_t) > |
Type of factory for environment infrastructure.
A factory must be a function with the following format:
using so_5::environment_infrastructure_unique_ptr_t = typedef std::unique_ptr< environment_infrastructure_t, environment_infrastructure_deleter_fnptr_t > |
A type of unique pointer for environment_infrastructure entity.
using so_5::error_logger_shptr_t = typedef std::shared_ptr< error_logger_t > |
An alias for shared_ptr to error_logger.
using so_5::event_exception_logger_unique_ptr_t = typedef std::unique_ptr< event_exception_logger_t > |
Typedef for the event_exception_logger autopointer.
using so_5::event_handler_method_t = typedef std::function< void(message_ref_t &) > |
Type of event handler method.
using so_5::event_queue_hook_deleter_fnptr_t = typedef void (*)(event_queue_hook_t *) |
A type for deleter of event_queue_hook object.
using so_5::event_queue_hook_unique_ptr_t = typedef std::unique_ptr< event_queue_hook_t, event_queue_hook_deleter_fnptr_t > |
Alias for unique pointer to event_queue_hook.
using so_5::generic_simple_init_t = typedef std::function< void(so_5::environment_t &) > |
Generic type for a simple SObjectizer-initialization function.
using so_5::generic_simple_so_env_params_tuner_t = typedef std::function< void(so_5::environment_params_t &) > |
Generic type for a simple SO Environment paramenters tuning function.
using so_5::layer_map_t = typedef std::map< std::type_index, layer_ref_t > |
Typedef for the map from a layer typeid to the layer.
using so_5::layer_ref_t = typedef std::shared_ptr< layer_t > |
Typedef for the layer's smart pointer.
using so_5::layer_unique_ptr_t = typedef std::unique_ptr< layer_t > |
Typedef for the layer's autopointer.
using so_5::mbox_id_t = typedef unsigned long long |
A type for mbox indentifier.
using so_5::mbox_t = typedef intrusive_ptr_t< abstract_message_box_t > |
Smart reference for the abstract_message_box.
using so_5::mchain_t = typedef intrusive_ptr_t< abstract_message_chain_t > |
Short name for smart pointer to message chain.
using so_5::message_ref_t = typedef intrusive_ptr_t< message_t > |
A smart reference to the message.
using so_5::mutable_mhood_t = typedef mhood_t< mutable_msg<M> > |
A short name for message hood for mutable message.
using so_5::queue_locks_defaults_manager_unique_ptr_t = typedef std::unique_ptr< queue_locks_defaults_manager_t > |
An alias of unique_ptr for queue_locks_defaults_manager.
using so_5::stop_guard_shptr_t = typedef std::shared_ptr< stop_guard_t > |
An alias of shared_ptr for stop_guard.
using so_5::subscription_storage_factory_t = typedef std::function< impl::subscription_storage_unique_ptr_t( agent_t * ) > |
Type of subscription_storage factory.
using so_5::timer_manager_factory_t = typedef std::function< timer_manager_unique_ptr_t( error_logger_shptr_t, outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > ) > |
Type of factory for creating timer_manager objects.
using so_5::timer_manager_unique_ptr_t = typedef std::unique_ptr< timer_manager_t > |
Auxiliary typedef for timer_manager autopointer.
using so_5::timer_thread_factory_t = typedef std::function< timer_thread_unique_ptr_t( error_logger_shptr_t ) > |
Type of factory for creating timer_thread objects.
using so_5::timer_thread_unique_ptr_t = typedef std::unique_ptr< timer_thread_t > |
Auxiliary typedef for timer_thread autopointer.
|
strong |
A reaction of SObjectizer to an exception from agent event.
|
strong |
|
strong |
Type of the message box.
|
strong |
A enum with variants of message kinds.
Enumerator | |
---|---|
signal | Message is a signal. It means there is no data associated with the message instance. |
classical_message | Message is a classical message. It means that message is an instance of class derived from message_t. |
user_type_message | Message is an user type message. |
enveloped_msg | Message is an envelope with some other message inside. |
|
strong |
|
strong |
Type of ownership of a message instance inside message_holder.
This type is intended to be used as parameter for message_holder_t template.
|
strong |
|
strong |
|
strong |
|
strong |
SO_5_FUNC subscription_storage_factory_t so_5::adaptive_subscription_storage_factory | ( | std::size_t | threshold | ) |
Factory for adaptive subscription storage.
threshold | Threshold for switching from small storage to the large one (and back from the large to the small in the case of subscription deletion). |
SO_5_FUNC subscription_storage_factory_t so_5::adaptive_subscription_storage_factory | ( | std::size_t | threshold, |
const subscription_storage_factory_t & | small_storage_factory, | ||
const subscription_storage_factory_t & | large_storage_factory | ||
) |
Factory for adaptive subscription storage.
threshold | Threshold for switching from small storage to the large one (and back from the large to the small in the case of subscription deletion). |
small_storage_factory | A factory for creating small storage. |
large_storage_factory | A factory for creating large storage. |
void so_5::add_select_cases | ( | extensible_select_t & | extensible_select, |
Cases &&... | cases | ||
) |
Add a portion of cases to extensible-select instance.
Usage examples:
extensible_select | An instance of extensible-select to be extended. |
cases | Select cases. |
mchain_auto_close_details::auto_closer_t< sizeof...(Tail) > so_5::auto_close_drop_content | ( | Tail &&... | tail | ) |
Helper function for automatic closing of mchains with dropping their content.
Usage example:
Tail | List of mchains. |
mchain_auto_close_details::auto_closer_t< sizeof...(Tail) > so_5::auto_close_mchains | ( | mchain_props::close_mode_t | close_mode, |
Tail &&... | tail | ||
) |
Helper function for creation of automatic closer of mchains.
Usage examples:
close_mode | Close mode for all mchains. This value will be passed to all close() calls. |
tail | Chains to be closed. |
mchain_auto_close_details::auto_closer_t< sizeof...(Tail) > so_5::auto_close_retain_content | ( | Tail &&... | tail | ) |
Helper function for automatic closing of mchains with retaining their content.
Usage example:
Tail | List of mchains. |
thread_auto_join_details::auto_joiner_t< 1 + sizeof...(Tail) > so_5::auto_join | ( | std::thread & | first_thread, |
Tail &&... | tail | ||
) |
Helper function for creation of automatic joiner of std::threads.
Usage examples:
first_thread | The first thread to be closed. |
tail | Other threads to be closed. |
mchain_props::select_case_unique_ptr_t so_5::case_ | ( | mchain_t | chain, |
Handlers &&... | handlers | ||
) |
A helper for creation of select_case object for one multi chain select.
chain | Message chain to be used in select. |
handlers | Message handlers for messages extracted from that chain. |
|
inline |
Helper function for closing a message chain with dropping all its content.
|
inline |
Helper function for closing a message chain with retaining all its content.
SO_5_NODISCARD coop_unique_holder_t so_5::create_child_coop | ( | agent_t & | owner, |
Args &&... | args | ||
) |
A simple way for creating child cooperation.
owner | Owner of the cooperation. |
args | Arguments for the environment_t::make_coop() method. |
SO_5_NODISCARD coop_unique_holder_t so_5::create_child_coop | ( | coop_handle_t | parent, |
Args &&... | args | ||
) |
A simple way for creating child cooperation when there is a reference to the parent cooperation object.
parent | Parent cooperation. |
args | Arguments for the environment_t::make_coop() method. |
|
inline |
Create size-unlimited chain.
|
inline |
Create size-unlimited chain.
|
inline |
Create size-limited chain without waiting on overflow.
env | Environment for mchain. |
max_size | Max capacity of mchain. |
memory_usage | Type of chain storage. |
overflow_reaction | Reaction on chain overflow. |
|
inline |
Create size-limited chain without waiting on overflow.
sobj | Environment for mchain. |
max_size | Max capacity of mchain. |
memory_usage | Type of chain storage. |
overflow_reaction | Reaction on chain overflow. |
|
inline |
Create size-limited chain with waiting on overflow.
env | Environment for mchain. |
waiting_time | Max waiting time in case of overflow. |
max_size | Max capacity of mchain. |
memory_usage | Type of chain storage. |
overflow_reaction | Reaction on chain overflow. |
|
inline |
Create size-limited chain without waiting on overflow.
sobj | Environment for mchain. |
waiting_time | Max waiting time in case of overflow. |
max_size | Max capacity of mchain. |
memory_usage | Type of chain storage. |
overflow_reaction | Reaction on chain overflow. |
SO_5_FUNC event_exception_logger_unique_ptr_t so_5::create_std_event_exception_logger | ( | ) |
Create the default exception logger.
SO_5_FUNC error_logger_shptr_t so_5::create_stderr_logger | ( | ) |
A factory for creating error_logger implemenation which uses std::stderr as log stream.
SO_5_FUNC timer_manager_unique_ptr_t so_5::create_timer_heap_manager | ( | error_logger_shptr_t | logger, |
outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > | collector | ||
) |
Create timer manager based on timer_heap mechanism.
logger | A logger for handling error messages inside timer_manager. |
collector | A collector for elapsed timers. |
SO_5_FUNC timer_manager_unique_ptr_t so_5::create_timer_heap_manager | ( | error_logger_shptr_t | logger, |
outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > | collector, | ||
std::size_t | initial_heap_capacity | ||
) |
Create timer manager based on timer_heap mechanism.
logger | A logger for handling error messages inside timer_manager. |
collector | A collector for elapsed timers. |
initial_heap_capacity | Initical capacity of heap array. |
SO_5_FUNC timer_thread_unique_ptr_t so_5::create_timer_heap_thread | ( | error_logger_shptr_t | logger | ) |
Create timer thread based on timer_heap mechanism.
logger | A logger for handling error messages inside timer_thread. |
SO_5_FUNC timer_thread_unique_ptr_t so_5::create_timer_heap_thread | ( | error_logger_shptr_t | logger, |
std::size_t | initial_heap_capacity | ||
) |
Create timer thread based on timer_heap mechanism.
logger | A logger for handling error messages inside timer_thread. |
initial_heap_capacity | Initical capacity of heap array. |
SO_5_FUNC timer_manager_unique_ptr_t so_5::create_timer_list_manager | ( | error_logger_shptr_t | logger, |
outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > | collector | ||
) |
Create timer thread based on timer_list mechanism.
logger | A logger for handling error messages inside timer_manager. |
collector | A collector for elapsed timers. |
SO_5_FUNC timer_thread_unique_ptr_t so_5::create_timer_list_thread | ( | error_logger_shptr_t | logger | ) |
Create timer thread based on timer_list mechanism.
logger | A logger for handling error messages inside timer_thread. |
SO_5_FUNC timer_manager_unique_ptr_t so_5::create_timer_wheel_manager | ( | error_logger_shptr_t | logger, |
outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > | collector | ||
) |
Create timer manager based on timer_wheel mechanism.
logger | A logger for handling error messages inside timer_manager. |
collector | A collector for elapsed timers. |
SO_5_FUNC timer_manager_unique_ptr_t so_5::create_timer_wheel_manager | ( | error_logger_shptr_t | logger, |
outliving_reference_t< timer_manager_t::elapsed_timers_collector_t > | collector, | ||
unsigned int | wheel_size, | ||
std::chrono::steady_clock::duration | granuality | ||
) |
Create timer manager based on timer_wheel mechanism.
logger | A logger for handling error messages inside timer_manager. |
collector | A collector for elapsed timers. |
wheel_size | Size of the wheel. |
granuality | A size of one time step for the wheel. |
SO_5_FUNC timer_thread_unique_ptr_t so_5::create_timer_wheel_thread | ( | error_logger_shptr_t | logger | ) |
Create timer thread based on timer_wheel mechanism.
logger | A logger for handling error messages inside timer_thread. |
SO_5_FUNC timer_thread_unique_ptr_t so_5::create_timer_wheel_thread | ( | error_logger_shptr_t | logger, |
unsigned int | wheel_size, | ||
std::chrono::steady_clock::duration | granuality | ||
) |
Create timer thread based on timer_wheel mechanism.
logger | A logger for handling error messages inside timer_thread. |
wheel_size | Size of the wheel. |
granuality | A size of one time step for the wheel. |
SO_5_FUNC subscription_storage_factory_t so_5::default_subscription_storage_factory | ( | ) |
Factory for default subscription storage object.
void so_5::ensure_classical_message | ( | ) |
A special compile-time checker to guarantee that Msg is derived from message_t.
Msg | type to be checked. |
void so_5::ensure_message_with_actual_data | ( | const Msg * | m | ) |
void so_5::ensure_not_mutable_signal | ( | ) |
A special compile-time checker to guarantee that S is not a mutable signal.
This check is intended to prevent usage of mutable_msg<S> where S is a signal type.
void so_5::ensure_not_signal | ( | ) |
A special compile-time checker to guarantee that the message class is not a signal class.
void so_5::ensure_signal | ( | ) |
A special compile-time checker to guarantee that the Msg is derived from the signal_t.
Msg | signal type to be checked. |
|
inline |
A helper function for simplification of creation of mchain_receive_params instance.
|
inline |
Helper function for creation of mchain_select_params instance with default values.
Usage example:
SO_5_FUNC subscription_storage_factory_t so_5::hash_table_based_subscription_storage_factory | ( | ) |
Factory for default subscription storage based on std::unordered_map.
decltype(auto) so_5::introduce_child_coop | ( | agent_t & | owner, |
Args &&... | args | ||
) |
A simple way for creating and registering child cooperation.
owner | Owner of the cooperation. |
args | Arguments for the environment_t::introduce_coop() method. |
decltype(auto) so_5::introduce_child_coop | ( | coop_handle_t | parent, |
Args &&... | args | ||
) |
A simple way for creating and registering child cooperation when there is a reference to parent coop.
parent | Parent cooperation. |
args | Arguments for the environment_t::introduce_coop() method. |
so_5::intrusive_ptr_t | ( | std::unique_ptr< T > | ) | -> intrusive_ptr_t< T > |
Deduction rule for C++17 compiler.
void so_5::launch | ( | Init_Routine && | init_routine | ) |
Launch a SObjectizer Environment with default parameters.
Example with free function as initializer:
Example with lambda-function as initializer:
Example with object method as initializer:
Init_Routine | Type of initialization routine. It can be a pointer to function or functional object that accepts a reference to so_5::environment_t. |
init_routine | Initialization routine. |
|
inline |
Launch a SObjectizer Environment with explicitely specified parameters.
Example with free functions as initializers:
Example with lambda-functions as initializers:
Init_Routine | Type of initialization routine. It can be a pointer to function or functional object that accepts a reference to so_5::environment_t. |
Params_Tuner | Type of routine for tuning environment's parameters. It can be a pointer to function or functional object that accepts a reference to so_5::environment_params_t. |
init_routine | Initialization routine. |
params_tuner | Parameters setting routine. |
|
inlinenoexcept |
Create notificator about cooperation deregistration completion.
target | A mbox to which msg_coop_deregistered will be sent. |
|
inlinenoexcept |
Create notificator about cooperation registration completion.
target | A mbox to which msg_coop_registered will be sent. |
|
inline |
Create an instance of the default dispatcher binder.
Usage example:
SO_5_FUNC queue_locks_defaults_manager_unique_ptr_t so_5::make_defaults_manager_for_combined_locks | ( | ) |
A factory for queue_locks_defaults_manager with generators for combined locks.
SO_5_FUNC queue_locks_defaults_manager_unique_ptr_t so_5::make_defaults_manager_for_simple_locks | ( | ) |
A factory for queue_locks_defaults_manager with generators for simple locks.
|
inline |
Helper function for creation of empty unique_ptr for event_queue_hook.
This function allows to write:
instead of
event_queue_hook_unique_ptr_t so_5::make_event_queue_hook | ( | event_queue_hook_deleter_fnptr_t | deleter, |
Args &&... | args | ||
) |
Helper function for simplify creation of event_queue_hook object.
This helper function allows to write:
instead of:
extensible_select_t so_5::make_extensible_select | ( | mchain_select_params_t< Msg_Count_Status > | params, |
Cases &&... | cases | ||
) |
Creation of extensible-select instance.
This function creates an instance of extensible-select object that can be used for subsequent calls to add_select_cases() and select().
Usage examples:
params | Parameters for advanced select. |
cases | Select cases. |
|
inline |
Create parameters for size-limited mchain with waiting on overflow.
send
is used for message pushing then there will be waiting for free space if the message chain is full. But if message push is performed from timer thread (it means that message is a delayed or a periodic message) then there will not be any waiting. It is because the context of timer thread is very special: there is no possibility to spend some time on waiting for some free space in message chain. All operations on the context of timer thread must be done as fast as possible. max_size | Max size of the chain. |
memory_usage | Type of chain storage. |
overflow_reaction | Reaction on chain overflow. |
wait_timeout | Waiting time on full message chain. |
|
inline |
Create parameters for size-limited mchain without waiting on overflow.
max_size | Max capacity of mchain. |
memory_usage | Type of chain storage. |
overflow_reaction | Reaction on chain overflow. |
|
inline |
Create parameters for size-unlimited mchain.
SO_5_FUNC subscription_storage_factory_t so_5::map_based_subscription_storage_factory | ( | ) |
Factory for subscription storage based on std::map.
|
inline |
Get NULL thread id.
|
inline |
Default value for null mbox_id.
agent_context_t so_5::operator+ | ( | environment_t & | env, |
Option | arg | ||
) |
A plus operator for creating agent_context object from a reference to Environment and single agent tuning option.
|
inline |
agent_context_t so_5::operator+ | ( | agent_context_t | ctx, |
message_limit::drop_indicator_t< M > | limit | ||
) |
agent_context_t so_5::operator+ | ( | agent_context_t | ctx, |
message_limit::abort_app_indicator_t< M > | limit | ||
) |
agent_context_t so_5::operator+ | ( | agent_context_t | ctx, |
message_limit::log_then_abort_app_indicator_t< M, L > | limit | ||
) |
agent_context_t so_5::operator+ | ( | agent_context_t | ctx, |
message_limit::redirect_indicator_t< M, L > | limit | ||
) |
agent_context_t so_5::operator+ | ( | agent_context_t | ctx, |
message_limit::transform_indicator_t< M > | limit | ||
) |
|
inline |
A shortcat for switching the agent state.
outliving_reference_t< const T > so_5::outliving_const | ( | T const & | r | ) |
outliving_reference_t< const T > so_5::outliving_const | ( | outliving_reference_t< T > | r | ) |
outliving_reference_t< T > so_5::outliving_mutable | ( | T & | r | ) |
prepared_receive_t< sizeof...(Handlers) > so_5::prepare_receive | ( | const mchain_receive_params_t< Msg_Count_Status > & | params, |
Handlers &&... | handlers | ||
) |
Create parameters for receive function to be used later.
Accepts all parameters as advanced receive() version. For example:
params | Parameters for advanced receive. |
handlers | Handlers |
prepared_select_t< sizeof...(Cases) > so_5::prepare_select | ( | mchain_select_params_t< Msg_Count_Status > | params, |
Cases &&... | cases | ||
) |
Create prepared select statement to be used later.
Accepts all parameters as advanced select() version. For example:
params | Parameters for advanced select. |
cases | Select cases. |
std::enable_if< details::is_agent_method_pointer< details::method_arity::unary, Method_Pointer>::value, details::msg_type_and_handler_pair_t >::type so_5::preprocess_agent_event_handler | ( | const mbox_t & | mbox, |
agent_t & | agent, | ||
Method_Pointer | pfn | ||
) |
Do preprocessing and some verification of event handler and return msg_type_and_handler_pair for it.
This overload is intended to be used for pointers to members.
std::enable_if< details::lambda_traits::is_lambda<Lambda>::value, details::msg_type_and_handler_pair_t >::type so_5::preprocess_agent_event_handler | ( | const mbox_t & | mbox, |
agent_t & | , | ||
Lambda && | lambda | ||
) |
Do preprocessing and some verification of event handler and return msg_type_and_handler_pair for it.
This overload is intended to be used for lambdas or functional objects.
|
inline |
Get the ID of the current thread.
|
inline |
Get the raw thread id from current_thread_id.
|
inline |
Advanced version of receive from mchain.
params | Parameters for receive. |
handlers | Handlers for message processing. |
mchain_receive_result_t so_5::receive | ( | const prepared_receive_t< Handlers_Count > & | prepared | ) |
A receive operation to be done on previously prepared receive params.
Usage of ordinary forms of receive() functions inside loops could be inefficient because of wasting resources on constructions of internal objects with descriptions of handlers on each receive() call. More efficient way is preparation of all receive params and reusing them later. A combination of so_5::prepare_receive() and so_5::receive(prepared_receive_t) allows to do that.
Usage example:
mchain_receive_result_t so_5::select | ( | const mchain_select_params_t< Msg_Count_Status > & | params, |
Cases &&... | cases | ||
) |
An advanced form of multi chain select.
params | Parameters for advanced select. |
cases | Select cases. |
mchain_receive_result_t so_5::select | ( | const prepared_select_t< Cases_Count > & | prepared | ) |
A select operation to be done on previously prepared select params.
Usage of ordinary forms of select() functions inside loops could be inefficient because of wasting resources on constructions of internal objects with descriptions of select cases on each select() call. More efficient way is preparation of all select params and reusing them later. A combination of so_5::prepare_select() and so_5::select(prepared_select_t) allows to do that.
Usage example:
|
inline |
A select operation to be done on previously prepared extensible-select object.
Usage example:
void so_5::send | ( | Target && | to, |
Args &&... | args | ||
) |
A utility function for creating and delivering a message or a signal.
Message | type of message to be sent. |
Target | identification of request processor. Could be reference to so_5::mbox_t, to so_5::agent_t (the later case agent's direct mbox will be used). |
Args | arguments for Message's constructor. |
std::enable_if< !is_signal< Message >::value >::type so_5::send | ( | Target && | to, |
mhood_t< Message > | what | ||
) |
A version of send function for redirection of a message from exising message hood.
Message | a type of message to be redirected (it can be in form of Msg, so_5::immutable_msg<Msg> or so_5::mutable_msg<Msg>). |
Usage example:
std::enable_if< is_signal< Message >::value >::type so_5::send | ( | Target && | to, |
mhood_t< Message > | |||
) |
A version of send function for redirection of a signal from exising message hood.
Message | a type of signal to be redirected (it can be in form of Sig or so_5::immutable_msg<Sig>). |
Usage example:
void so_5::send | ( | Target && | to, |
message_holder_t< Message, Ownership > | what | ||
) |
A version of send function for redirection of a message from exising message_holder instance.
Usage example:
to | Destination for the message. |
what | Message to be sent. |
void so_5::send_delayed | ( | Target && | target, |
std::chrono::steady_clock::duration | pause, | ||
Args &&... | args | ||
) |
A utility function for creating and delivering a delayed message to the specified destination.
Agent or mchain can be used as target.
Message | type of message or signal to be sent. |
Target | can be so_5::agent_t or so_5::mchain_t. |
Args | list of arguments for Message's constructor. |
target | A target for delayed message. |
pause | Pause for message delaying. |
args | Message constructor parameters. |
std::enable_if< !message_payload_type<Message>::is_signal >::type so_5::send_delayed | ( | Target && | to, |
std::chrono::steady_clock::duration | pause, | ||
mhood_t< Message > | msg | ||
) |
A utility function for delayed redirection of a message from existing message hood.
Target | a type of destination of the message. It can be an agent, a mbox or mchain. |
Message | a type of message to be redirected (it can be in form of Msg, so_5::immutable_msg<Msg> or so_5::mutable_msg<Msg>). |
Usage example:
A redirection to the direct mbox of some agent can looks like:
A redirection to a mchain can looks like:
to | Destination for the message. |
pause | Pause for message delaying. |
msg | Message instance owner. |
std::enable_if< message_payload_type<Message>::is_signal >::type so_5::send_delayed | ( | Target && | to, |
std::chrono::steady_clock::duration | pause, | ||
mhood_t< Message > | |||
) |
A utility function for delayed redirection of a signal from existing message hood.
Target | a type of destination of the signal. It can be an agent, a mbox or mchain. |
Message | a type of signal to be redirected (it can be in form of Sig or so_5::immutable_msg<Sig>). |
Usage example:
A redirection to the direct mbox of some agent can looks like:
A redirection to a mchain can looks like:
to | Destination for the message. |
pause | Pause for message delaying. |
void so_5::send_delayed | ( | Target && | to, |
std::chrono::steady_clock::duration | pause, | ||
message_holder_t< Message, Ownership > | msg | ||
) |
A version of send_delayed function for redirection of a message from exising message_holder instance.
Usage example:
to | Destination for the message. |
pause | Pause for message delaying. |
msg | Message to be sent |
SO_5_NODISCARD timer_id_t so_5::send_periodic | ( | Target && | target, |
std::chrono::steady_clock::duration | pause, | ||
std::chrono::steady_clock::duration | period, | ||
Args &&... | args | ||
) |
A utility function for creating and delivering a periodic message to the specified destination.
Agent or mchain can be used as target.
Message | type of message or signal to be sent. |
Target | can be so_5::agent_t or so_5::mchain_t. |
Args | list of arguments for Message's constructor. |
target | A destination for the periodic message. |
pause | Pause for message delaying. |
period | Period of message repetitions. |
args | Message constructor parameters. |
SO_5_NODISCARD std::enable_if< !is_signal< Message >::value, timer_id_t >::type so_5::send_periodic | ( | Target && | target, |
std::chrono::steady_clock::duration | pause, | ||
std::chrono::steady_clock::duration | period, | ||
mhood_t< Message > | mhood | ||
) |
A utility function for delivering a periodic from an existing message hood.
Target | a type of destination of the message. It can be an agent, a mbox or mchain. |
Message | a type of message to be redirected (it can be in form of Msg, so_5::immutable_msg<Msg> or so_5::mutable_msg<Msg>). |
Usage example:
A redirection to the direct mbox of some agent can looks like:
A redirection to a mchain can looks like:
target | A destination for the periodic message. |
pause | Pause for message delaying. |
period | Period of message repetitions. |
mhood | Existing message hood for message to be sent. |
SO_5_NODISCARD std::enable_if< is_signal< Message >::value, timer_id_t >::type so_5::send_periodic | ( | Target && | target, |
std::chrono::steady_clock::duration | pause, | ||
std::chrono::steady_clock::duration | period, | ||
mhood_t< Message > | |||
) |
A utility function for periodic redirection of a signal from existing message hood.
Target | a type of destination of the signal. It can be an agent, a mbox or mchain. |
Message | a type of signal to be redirected (it can be in form of Sig or so_5::immutable_msg<Sig>). |
Usage example:
A redirection to the direct mbox of some agent can looks like:
A redirection to a mchain can looks like:
target | A destination for the periodic message. |
pause | Pause for message delaying. |
period | Period of message repetitions. |
SO_5_NODISCARD timer_id_t so_5::send_periodic | ( | Target && | target, |
std::chrono::steady_clock::duration | pause, | ||
std::chrono::steady_clock::duration | period, | ||
message_holder_t< Message, Ownership > | what | ||
) |
A version of send_periodic function for redirection of a message from exising message_holder instance.
Usage example:
target | A destination for the periodic message. |
pause | Pause for message delaying. |
period | Period of message repetitions. |
what | Message to be sent. |
SO_5_FUNC void so_5::swap | ( | environment_params_t & | a, |
environment_params_t & | b | ||
) |
|
inline |
Factory for timer_heap thread with default parameters.
|
inline |
Factory for timer_heap thread with explicitely specified parameters.
initial_heap_capacity | Initial capacity of heap array. |
|
inline |
Factory for timer_heap manager with default parameters.
|
inline |
Factory for timer_heap manager with explicitely specified parameters.
initial_heap_capacity | Initial capacity of heap array. |
|
inline |
Factory for timer_list thread with default parameters.
|
inline |
Factory for timer_list manager with default parameters.
|
inline |
Factory for timer_wheel thread with default parameters.
|
inline |
Factory for timer_wheel thread with explicitely specified parameters.
wheel_size | Size of the wheel. |
granularity | A size of one time step for the wheel. |
|
inline |
Factory for timer_wheel manager with default parameters.
|
inline |
Factory for timer_wheel manager with explicitely specified parameters.
wheel_size | Size of the wheel. |
granularity | A size of one time step for the wheel. |
std::enable_if< !is_signal<M>::value, mhood_t< immutable_msg< M > > >::type so_5::to_immutable | ( | mhood_t< mutable_msg< M > > | msg | ) |
Transform mutable message instance into immutable.
Usage example:
std::enable_if< is_signal<M>::value, mhood_t< immutable_msg< M > > >::type so_5::to_immutable | ( | mhood_t< mutable_msg< M > > | ) |
|
inline |
Helper function for conversion from size_t to priority.
std::invalid_argument | if v is out of range. |
|
inline |
Helper function for conversion from priority to size_t.
SO_5_FUNC subscription_storage_factory_t so_5::vector_based_subscription_storage_factory | ( | std::size_t | initial_capacity | ) |
Factory for subscription storage based on std::vector.
initial_capacity | Initial storage capacity. |
const infinite_wait_indication so_5::infinite_wait |
A special indicator for infinite waiting on service request or on receive from mchain.
const no_wait_indication so_5::no_wait = no_wait_indication::no_wait |
A special indicator for no waiting on service request or on receive from mchain.
const thread_safety_t so_5::not_thread_safe = thread_safety_t::unsafe |
Shorthand for thread unsafety indicator.
const int so_5::rc_agent_has_no_cooperation = 14 |
Agent is not bound to a cooperation.
const int so_5::rc_agent_incompatible_type_conversion = 15 |
It is impossible to make a cast to that type.
const int so_5::rc_agent_is_already_bind_to_disp = 12 |
Agent is already bound to the dispatcher.
const int so_5::rc_agent_is_already_bind_to_env = 11 |
Agent is already bound to the SObjectizer Environment.
const int so_5::rc_agent_is_not_the_state_owner = 43 |
Agent doesn't own this state.
const int so_5::rc_agent_to_disp_binding_failed = 27 |
Binding of agent to dispatcher failed.
const int so_5::rc_agent_unknown_state = 10 |
Trying to switch to the unknown state.
const int so_5::rc_another_state_switch_in_progress = 170 |
An attempt to switch agent state when another switch operation is in progress.
const int so_5::rc_attempt_to_cast_to_envelope_on_nullptr = 180 |
An attempt to cast message to message envelope when a pointer to message is NULL.
Envelopes were introduced in v.5.5.23. Envelopes are sent and delivered as ordinary messages (it means that pointer to envelope will be sent as pointer to message_t). For processing of an envelope it is necessary to cast a pointer from message_t to envelope_t. But it is impossible if a pointer to message_t is null.
const int so_5::rc_autoshutdown_must_be_enabled = 171 |
An attempt to launch environment with autoshutdown disabled in conditions where autoshutdown must be enabled.
For example so_5::env_infrastructures::simple_not_mtsafe requires autoshutdown feature.
const int so_5::rc_cannot_set_stop_guard_when_stop_is_started = 175 |
An attempt to set up a new stop_guard when the stop operation is already in progress.
const int so_5::rc_coop_already_destroyed = 184 |
An attempt to get a pointer to already destroyed cooperation.
This error can be reported when a coop_handle instance for already destroyed coop is used.
const int so_5::rc_coop_define_agent_failed = 24 |
Cooperation couldn't be registered.
const int so_5::rc_coop_has_not_found_among_registered_coop = 23 |
There is no registered cooperation with that name.
const int so_5::rc_coop_has_references_to_null_agents_or_binders = 22 |
Cooperation has the null reference to an agent or dispatcher binding.
const int so_5::rc_coop_is_not_in_registered_state = 185 |
An attempt to do something with coop that is not in registered state.
For example if can be an attempt to add a new child coop when the parent coop is being deregistered.
const int so_5::rc_coop_with_specified_name_is_already_registered = 21 |
Cooperation name is not unique.
const int so_5::rc_delivery_filter_cannot_be_used_on_mpsc_mbox = 89 |
Delivery filter is not applicable to MPSC-mboxes.
const int so_5::rc_disp_cannot_be_added = 34 |
New dispatcher cannot be added because of illegal state of SObjectizer Environment.
const int so_5::rc_disp_create_failed = 31 |
Unable to create a dispatcher.
const int so_5::rc_disp_start_failed = 30 |
Unable to start a dispatcher.
const int so_5::rc_disp_type_mismatch = 32 |
The expected type of dispatcher and the actual type of the agent dispatcher are not the same.
const int so_5::rc_empty_name = 500 |
The empty name doesn't allowed.
const int so_5::rc_environment_error = 1 |
so_environment launch is failed.
const int so_5::rc_event_handler_match_error = 42 |
Unable to deregister that handler.
There is a handler for the event/mbox/state, but it is another handler. Not the one is specified for the deregistration.
const int so_5::rc_evt_handler_already_provided = 40 |
A handler for that event/mbox/state is already registered.
const int so_5::rc_extensible_select_is_active_now = 187 |
An attempt to modify or activate extensible-select when an operation on that extensible-select object is already active.
const int so_5::rc_illegal_subscriber_for_mpsc_mbox = 47 |
An attempt to create illegal subscription to mpsc_mbox.
const int so_5::rc_initial_substate_already_defined = 19 |
Initial substate for a composite state is already defined.
const int so_5::rc_intercept_handler_already_provided = 44 |
An interceptor for the event/mbox/state is already registered.
const int so_5::rc_interception_handler_match_error = 46 |
Unable to deregister this interceptor.
There is an interceptor for the event/mbox/state, but it is another handler. Not the one is specified for the deregistration.
const int so_5::rc_invalid_time_limit_for_state = 501 |
Invalid value of time limit for an agent's state.
const int so_5::rc_layer_does_not_exist = 105 |
A layer with the specified type doesn't exist.
const int so_5::rc_layer_not_binded_to_so_env = 100 |
The layer is not bound to the SObjectizer Environment.
const int so_5::rc_mbox_duplicating_name = 80 |
The mbox name is not unique.
const int so_5::rc_mbox_unable_to_find_mbox = 81 |
The name of mbox is unknown.
const int so_5::rc_message_has_no_limit_defined = 48 |
An attempt to create subscription to message without predefined limit for that message type.
const int so_5::rc_more_than_one_svc_handler = 84 |
There are more then one handler for service request.
const int so_5::rc_msg_chain_doesnt_support_delivery_filters = 163 |
Attempt to set delivery_filter for message chain.
const int so_5::rc_msg_chain_doesnt_support_subscriptions = 162 |
Attempt to make subscription for message chain.
const int so_5::rc_msg_chain_is_empty = 160 |
Attempt to get message from empty message queue.
const int so_5::rc_msg_chain_is_full = 161 |
Attempt to push a message to full message queue.
const int so_5::rc_msg_chain_overflow = 164 |
Attempt to added a message to full message chain when throw_exception overflow reaction is used.
const int so_5::rc_msg_service_request_bad_cast = 87 |
Unable to cast service call description object to the appropriate type.
This error is possible when type of service request doesn't match actual type of request handler. For example:
const int so_5::rc_msg_tracing_disabled = 140 |
Message delivery tracing is disabled and cannot be used.
const int so_5::rc_mutable_msg_cannot_be_delivered_via_mpmc_mbox = 172 |
An attempt to deliver mutable message via MPMC mbox.
const int so_5::rc_mutable_msg_cannot_be_periodic = 173 |
An attempt to send mutable message as a periodic message.
const int so_5::rc_named_disp_not_found = 13 |
Dispatcher with that name is not found.
const int so_5::rc_negative_value_for_pause = 176 |
An attempt to use negative value for pause argument for delayed or periodic message/signal.
A value of pause
argument for so_5::send_delayed() and so_5::send_periodic() must be non-negative.
const int so_5::rc_negative_value_for_period = 177 |
An attempt to use negative value for period argument for periodic message/signal.
A value of pause
argument for so_5::send_periodic() must be non-negative.
const int so_5::rc_no_event_handler_provided = 41 |
A handler for that event/mbox/state is not registered and cannot be deregistered.
const int so_5::rc_no_initial_substate = 17 |
An attempt to change agent state to a new composite state which have no initial state defined.
const int so_5::rc_no_interception_handler_provided = 45 |
An interceptor for the event/mbox/state is not registered and cannot be deregistered.
const int so_5::rc_no_svc_handlers = 83 |
No handlers for service request found.
const int so_5::rc_not_implemented = 502 |
Feature or method has no implementation yet.
const int so_5::rc_null_message_data = 82 |
Null message data.
An attempt to deliver message_t by nullptr pointer to it is an error. A signal should be used for this.
const int so_5::rc_operation_enabled_only_on_agent_working_thread = 16 |
An attempt to perform an operation which is enabled only on agent's working thread.
const int so_5::rc_prepared_select_is_active_now = 188 |
An attempt to activate prepared-select when an operation on that prepared-select object is already active.
const int so_5::rc_priority_quote_illegal_value = 120 |
Illegal value of quote for a priority.
const int so_5::rc_scenario_must_be_completed = 182 |
Testing scenario must be completed before an attempt to do the current operation.
const int so_5::rc_several_handlers_for_one_message_type = 165 |
Attempt to define several handlers for one msg_type.
const int so_5::rc_several_limits_for_one_message_type = 49 |
An attempt to define several limits for one message type.
const int so_5::rc_state_nesting_is_too_deep = 18 |
Nesting of agent states is too deep.
const int so_5::rc_stored_state_name_not_found = 183 |
There is no stored state name in the testing scenario.
const int so_5::rc_subscription_to_mutable_msg_from_mpmc_mbox = 174 |
An attempt to make subscription on mutable message from MPMC mbox.
Delivery of mutable messages via MPMC mboxes is prohibited.
const int so_5::rc_svc_not_handled = 85 |
Service request has not been handled. Service handler is disabled in the current agent state.
const int so_5::rc_svc_request_cannot_be_transfomred_on_overlimit = 88 |
Unable to transform service request as part of overlimit reaction.
const int so_5::rc_svc_result_not_received_yet = 86 |
Service request result has not beed received yet.
const int so_5::rc_transfer_to_state_loop = 178 |
A loop in transfer_to_state detected.
There could be a case when usage of transfer_to_state leads to a loop. For a very simple example:
Since v.5.5.22.1 an attempt to handle message
in the example above will lead to an exception with this error code.
Note that there could be more tricky examples when hierarchical states are used:
const int so_5::rc_trying_to_add_extra_layer_that_already_exists_in_default_list = 102 |
The layer is already bound to the SObjectizer Environment as a default layer.
const int so_5::rc_trying_to_add_extra_layer_that_already_exists_in_extra_list = 103 |
The layer is already bound to the SObjectizer Environment as an extra layer.
const int so_5::rc_trying_to_add_nullptr_extra_layer = 101 |
Unable to bind a layer by the null pointer to it.
const int so_5::rc_unable_to_define_new_step = 181 |
New step can't be defined if testing scenario is already started or finished.
const int so_5::rc_unable_to_join_thread_by_itself = 186 |
An attempt to call join() from the joinable thread itself.
const int so_5::rc_unable_to_register_coop_during_shutdown = 28 |
It is impossible to register cooperation during SObjectizer Environment shutdown.
const int so_5::rc_unable_to_schedule_timer_act = 90 |
Unable to schedule a timer event.
const int so_5::rc_unable_to_start_extra_layer = 104 |
Layer initialization is failed.
const int so_5::rc_unexpected_error = 0xFFFFFF |
Unclassified error.
const int so_5::rc_unknown_exception_type = 503 |
An exception of unknown type is caught.
SObjectizer expects that all exceptions are derived from std::exception class.
const int so_5::rc_zero_ptr_to_coop = 20 |
A zero pointer is detected.
const thread_safety_t so_5::thread_safe = thread_safety_t::safe |
Shorthand for thread safety indicator.