C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::abstract_mailbox Class Referenceabstract

The base class for all mailbox implementations. More...

#include <abstract_mailbox.hpp>

Inheritance diagram for caf::abstract_mailbox:
caf::detail::default_mailbox

Public Member Functions

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.
 

Detailed Description

The base class for all mailbox implementations.

Member Function Documentation

◆ blocked()

virtual bool caf::abstract_mailbox::blocked ( ) const
pure virtualnoexcept

Checks whether the owner of this mailbox is currently waiting for new messages.

Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ close()

virtual size_t caf::abstract_mailbox::close ( const error & reason)
pure virtual

Closes the mailbox and discards all pending messages.

Returns
The number of dropped messages.
Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ closed()

virtual bool caf::abstract_mailbox::closed ( ) const
pure virtualnoexcept

Checks whether the mailbox has been closed.

Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ deref_mailbox()

virtual void caf::abstract_mailbox::deref_mailbox ( )
pure virtualnoexcept

Decreases the reference count by one and deletes this instance if the reference count drops to zero.

Implemented in caf::detail::default_mailbox.

◆ pop_front()

virtual mailbox_element_ptr caf::abstract_mailbox::pop_front ( )
pure virtual

Removes the next element from the mailbox.

Returns
The next element in the mailbox or nullptr if the mailbox is empty.
Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ push_back()

virtual intrusive::inbox_result caf::abstract_mailbox::push_back ( mailbox_element_ptr ptr)
pure virtual

Adds a new element to the mailbox.

Returns
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

Implemented in caf::detail::default_mailbox.

◆ push_front()

virtual void caf::abstract_mailbox::push_front ( mailbox_element_ptr ptr)
pure virtual

Adds a new element to the mailbox by putting it in front of the queue.

Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ ref_mailbox()

virtual void caf::abstract_mailbox::ref_mailbox ( )
pure virtualnoexcept

Increases the reference count by one.

Implemented in caf::detail::default_mailbox.

◆ size()

virtual size_t caf::abstract_mailbox::size ( )
pure virtual

Returns the number of pending messages.

Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ try_block()

virtual bool caf::abstract_mailbox::try_block ( )
pure virtual

Tries to put the mailbox in a blocked state.

Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.

◆ try_unblock()

virtual bool caf::abstract_mailbox::try_unblock ( )
pure virtual

Tries to put the mailbox in an empty state from a blocked state.

Note
Only the owning actor is allowed to call this function.

Implemented in caf::detail::default_mailbox.


The documentation for this class was generated from the following files: