SObjectizer-5 Extra
|
A template which defines properties for a collecting mbox. More...
#include <collecting_mbox.hpp>
Public Types | |
using | messages_collected_t = typename details::messages_collected_t< config_type > |
Actual type of message_collected instance. More... | |
Static Public Member Functions | |
template<typename... Args> | |
static mbox_t | make (const mbox_t &target, Args &&... args) |
Create an instance of collecting mbox. More... | |
Private Types | |
using | config_type = details::config_type< Collecting_Msg, Traits, Lock_Type > |
A configuration to be used for that mbox type. More... | |
A template which defines properties for a collecting mbox.
Usage examples:
A type of message with collected messages is specified by inner type mbox_template_t::messages_collected_t. Please note that actual message type for messages_collected_t will depend on Collecting_Msg template parameter. If Collecting_Msg is message type then messages_collected_t will be message which holds collected messages inside. Such message type will have the following interface:
A functor for methods with_nth
and for_each
must have the following format:
A functor for method for_each_with_index
must have the following format:
For example, handling of collected immutable messages can looks like:
And handling of collected mutable messages can looks like:
If Collecting_Msg is a type of signal, then mbox_template_t::messages_collected_t will have the following format:
It means that if Collecting_Msg is a signal type then there is no any collected signals instances.
Collecting_Msg | type of message to be collected. It can be simple type like my_msg (in this case only immutable messages of type my_msg will be collected). Or it can be so_5::mutable_msg<my_msg> (in this case only mutable messages of type my_msg will be collected). |
Traits | type of size-specific traits. It is expected to be constexpr_size_traits_t or runtime_size_traits_t (or any other type like these two). |
Lock_Type | type of lock to be used for thread safety. It can be std::mutex or so_5::null_mutex_t (or any other type which can be used with std::lock_quard). |
Definition at line 1132 of file collecting_mbox.hpp.
|
private |
A configuration to be used for that mbox type.
Definition at line 1135 of file collecting_mbox.hpp.
using so_5::extra::mboxes::collecting_mbox::mbox_template_t< Collecting_Msg, Traits, Lock_Type >::messages_collected_t = typename details::messages_collected_t<config_type> |
Actual type of message_collected instance.
Definition at line 1139 of file collecting_mbox.hpp.
|
inlinestatic |
Create an instance of collecting mbox.
Please note that actual list of parameters depends on Traits type. If Traits is constexpr_size_traits_t then make
will have the following format:
If Traits is runtime_size_traits_t then make
will have the following format:
Definition at line 1159 of file collecting_mbox.hpp.