49 void ReplyWithError(
const Node* sender,
const data::Message*
message, data::Error error);
68 virtual void Send(
const void* data,
size_t size,
const Node* node) = 0;
77 virtual bool ReceiveMessage(
const Node* sender,
const data::Message*
message) noexcept;
87 virtual bool ReceiveMessage(
const Node* sender,
const void* data,
size_t size) noexcept;
94 virtual void NodeWasDiscovered(
const Node* node) noexcept;
101 virtual void NodeDidJoin(
const Node* node) noexcept;
108 virtual void NodeWillLeave(
const Node* node) noexcept;
118 virtual void RegisterMailbox(
Mailbox* mailbox)
override;
128 virtual void UnregisterMailbox(
Mailbox* mailbox)
override;
137 virtual void ReplaceMailbox(
Mailbox* oldMailbox,
Mailbox* newMailbox)
override;
146 virtual void Start()
override;
155 virtual void Stop()
override;
177 virtual void Send(data::Message* message,
const Node* node)
override;
186 virtual void Tag(data::Message* message)
override;
std::set< Mailbox * > _mailboxes
Container for registered mailboxes.
BasicEndpoint()
Protected constructor.
std::recursive_mutex _mutex
Mutex used to synchronize access to the list of mailboxes.
bool IsRunning()
Checks whether the endpoint has been started.
std::atomic< uint64_t > _counter
Atomic counter for message identifiers.
Abstract base class for Endpoint implementations.
bool _isRunning
True if the Mailbox has been started.
An helper class for Endpoint implementations which implements some common basic functionality.
Represents a Node the Endpoint knows about and can send messages to.
Abstract base class for Mailbox implementations.