|
SObjectizer
5.8
|
A template with implementation of local mbox. More...
#include <local_mbox.hpp>
Public Member Functions | |
| template<typename... Tracing_Args> | |
| local_mbox_template (mbox_id_t id, environment_t &env, Tracing_Args &&... args) | |
| mbox_id_t | id () const override |
| Unique ID of this mbox. | |
| void | subscribe_event_handler (const std::type_index &type_wrapper, abstract_message_sink_t &subscriber) override |
| Add the message handler. | |
| void | unsubscribe_event_handler (const std::type_index &type_wrapper, abstract_message_sink_t &subscriber) noexcept override |
| Remove all message handlers. | |
| std::string | query_name () const override |
| Get the mbox name. | |
| mbox_type_t | type () const override |
| Get the type of message box. | |
| void | do_deliver_message (message_delivery_mode_t delivery_mode, const std::type_index &msg_type, const message_ref_t &message, unsigned int redirection_deep) override |
| Deliver message for all subscribers with respect to message limits. | |
| void | set_delivery_filter (const std::type_index &msg_type, const delivery_filter_t &filter, abstract_message_sink_t &subscriber) override |
| Set a delivery filter for message type and subscriber. | |
| void | drop_delivery_filter (const std::type_index &msg_type, abstract_message_sink_t &subscriber) noexcept override |
| Removes delivery filter for message type and subscriber. | |
| environment_t & | environment () const noexcept override |
| SObjectizer Environment for which the mbox is created. | |
Private Member Functions | |
| template<typename Info_Maker , typename Info_Changer > | |
| void | insert_or_modify_subscriber (const std::type_index &type_wrapper, abstract_message_sink_t &subscriber, Info_Maker maker, Info_Changer changer) |
| template<typename Info_Changer > | |
| void | modify_and_remove_subscriber_if_needed (const std::type_index &type_wrapper, abstract_message_sink_t &subscriber, Info_Changer changer) |
| void | do_deliver_message_impl (typename Tracing_Base::deliver_op_tracer const &tracer, message_delivery_mode_t delivery_mode, const std::type_index &msg_type, const message_ref_t &message, unsigned int redirection_deep) |
| void | do_deliver_message_to_subscriber (const local_mbox_details::subscription_info_with_sink_t &subscriber_info, typename Tracing_Base::deliver_op_tracer const &tracer, message_delivery_mode_t delivery_mode, const std::type_index &msg_type, const message_ref_t &message, unsigned int redirection_deep) const |
| void | ensure_immutable_message (const std::type_index &msg_type, const message_ref_t &what) const |
| Ensures that message is an immutable message. | |
Private Member Functions inherited from so_5::impl::local_mbox_details::data_t | |
| data_t (mbox_id_t id, environment_t &env) | |
Additional Inherited Members | |
Protected Member Functions inherited from so_5::atomic_refcounted_t | |
| atomic_refcounted_t (const atomic_refcounted_t &)=delete | |
| atomic_refcounted_t & | operator= (const atomic_refcounted_t &)=delete |
| atomic_refcounted_t () noexcept | |
| Default constructor. | |
| ~atomic_refcounted_t () noexcept=default | |
| Destructor. | |
| void | inc_ref_count () noexcept |
| Increments reference count. | |
| unsigned long | dec_ref_count () noexcept |
| Decrement reference count. | |
Private Types inherited from so_5::impl::local_mbox_details::data_t | |
| using | messages_table_t |
| Map from message type to subscribers. | |
Private Attributes inherited from so_5::impl::local_mbox_details::data_t | |
| const mbox_id_t | m_id |
| ID of this mbox. | |
| environment_t & | m_env |
| Environment for which the mbox is created. | |
| default_rw_spinlock_t | m_lock |
| Object lock. | |
| messages_table_t | m_subscribers |
| Map of subscribers to messages. | |
A template with implementation of local mbox.
| Tracing_Base | base class with implementation of message delivery tracing methods. |
Definition at line 643 of file local_mbox.hpp.
|
inline |
| id | ID of this mbox. |
| env | Environment for which the mbox is created. |
| args | Optional parameters for Tracing_Base's constructor. |
Definition at line 650 of file local_mbox.hpp.
|
inlineoverridevirtual |
Deliver message for all subscribers with respect to message limits.
A message delivery from timer thread is somewhat different from an ordinary message delivery. Especially in the case when target mbox is a message chain. If that message chain is full and some kind of overflow reaction is specified (like waiting for some time or throwing an exception) then it can lead to undesired behaviour of the whole application. To take care about these cases a new method is introduced.
| delivery_mode | Can the delivery blocks the current thread? |
| msg_type | Type of the message to deliver. |
| message | A message instance to be delivered. |
| redirection_deep | Current deep of overlimit reaction recursion. |
Implements so_5::abstract_message_box_t.
Definition at line 714 of file local_mbox.hpp.
|
inlineprivate |
Definition at line 847 of file local_mbox.hpp.
|
inlineprivate |
Definition at line 873 of file local_mbox.hpp.
|
inlineoverridevirtualnoexcept |
Removes delivery filter for message type and subscriber.
Implements so_5::abstract_message_box_t.
Definition at line 759 of file local_mbox.hpp.
|
inlineprivate |
Ensures that message is an immutable message.
Checks mutability flag and throws an exception if message is a mutable one.
Definition at line 913 of file local_mbox.hpp.
|
inlineoverridevirtualnoexcept |
SObjectizer Environment for which the mbox is created.
Implements so_5::abstract_message_box_t.
Definition at line 772 of file local_mbox.hpp.
|
inlineoverridevirtual |
Unique ID of this mbox.
Implements so_5::abstract_message_box_t.
Definition at line 662 of file local_mbox.hpp.
|
inlineprivate |
Definition at line 780 of file local_mbox.hpp.
|
inlineprivate |
Definition at line 817 of file local_mbox.hpp.
|
inlineoverridevirtual |
Get the mbox name.
Implements so_5::abstract_message_box_t.
Definition at line 699 of file local_mbox.hpp.
|
inlineoverridevirtual |
Set a delivery filter for message type and subscriber.
| msg_type | Message type to be filtered. |
| filter | Filter to be set. A caller must guaranted the validity of this reference. |
| subscriber | A subscriber for the message. |
Implements so_5::abstract_message_box_t.
Definition at line 740 of file local_mbox.hpp.
|
inlineoverridevirtual |
Add the message handler.
| type_index | Message type. |
| subscriber | Subscriber. |
Implements so_5::abstract_message_box_t.
Definition at line 668 of file local_mbox.hpp.
|
inlineoverridevirtual |
Get the type of message box.
Implements so_5::abstract_message_box_t.
Definition at line 708 of file local_mbox.hpp.
|
inlineoverridevirtualnoexcept |
Remove all message handlers.
| type_index | Message type. |
| subscriber | Subscriber. |
Implements so_5::abstract_message_box_t.
Definition at line 686 of file local_mbox.hpp.