Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
swarmio::Endpoint Class Referenceabstract

Abstract base class for Endpoint implementations. More...

#include <Endpoint.h>

Inheritance diagram for swarmio::Endpoint:
Inheritance graph
[legend]

Public Member Functions

virtual const std::string & GetUUID ()=0
 Get the UUID of the local node. More...
 
virtual const NodeNodeForUUID (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

virtual swarmio::Endpoint::~Endpoint ( )
inlinevirtual

Destroy the Endpoint object.

Definition at line 123 of file Endpoint.h.

Member Function Documentation

virtual const std::string& swarmio::Endpoint::GetUUID ( )
pure virtual

Get the UUID of the local node.

Returns
const std::string&

Implemented in swarmio::transport::zyre::ZyreEndpoint.

virtual const Node* swarmio::Endpoint::NodeForUUID ( const std::string &  uuid)
pure virtual

Retreive a node by its UUID.

Parameters
uuidUUID
Returns
const Node*

Implemented in swarmio::transport::zyre::ZyreEndpoint.

virtual void swarmio::Endpoint::RegisterMailbox ( Mailbox mailbox)
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.

Parameters
mailboxMailbox to register.

Implemented in swarmio::transport::BasicEndpoint.

virtual void swarmio::Endpoint::ReplaceMailbox ( Mailbox oldMailbox,
Mailbox newMailbox 
)
protectedpure virtual

Relocate a mailbox to another in-memory location.

Supports thread-safe move operations on Mailboxes.

Parameters
mailboxMailbox to register.

Implemented in swarmio::transport::BasicEndpoint.

virtual void swarmio::Endpoint::Send ( data::Message *  message,
const Node node 
)
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.

Parameters
messageMessage
nodeNode the message will be sent to

Implemented in swarmio::transport::BasicEndpoint.

virtual void swarmio::Endpoint::Start ( )
pure virtual

Start a background thread and begin processing messages on this endpoint.

Implemented in swarmio::transport::zyre::ZyreEndpoint, and swarmio::transport::BasicEndpoint.

virtual void swarmio::Endpoint::Stop ( )
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.

virtual void swarmio::Endpoint::Tag ( data::Message *  message)
pure virtual

Set the message identifier for a message.

Thread safe.

Parameters
messageMessage

Implemented in swarmio::transport::BasicEndpoint.

virtual void swarmio::Endpoint::UnregisterMailbox ( Mailbox mailbox)
protectedpure virtual

Unregister a Mailbox from receiving messages.

Thread-safe.

Parameters
mailboxMailbox to unregister.

Implemented in swarmio::transport::BasicEndpoint.

Member Data Documentation

friend swarmio::Endpoint::Mailbox
protected

Allow Mailboxes to register themselves.

Definition at line 33 of file Endpoint.h.


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


swarmros
Author(s):
autogenerated on Fri Apr 3 2020 03:42:48