|
C++ Actor Framework 0.19
|
Our default mailbox implementation. More...
#include <default_mailbox.hpp>
Public Member Functions | |
| default_mailbox (const default_mailbox &)=delete | |
| default_mailbox & | operator= (const default_mailbox &)=delete |
| mailbox_element * | peek (message_id id) override |
| intrusive::inbox_result | push_back (mailbox_element_ptr ptr) override |
| Adds a new element to the mailbox. | |
| void | push_front (mailbox_element_ptr ptr) override |
| Adds a new element to the mailbox by putting it in front of the queue. | |
| mailbox_element_ptr | pop_front () override |
| Removes the next element from the mailbox. | |
| bool | closed () const noexcept override |
| Checks whether the mailbox has been closed. | |
| bool | blocked () const noexcept override |
| Checks whether the owner of this mailbox is currently waiting for new messages. | |
| bool | try_block () override |
| Tries to put the mailbox in a blocked state. | |
| bool | try_unblock () override |
| Tries to put the mailbox in an empty state from a blocked state. | |
| size_t | close (const error &) override |
| Closes the mailbox and discards all pending messages. | |
| size_t | size () override |
| Returns the number of pending messages. | |
| void | ref_mailbox () noexcept override |
| Increases the reference count by one. | |
| void | deref_mailbox () noexcept override |
| Decreases the reference count by one and deletes this instance if the reference count drops to zero. | |
| size_t | ref_count () const noexcept |
Public Member Functions inherited from caf::abstract_mailbox | |
| virtual intrusive::inbox_result | push_back (mailbox_element_ptr ptr)=0 |
| Adds a new element to the mailbox. | |
| virtual void | push_front (mailbox_element_ptr ptr)=0 |
| Adds a new element to the mailbox by putting it in front of the queue. | |
| virtual mailbox_element_ptr | pop_front ()=0 |
| Removes the next element from the mailbox. | |
| virtual bool | closed () const noexcept=0 |
| Checks whether the mailbox has been closed. | |
| virtual bool | blocked () const noexcept=0 |
| Checks whether the owner of this mailbox is currently waiting for new messages. | |
| virtual bool | try_block ()=0 |
| Tries to put the mailbox in a blocked state. | |
| virtual bool | try_unblock ()=0 |
| Tries to put the mailbox in an empty state from a blocked state. | |
| virtual size_t | close (const error &reason)=0 |
| Closes the mailbox and discards all pending messages. | |
| virtual size_t | size ()=0 |
| Returns the number of pending messages. | |
| virtual void | ref_mailbox () noexcept=0 |
| Increases the reference count by one. | |
| virtual void | deref_mailbox () noexcept=0 |
| Decreases the reference count by one and deletes this instance if the reference count drops to zero. | |
| bool | empty () |
| Checks whether the mailbox is empty. | |
Our default mailbox implementation.
Uses a LIFO inbox for storing incoming messages and combines it with two FIFO caches for storing urgent and normal messages.
|
overridevirtualnoexcept |
Checks whether the owner of this mailbox is currently waiting for new messages.
Implements caf::abstract_mailbox.
|
overridevirtual |
Closes the mailbox and discards all pending messages.
Implements caf::abstract_mailbox.
|
overridevirtualnoexcept |
Checks whether the mailbox has been closed.
Implements caf::abstract_mailbox.
|
overridevirtualnoexcept |
Decreases the reference count by one and deletes this instance if the reference count drops to zero.
Implements caf::abstract_mailbox.
|
overridevirtual |
Implements caf::abstract_mailbox.
|
overridevirtual |
Removes the next element from the mailbox.
nullptr if the mailbox is empty. Implements caf::abstract_mailbox.
|
overridevirtual |
Adds a new element to the mailbox.
inbox_result::success if the element has been added to the mailbox, inbox_result::unblocked_reader if the reader has been unblocked, or inbox_result::queue_closed if the mailbox has been closed. @threadsafe Implements caf::abstract_mailbox.
|
overridevirtual |
Adds a new element to the mailbox by putting it in front of the queue.
Implements caf::abstract_mailbox.
|
overridevirtualnoexcept |
Increases the reference count by one.
Implements caf::abstract_mailbox.
|
overridevirtual |
Returns the number of pending messages.
Implements caf::abstract_mailbox.
|
overridevirtual |
Tries to put the mailbox in a blocked state.
Implements caf::abstract_mailbox.
|
overridevirtual |
Tries to put the mailbox in an empty state from a blocked state.
Implements caf::abstract_mailbox.