5 #include <swarmio/data/Message.pb.h> 30 : _endpoint(nullptr) { }
48 if (_endpoint !=
nullptr)
61 _endpoint = other.GetEndpoint();
72 if (_endpoint !=
nullptr)
155 if (_endpoint !=
nullptr)
void FinishMovingTo(Mailbox *other)
Called when message handling should be passed onto the new instance.
virtual void RegisterMailbox(Mailbox *mailbox)=0
Register a Mailbox to receive messages.
virtual ~Mailbox()
Destroy the Mailbox object.
Endpoint * _endpoint
Associated endpoint.
virtual void ReplaceMailbox(Mailbox *oldMailbox, Mailbox *newMailbox)=0
Relocate a mailbox to another in-memory location.
virtual void NodeWasDiscovered(const Node *node) noexcept
Called when a new Node has been discovered.
virtual void NodeDidJoin(const Node *node) noexcept
Called when a new Node has joined the group.
void FinishConstruction()
Called when the last constructor has finished its job.
virtual void MailboxWillBeDisconnected() noexcept
Called right before the mailbox is disconnected from its endpoint or if the attached endpoint is abou...
virtual void MailboxWasConnected() noexcept
Called when the mailbox is attached to an already running endpoint or if the attached endpoint has ju...
virtual void UnregisterMailbox(Mailbox *mailbox)=0
Unregister a Mailbox from receiving messages.
virtual bool ReceiveMessage(const Node *sender, const data::Message *message)
Delivery point of all messages.
Abstract base class for Endpoint implementations.
Mailbox()
Construct a disconnected Mailbox.
Endpoint * GetEndpoint()
Get the associated Endpoint.
Mailbox(Mailbox &&other)
Move a Mailbox object.
Mailbox(Endpoint *endpoint)
Construct a new Mailbox object.
virtual void NodeWillLeave(const Node *node) noexcept
Called when a Node signals that it will leave.
Represents a Node the Endpoint knows about and can send messages to.
virtual void Disconnect()
Disconnect this Mailbox from the Endpoint.
Abstract base class for Mailbox implementations.