|
SObjectizer
5.8
|
An interface of message chain. More...
#include <mchain.hpp>
Public Member Functions | |
| virtual mchain_props::extraction_status_t | extract (mchain_props::demand_t &dest, mchain_props::duration_t empty_queue_timeout)=0 |
| so_5::mbox_t | as_mbox () |
| Cast message chain to message box. | |
| virtual bool | empty () const =0 |
| Is message chain empty? | |
| virtual std::size_t | size () const =0 |
| Count of messages in the chain. | |
| template<typename Exceptions_Control > | |
| void | close (Exceptions_Control, mchain_props::close_mode_t mode) noexcept(noexcept(details::should_terminate_if_throws_t< Exceptions_Control >::value)) |
| Close the chain. | |
| virtual mbox_id_t | id () const=0 |
| Unique ID of this mbox. | |
| virtual so_5::environment_t & | environment () const noexcept=0 |
| SObjectizer Environment for which the mbox is created. | |
Protected Member Functions | |
| abstract_message_chain_t ()=default | |
| ~abstract_message_chain_t () noexcept override=default | |
| virtual mchain_props::extraction_status_t | extract (mchain_props::demand_t &dest, mchain_props::select_case_t &select_case)=0 |
| An extraction attempt as a part of multi chain select. | |
| virtual mchain_props::push_status_t | push (const std::type_index &msg_type, const message_ref_t &message, mchain_props::select_case_t &select_case)=0 |
| An attempt to push a new message into the mchain. | |
| virtual void | remove_from_select (mchain_props::select_case_t &select_case) noexcept=0 |
| Removement of mchain from multi chain select. | |
| virtual void | actual_close (mchain_props::close_mode_t mode)=0 |
| Close the chain. | |
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 Member Functions | |
| abstract_message_chain_t (const abstract_message_chain_t &)=delete | |
| abstract_message_chain_t & | operator= (const abstract_message_chain_t &)=delete |
Friends | |
| class | intrusive_ptr_t< abstract_message_chain_t > |
| class | mchain_props::select_case_t |
|
privatedelete |
|
protecteddefault |
|
overrideprotecteddefaultnoexcept |
|
protectedpure virtual |
Close the chain.
| mode | What to do with chain's content. |
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
nodiscard |
Cast message chain to message box.
Definition at line 20 of file mchain.cpp.
|
inlinenoexcept |
Close the chain.
Since v.5.7.3 this is the recommended way of closing a mchain. This method allows to specify how exceptions have to be treated:
This method was introduced because 'close' operation can throw but it's not obvious enough. Because 'close' can throw additional care has to be taken when 'close' is initiated in noexcept-contexts (like destructor and, often, in catch-blocks). This new method allows expressing intentions more clearly. For example:
| mode | What to do with chain's content. |
Definition at line 557 of file mchain.hpp.
|
nodiscardpure virtual |
Is message chain empty?
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
nodiscardvirtualnoexcept |
SObjectizer Environment for which the mbox is created.
Implements so_5::abstract_message_box_t.
Reimplemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
nodiscardpure virtual |
| dest | Destination for extracted messages. |
| empty_queue_timeout | Max time to wait on empty queue. |
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
nodiscardprotectedpure virtual |
An extraction attempt as a part of multi chain select.
| dest | Destination for extracted messages. |
| select_case | Select case to be stored for notification if mchain is empty. |
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
nodiscardvirtual |
Unique ID of this mbox.
Implements so_5::abstract_message_box_t.
Reimplemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
privatedelete |
|
nodiscardprotectedpure virtual |
An attempt to push a new message into the mchain.
Unlike do_deliver_message() method the push() doesn't apply the overload reaction if the mchain if full. The select_case is stored to select_cases list instead.
| msg_type | Type of message/signal to be pushed. |
| message | Message/signal to be pushed. |
| select_case | Select case to be stored for notification if mchain is full. |
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
protectedpure virtualnoexcept |
Removement of mchain from multi chain select.
| select_case | Select case to be removed from notification queue. |
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
nodiscardpure virtual |
Count of messages in the chain.
Implemented in so_5::mchain_props::mchain_template< Queue, Tracing_Base >.
|
friend |
Definition at line 356 of file mchain.hpp.
|
friend |
Definition at line 461 of file mchain.hpp.