FREEDM DGI
Public Member Functions | Private Attributes | List of all members
freedm::broker::CPeerNode Class Reference

Base interface for agents/broker modules.

#include <CPeerNode.hpp>

Public Member Functions

 CPeerNode ()
 Construct a peer node. More...
 
 CPeerNode (std::string uuid)
 Construct a peer node. More...
 
std::string GetHostname () const
 Gets the hostname of this peer. More...
 
std::string GetPort () const
 Gets the port of this peer. More...
 
std::string GetUUID () const
 Gets the uuid of the node this addresses. More...
 
void Send (const ModuleMessage &msg)
 Sends a message to peer. More...
 

Private Attributes

std::string m_uuid
 

Constructor & Destructor Documentation

freedm::broker::CPeerNode::CPeerNode ( )
freedm::broker::CPeerNode::CPeerNode ( std::string  uuid)

CPeerNode::CPeerNode

Description:
Prepares a peer node. Provides node status and sending functions to the agent in a very clean manner.
Parameters
uuidThe uuid of the node

Member Function Documentation

std::string freedm::broker::CPeerNode::GetHostname ( ) const

CPeerNode::GetHostname

Description:
Returns the hostname of this peer node as a string
Returns
The hostname of the peer

An iterator to the end of the hostname map.

std::string freedm::broker::CPeerNode::GetPort ( ) const

CPeerNode::GetPort

Description:
Returns the port number this node communicates on
Returns
The port of the peer as string.
std::string freedm::broker::CPeerNode::GetUUID ( ) const

CPeerNode::GetUUID

Description:
Returns the uuid of this peer node as a string.
Returns
The uuid of the peer.
void freedm::broker::CPeerNode::Send ( const ModuleMessage &  msg)

CPeerNode::Send

Description:
This method will attempt to construct a connection to the peer this object represents and send a message. Before, when this was done with TCP, it was synchronous and would return when the message was sent now, we use UDP and it doesn't matter.
Precondition:
None
Postcondition:
A message is sent to the peer represented by this object
Parameters
msgthe message to write to channel.
Returns
True if the message was sent.

Member Data Documentation

std::string freedm::broker::CPeerNode::m_uuid
private

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