NodeResponse Class Reference
[Fountain master and slave nodesMessage Building and Parsing]

Used for response messages sent from a Fountain node. More...

#include <NodeMessage.h>

Inheritance diagram for NodeResponse:

NodeMessage FountainMessage BambooLib::BuildMsg List of all members.

Public Member Functions

bool appendToNodeList (ConstParseMsgPtr msg)
 Appends a NodeList element from the msg parameter to this message's NodeList parameter.

Static Public Member Functions

static NodeResponsePtr buildError (MessageAction a, const NodeID &src, const NodeID &dest, FountainErrorCode code, const std::string &errorMessage)
 Create an error NodeResponse message.
static NodeResponsePtr buildJoin (const NodeID &src, const NodeID &dest)
 build a trace response message
static NodeResponsePtr buildTrace (const NodeID &src, const NodeID &dest)
 build a trace response message
static NodeResponsePtr buildBomb (const NodeID &src, const NodeID &dest, ConstParseMsgPtr parentMessage)
 Create a bomb response message.
static NodeResponsePtr buildAdmin (const NodeID &src, const NodeID &dest, ConstParseMsgPtr parentMessage)
 Create an admin response message.
static NodeResponsePtr buildQuery (const NodeID &src, const NodeID &dest, NodeMonitorBase::NodeMonitorPtr nodeInfo)
 Create a query response message.
static NodeResponsePtr buildPingPong (const NodeID &src, const NodeID &dest, std::vector< double > avgPingPongTimes, std::vector< double > maxPingPongTimes, std::vector< double > minPingPongTimes, std::vector< std::string > children)
 Build a pingPong response message.
static NodeResponsePtr buildJoinAsServer (const NodeID &src, const NodeID &dest)
 build a joinAsServer response message
static NodeResponsePtr buildPulse (const NodeID &src, const NodeID &dest)
 build a pulse response message
static NodeResponsePtr buildNewParent (const NodeID &src, const NodeID &dest)
 build a newParent response message
static NodeResponsePtr buildSync (const NodeID &src, const NodeID &dest)
 Create a sync response message.
static NodeResponsePtr buildWakeup (const NodeID &src, const NodeID &dest)
 Create a wakeup response message.
static NodeResponsePtr buildLostParent (const NodeID &src, const NodeID &dest, const NodeID &parentID)
 Create a lostParent response message.
static NodeResponsePtr buildLostChild (const NodeID &src, const NodeID &dest)
 Create a lostChild response message.

Protected Member Functions

 NodeResponse (MessageAction a, const NodeID &src, const NodeID &dest)
 Default constructor.

Detailed Description

Used for response messages sent from a Fountain node.


Member Function Documentation

bool NodeResponse::appendToNodeList ConstParseMsgPtr  msg  ) 
 

Appends a NodeList element from the msg parameter to this message's NodeList parameter.

Return values:
true if the NodeList was appended successfully, false otherwise param[in] msg - A message containing a NodeList element as a child of the Data element
Precondition:
Assigned(msg)

NodeResponsePtr NodeResponse::buildAdmin const NodeID src,
const NodeID dest,
ConstParseMsgPtr  parentMessage
[static]
 

Create an admin response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
[in] parentMessage The admin message from our parent node
Precondition:
parentMessage is not NULL

NodeResponsePtr NodeResponse::buildBomb const NodeID src,
const NodeID dest,
ConstParseMsgPtr  parentMessage
[static]
 

Create a bomb response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
[in] parentMessage The bomb message from our parent node
Precondition:
parentMessage is not NULL

NodeResponsePtr NodeResponse::buildError MessageAction  a,
const NodeID src,
const NodeID dest,
FountainErrorCode  code,
const std::string &  errorMessage
[static]
 

Create an error NodeResponse message.

Parameters:
[in] a The MessageAction
[in] src The origin of this message
[in] dest The destination of this message
[in] code The FountainErrorCode to use for the status element
[in] errorMessage The message to use for the status element
Return values:
NodeResponsePtr A pointer to the NodeResponse object

NodeResponsePtr NodeResponse::buildJoin const NodeID src,
const NodeID dest
[static]
 

build a trace response message

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
Return values:
NodeRequestPtr A pointer to the NodeRequest object

NodeResponsePtr NodeResponse::buildJoinAsServer const NodeID src,
const NodeID dest
[static]
 

build a joinAsServer response message

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
Return values:
NodeResponsePtr A pointer to the NodeRequest object

NodeResponsePtr NodeResponse::buildLostChild const NodeID src,
const NodeID dest
[static]
 

Create a lostChild response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message

NodeResponsePtr NodeResponse::buildLostParent const NodeID src,
const NodeID dest,
const NodeID parentID
[static]
 

Create a lostParent response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
[in] parentID The NodeID of the new parent node

NodeResponsePtr NodeResponse::buildNewParent const NodeID src,
const NodeID dest
[static]
 

build a newParent response message

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
Return values:
NodeResponsePtr A pointer to the NodeRequest object

NodeResponsePtr NodeResponse::buildPingPong const NodeID src,
const NodeID dest,
std::vector< double >  avgPingPongTimes,
std::vector< double >  maxPingPongTimes,
std::vector< double >  minPingPongTimes,
std::vector< std::string >  children
[static]
 

Build a pingPong response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
[in] avgPingPongTimes A vector with a length equal to the number of child nodes containing the average time it takes to send n number of pingPong messages to each child
[in] maxPingPongTimes A vector with a length equal to the number of child nodes containing the maximum time it takes to send n number of pingPong messages to each child
[in] minPingPongTimes A vector with a length equal to the number of child nodes containing the minimum time it takes to send n number of pingPong messages to each child
[in] children A vector of strings representing a Fountain node's child nodes
Return values:
NodeResponsePtr A pointer to the NodeRequest object

NodeResponsePtr NodeResponse::buildPulse const NodeID src,
const NodeID dest
[static]
 

build a pulse response message

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
Return values:
NodeResponsePtr A pointer to the NodeRequest object

NodeResponsePtr NodeResponse::buildQuery const NodeID src,
const NodeID dest,
NodeMonitorBase::NodeMonitorPtr  nodeInfo
[static]
 

Create a query response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
[in] nodeInfo A pointer to the NodeMonitor object from a Fountain node
Precondition:
Assigned(nodeInfo)

NodeResponsePtr NodeResponse::buildSync const NodeID src,
const NodeID dest
[static]
 

Create a sync response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message

NodeResponsePtr NodeResponse::buildTrace const NodeID src,
const NodeID dest
[static]
 

build a trace response message

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
Return values:
NodeRequestPtr A pointer to the NodeRequest object

NodeResponsePtr NodeResponse::buildWakeup const NodeID src,
const NodeID dest
[static]
 

Create a wakeup response message.

Parameters:
[in] src The origin of this message
[in] dest The destination of this message
Return values:
NodeResponsePtr A pointer to the NodeRequest object


The documentation for this class was generated from the following files:
Generated on Wed Mar 8 14:43:33 2006 for Fountain by  doxygen 1.4.6