MakerLabs ACM
ActorModel::Mailbox Class Reference

#include <mailbox.h>

Public Types

using string = std::string
 
using string_view = std::experimental::string_view
 
using ReceivedMessagePtr = std::unique_ptr< ReceivedMessage >
 
using Address = UUID::UUID
 
using AddressRegistry = std::unordered_map< Address, Mailbox *, UUID::UUIDHashFunc, UUID::UUIDEqualFunc >
 

Public Member Functions

 Mailbox (const size_t _mailbox_size=2048, const size_t _send_timeout_microseconds=0, const size_t _receive_timeout_microseconds=0, const size_t _receive_lock_timeout_microseconds=0)
 
 ~Mailbox ()
 
auto send (const Message &message) -> bool
 
auto send (const string_view type, const string_view payload, const size_t payload_alignment=sizeof(uint64_t), const Pid *from_pid=nullptr) -> bool
 
auto receive (bool verify=false) -> ReceivedMessagePtr
 

Static Public Member Functions

static auto create_message (const string_view type, const string_view payload, const size_t payload_alignment=sizeof(uint64_t), const Pid *from_pid=nullptr) -> flatbuffers::DetachedBuffer
 

Public Attributes

const Address address
 

Protected Member Functions

auto release (const string_view message) -> bool
 

Friends

class ReceivedMessage
 

Member Typedef Documentation

◆ Address

using ActorModel::Mailbox::Address = UUID::UUID

◆ AddressRegistry

◆ ReceivedMessagePtr

◆ string

using ActorModel::Mailbox::string = std::string

◆ string_view

using ActorModel::Mailbox::string_view = std::experimental::string_view

Constructor & Destructor Documentation

◆ Mailbox()

ActorModel::Mailbox::Mailbox ( const size_t  _mailbox_size = 2048,
const size_t  _send_timeout_microseconds = 0,
const size_t  _receive_timeout_microseconds = 0,
const size_t  _receive_lock_timeout_microseconds = 0 
)
explicit

◆ ~Mailbox()

ActorModel::Mailbox::~Mailbox ( )
Here is the call graph for this function:

Member Function Documentation

◆ create_message()

auto ActorModel::Mailbox::create_message ( const string_view  type,
const string_view  payload,
const size_t  payload_alignment = sizeof(uint64_t),
const Pid *  from_pid = nullptr 
) -> flatbuffers::DetachedBuffer
static

◆ receive()

auto ActorModel::Mailbox::receive ( bool  verify = false) -> ReceivedMessagePtr
Here is the call graph for this function:

◆ release()

auto ActorModel::Mailbox::release ( const string_view  message) -> bool
protected

◆ send() [1/2]

auto ActorModel::Mailbox::send ( const Message &  message) -> bool
Here is the call graph for this function:

◆ send() [2/2]

auto ActorModel::Mailbox::send ( const string_view  type,
const string_view  payload,
const size_t  payload_alignment = sizeof(uint64_t),
const Pid *  from_pid = nullptr 
) -> bool

Friends And Related Function Documentation

◆ ReceivedMessage

friend class ReceivedMessage
friend

Member Data Documentation

◆ address

const Address ActorModel::Mailbox::address

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