Abstract base class for Endpoint implementations. More...
#include <Endpoint.h>
Public Member Functions | |
virtual const std::string & | GetUUID ()=0 |
Get the UUID of the local node. More... | |
virtual const Node * | NodeForUUID (const std::string &uuid)=0 |
Retreive a node by its UUID. More... | |
virtual void | Send (data::Message *message, const Node *node)=0 |
Send a message to a specific member of the swarm. Call with node set to nullptr to send a message to all members of the swarm. More... | |
virtual void | Start ()=0 |
Start a background thread and begin processing messages on this endpoint. More... | |
virtual void | Stop ()=0 |
Send a termination signal and wait until the endpoint finished processing messages. More... | |
virtual void | Tag (data::Message *message)=0 |
Set the message identifier for a message. More... | |
virtual | ~Endpoint () |
Destroy the Endpoint object. More... | |
Protected Member Functions | |
virtual void | RegisterMailbox (Mailbox *mailbox)=0 |
Register a Mailbox to receive messages. More... | |
virtual void | ReplaceMailbox (Mailbox *oldMailbox, Mailbox *newMailbox)=0 |
Relocate a mailbox to another in-memory location. More... | |
virtual void | UnregisterMailbox (Mailbox *mailbox)=0 |
Unregister a Mailbox from receiving messages. More... | |
Protected Attributes | |
friend | Mailbox |
Allow Mailboxes to register themselves. More... | |
Abstract base class for Endpoint implementations.
When an Endpoint is created and started, it announces itself to all members of the swarm and start sending and receiving messages. Different implementations might provide different services for discovery, authentication, authorization and encryption.
Definition at line 25 of file Endpoint.h.
|
inlinevirtual |
Destroy the Endpoint object.
Definition at line 123 of file Endpoint.h.
|
pure virtual |
Get the UUID of the local node.
Implemented in swarmio::transport::zyre::ZyreEndpoint.
|
pure virtual |
Retreive a node by its UUID.
uuid | UUID |
Implemented in swarmio::transport::zyre::ZyreEndpoint.
|
protectedpure virtual |
Register a Mailbox to receive messages.
Each registered Mailbox receives each message sent to the endpoint, and can choose to handle it or ignore it.
Thread-safe. Messages will be delivered on a separate thread.
mailbox | Mailbox to register. |
Implemented in swarmio::transport::BasicEndpoint.
|
protectedpure virtual |
Relocate a mailbox to another in-memory location.
Supports thread-safe move operations on Mailboxes.
mailbox | Mailbox to register. |
Implemented in swarmio::transport::BasicEndpoint.
|
pure virtual |
Send a message to a specific member of the swarm. Call with node set to nullptr to send a message to all members of the swarm.
Thread-safe.
message | Message |
node | Node the message will be sent to |
Implemented in swarmio::transport::BasicEndpoint.
|
pure virtual |
Start a background thread and begin processing messages on this endpoint.
Implemented in swarmio::transport::zyre::ZyreEndpoint, and swarmio::transport::BasicEndpoint.
|
pure virtual |
Send a termination signal and wait until the endpoint finished processing messages.
Thread-safe.
Implemented in swarmio::transport::zyre::ZyreEndpoint, and swarmio::transport::BasicEndpoint.
|
pure virtual |
Set the message identifier for a message.
Thread safe.
message | Message |
Implemented in swarmio::transport::BasicEndpoint.
|
protectedpure virtual |
Unregister a Mailbox from receiving messages.
Thread-safe.
mailbox | Mailbox to unregister. |
Implemented in swarmio::transport::BasicEndpoint.
|
protected |
Allow Mailboxes to register themselves.
Definition at line 33 of file Endpoint.h.