|
SObjectizer 5.8
|
Mail box class. More...
#include <mbox.hpp>
Public Member Functions | |
| abstract_message_box_t ()=default | |
| virtual | ~abstract_message_box_t () noexcept=default |
| virtual mbox_id_t | id () const =0 |
| Unique ID of this mbox. | |
| virtual void | subscribe_event_handler (const std::type_index &type_index, abstract_message_sink_t &subscriber)=0 |
| Add the message handler. | |
| virtual void | unsubscribe_event_handler (const std::type_index &type_index, abstract_message_sink_t &subscriber) noexcept=0 |
| Remove all message handlers. | |
| virtual std::string | query_name () const =0 |
| Get the mbox name. | |
| virtual mbox_type_t | type () const =0 |
| Get the type of message box. | |
| virtual 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)=0 |
| Deliver message for all subscribers with respect to message limits. | |
| virtual so_5::environment_t & | environment () const noexcept=0 |
| SObjectizer Environment for which the mbox is created. | |
Methods for working with delivery filters. | |
| virtual void | set_delivery_filter (const std::type_index &msg_type, const delivery_filter_t &filter, abstract_message_sink_t &subscriber)=0 |
| Set a delivery filter for message type and subscriber. | |
| virtual void | drop_delivery_filter (const std::type_index &msg_type, abstract_message_sink_t &subscriber) noexcept=0 |
| Removes delivery filter for message type and subscriber. | |
Private Member Functions | |
| abstract_message_box_t (const abstract_message_box_t &)=delete | |
| abstract_message_box_t (abstract_message_box_t &&)=delete | |
| abstract_message_box_t & | operator= (const abstract_message_box_t &)=delete |
| abstract_message_box_t & | operator= (abstract_message_box_t &&)=delete |
Friends | |
| class | intrusive_ptr_t< abstract_message_box_t > |
| class | so_5::impl::mbox_iface_for_timers_t |
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. | |
Mail box class.
The class serves as an interface for sending and receiving messages.
All mboxes can be created via the SObjectizer Environment. References to mboxes are stored and manipulated by so_5::mbox_t objects.
|
privatedelete |
|
privatedelete |
|
default |
|
virtualdefaultnoexcept |
|
pure virtual |
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. |
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
pure virtualnoexcept |
Removes delivery filter for message type and subscriber.
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
nodiscardpure virtualnoexcept |
SObjectizer Environment for which the mbox is created.
Implemented in so_5::abstract_message_chain_t, so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
nodiscardpure virtual |
Unique ID of this mbox.
Implemented in so_5::abstract_message_chain_t, so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
privatedelete |
|
privatedelete |
|
nodiscardpure virtual |
Get the mbox name.
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
pure virtual |
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. |
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
pure virtual |
Add the message handler.
| type_index | Message type. |
| subscriber | Subscriber. |
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
nodiscardpure virtual |
Get the type of message box.
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
pure virtualnoexcept |
Remove all message handlers.
| type_index | Message type. |
| subscriber | Subscriber. |
Implemented in so_5::impl::local_mbox_template< Tracing_Base >, so_5::impl::mpsc_mbox_template_t< Tracing_Base, Limits_Handling_Mixin >, so_5::impl::named_local_mbox_t, so_5::mchain_props::mchain_template< Queue, Tracing_Base >, so_5::msg_tracing::impl::special_enveloping_mbox_t, so_5::stats::impl::st_env_stuff::next_turn_mbox_t, and so_5::unique_subscribers_mbox_impl::actual_mbox_t< Mutex, Tracing_Base >.
|
friend |
|
friend |