CVS diff for FountainMessage.h between 1.47 and 1.42:

Revision 1.42 Revision 1.47
Line 14 Line 14
#include "define.h" 
#include "NodeInfo.h" 
#include "FountainErrors.h" 
#include "define.h" 
#include "NodeInfo.h" 
#include "FountainErrors.h" 
   
#include "NodeID.h"
 

                         
//forward class declarations 
class FountainParseMessage; 
 
//forward class declarations 
class FountainParseMessage; 
 
Line 41 Line 42
		enum MessageAction { 
invalidAction=0, 
join, 
		enum MessageAction { 
invalidAction=0, 
join, 
			joinAccept,
			joinReject,
			joinAck, 
 
			newParent, 
syncMsg,
			newParent, 
syncMsg,
			rebuildMsg, 
 
			pulseMsg, 
admin, 
pingPong, 
			pulseMsg, 
admin, 
pingPong, 
Line 108 Line 105
class ClientRequest : public FountainMessage { 
public: 
ClientRequest(MessageAction a, SSS_Object_type o); 
class ClientRequest : public FountainMessage { 
public: 
ClientRequest(MessageAction a, SSS_Object_type o); 
        void buildPingPong(const string& numPingPongs); 
        void buildPingPong(const string& numPingPongs, bool useXML); 
		void buildBomb(const string& bombString); 
}; 
 
		void buildBomb(const string& bombString); 
}; 
 
Line 124 Line 121
		//! @param a the MessageAction 
ServerMessage(MessageType t, MessageAction a); 
 
		//! @param a the MessageAction 
ServerMessage(MessageType t, MessageAction a); 
 
		//! Builds a pingPong response message for a client or a pingPong request for the Fountain nodes
		//! @param nodeMessage The pingPong response message from the master Fountain node
        int buildPingPong(const ParseMsg* nodeMessage);
		 
 
		//! \brief virtual dtor so ServerMessage objects cannot be instantiated directly 
virtual ~ServerMessage() = 0; 
}; 
		//! \brief virtual dtor so ServerMessage objects cannot be instantiated directly 
virtual ~ServerMessage() = 0; 
}; 
Line 142 Line 135
		//! \brief Default constructor 
ServerRequest(MessageAction a, const string& src = string("NO SOURCE ID"), const string& dest = string("NO DESTINATION ID")); 
 
		//! \brief Default constructor 
ServerRequest(MessageAction a, const string& src = string("NO SOURCE ID"), const string& dest = string("NO DESTINATION ID")); 
 
		//! Builds a bomb request message
		//! @param clientMessage The bomb request message from client
        void buildBomb(const ParseMsg* clientMessage); 
		//! Builds a pingPong response message for a client or a pingPong request for the Fountain nodes
		//! @param clientRequest The pingPong request message from the client
		//! \throw FountainException if the message could not be created
 
        void buildPingPong(const ParseMsg* clientRequest) throw(FountainException);
		
		//! Builds a bomb response message for a client or a bomb request for the Fountain nodes
		//! @param clientRequest The bomb request message from client
		//! \throw FountainException if the message could not be created
        void buildBomb(const ParseMsg* clientRequest) throw(FountainException);
}; 
 
//! \class ServerResponse 
}; 
 
//! \class ServerResponse 
Line 156 Line 155
	 
//! \brief Builds a trace response message for a client or a trace request for the Fountain nodes 
//! @param nodeResponse The trace response message from the master Fountain node 
	 
//! \brief Builds a trace response message for a client or a trace request for the Fountain nodes 
//! @param nodeResponse The trace response message from the master Fountain node 
		int buildTrace(const FountainParseMessage* nodeResponse); 
		//! \throw FountainException if the message could not be created
 
		void buildTrace(const FountainParseMessage* nodeResponse) throw(FountainException);
		 
//! Builds a bomb response message for a client or a bomb request for the Fountain nodes
		 
//! Builds a bomb response message for a client or a bomb request for the Fountain nodes
		//! @param nodeMessage The bomb response message from the master Fountain node
        int buildBomb(const FountainParseMessage* nodeMessage); 
		//! @param nodeResponse The bomb response message from the master Fountain node
		//! \throw FountainException if the message could not be created
 
        void buildBomb(const FountainParseMessage* nodeResponse) throw(FountainException);
		
		//! Builds a pingPong response message for a client or a pingPong request for the Fountain nodes
		//! @param nodeResponse The pingPong response message from the master Fountain node
		//! \throw FountainException if the message could not be created
        void buildPingPong(const FountainParseMessage* nodeResponse) throw(FountainException);
	 
}; 
 
	 
}; 
 
Line 170 Line 176
    protected: 
std::string sourceID; 
std::string destinationID; 
    protected: 
std::string sourceID; 
std::string destinationID; 
		//! \todo why do we need these as protected members?
        XMLElement* sourceElement;
        XMLElement* destinationElement;
        XMLElement* serverElement; 
 
		XMLElement* nodeListElement; 
public: 
//! Constructor 
		XMLElement* nodeListElement; 
public: 
//! Constructor 
Line 181 Line 183
		//! @param a The MessageAction enum for this message 
//! @param src The NodeID of the Fountain node creating this message 
//! @param dest The NodeID of the Fountain node this message is destined to 
		//! @param a The MessageAction enum for this message 
//! @param src The NodeID of the Fountain node creating this message 
//! @param dest The NodeID of the Fountain node this message is destined to 
        NodeMessage(MessageType t, MessageAction a, const std::string& src, const std::string& dest) throw(FountainException); 
		NodeMessage(MessageType t, MessageAction a, const NodeID& src, const NodeID& dest) throw(FountainException); 
		 
//! \brief virtual dtor so clients cannot instantiate NodeMessage objects 
virtual ~NodeMessage() = 0;
		 
//! \brief virtual dtor so clients cannot instantiate NodeMessage objects 
virtual ~NodeMessage() = 0;
		
		//! @param 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
		//! @param 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
		//! @param 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
		//! @param children A vector of strings representing a Fountain node's child nodes
		//! @return SUCCESS if building the message was successful
		//! @return FAILURE if building the message was unsuccessful
        void buildPingPong(std::vector<double> avgPingPongTimes, std::vector<double> maxPingPongTimes, std::vector<double> minPingPongTimes, std::vector<std::string> children) throw(FountainException);
		
		//! @param versionNumberString The version number of a Fountain Node
		//! @return SUCCESS if building the message was successful
		//! @return FAILURE if building the message was unsuccessful
        void buildJoin(const std::string& versionNumberString) throw(FountainException);
				
		//! @param nodeInfo The NodeInfo object from a Fountain node
		//! @return SUCCESS if building the message was successful
		//! @return FAILURE if building the message was unsuccessful
        void buildQuery(NodeInfo& nodeInfo) throw(FountainException);
		
		//! @param parentID The parentID of the Fountain node accepting the join request
		//! @return SUCCESS if building the message was successful
		//! @return FAILURE if building the message was unsuccessful
        int buildJoinAccept(const std::string& parentID=std::string(""));
		
		//! Appends a NodeList element from the msg parameter to this message's NodeList parameter
		//! @return true if the NodeList was appended successfully
		//! @return false if the NodeList element was not found in the msg parameter, or if the NodeList element for this message has not been created yet.
		//! param msg - A message containing a NodeList element as a child of the Data element
		bool appendToNodeList(const FountainParseMessage* msg);
 
 
}; 
 
//! \class NodeRequest 
//! \brief Used for request messages sent from a Fountain node 
class NodeRequest : public NodeMessage { 
public:
}; 
 
//! \class NodeRequest 
//! \brief Used for request messages sent from a Fountain node 
class NodeRequest : public NodeMessage { 
public:
        NodeRequest(MessageAction a, const std::string& src = std::string("NO SOURCE ID"), const std::string& dest = std::string("NO DESTINATION ID")); 
		//! \brief Default constructor
 
		//! @param a The MessageAction enum for this message
		//! @param src The NodeID of the Fountain node creating this message
		//! @param dest The NodeID of the Fountain node this message is destined to
        NodeRequest(MessageAction a, const NodeID& src = NodeID(), const NodeID& dest = NodeID());

		//! @param versionNumberString The version number of a Fountain Node
		//! \throw FountainException if the message could not be created
		void buildJoin(const std::string& versionNumberString) throw(FountainException);
}; 
 
//! \class NodeResponse 
}; 
 
//! \class NodeResponse 
Line 229 Line 209
class NodeResponse : public NodeMessage { 
public: 
//! \brief Default constructor 
class NodeResponse : public NodeMessage { 
public: 
//! \brief Default constructor 
        NodeResponse(MessageAction a, const std::string& src = std::string("NO SOURCE ID"), const std::string& dest = std::string("NO DESTINATION ID")); 
        NodeResponse(MessageAction a, const NodeID& src = NodeID(), const NodeID& dest = NodeID()); 
	 
//! \brief build a trace response message 
//! @param parentID the NodeID of a Fountain node's parent node
	 
//! \brief build a trace response message 
//! @param parentID the NodeID of a Fountain node's parent node
		//! @return SUCCESS if building the message was successful
		//! \throw FountainException if the message could not be created 
		//! @return FAILURE if building the message was unsuccessful
 
		void buildTrace(const std::string& parentID) throw(FountainException); 
 
//! @param parentMessage The bomb message from our parent node
		void buildTrace(const std::string& parentID) throw(FountainException); 
 
//! @param parentMessage The bomb message from our parent node
		//! @return SUCCESS if building the message was successful
		//! @return FAILURE if building the message was unsuccessful
        int buildBomb(const FountainParseMessage* parentMessage);		 
		//! @return SUCCESS if building the message was successful and this node should not exit
		//! @return FAILURE if building the message was unsuccessful and this node should not exit
		//! @return bomb if this node should exit
 
		//! \throw FountainException if the message could not be created
        int buildBomb(const FountainParseMessage* parentMessage) throw(FountainException);
		
		//! @param parentMessage The admin message from our parent node
		//! \throw FountainException if the message could not be created
        void buildAdmin(const FountainParseMessage* parentMessage) throw(FountainException);
		
		//! @param nodeInfo The NodeInfo object from a Fountain node
		//! \throw FountainException if the message could not be created
        void buildQuery(NodeInfo& nodeInfo) throw(FountainException);
		
		//! @param parentID The parentID of the Fountain node accepting the join request
		//! \throw FountainException if the message could not be created
        void buildJoinAccept(const std::string& parentID) throw(FountainException);
		
		//! @param 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
		//! @param 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
		//! @param 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
		//! @param children A vector of strings representing a Fountain node's child nodes
		//! \throw FountainException if the message could not be created
        void buildPingPong(std::vector<double> avgPingPongTimes, std::vector<double> maxPingPongTimes, std::vector<double> minPingPongTimes, std::vector<std::string> children) throw(FountainException);
		
		//! Appends a NodeList element from the msg parameter to this message's NodeList parameter
		//! @return true if the NodeList was appended successfully
		//! @return false if the NodeList element was not found in the msg parameter, or if the NodeList element for this message has not been created yet.
		//! param msg - A message containing a NodeList element as a child of the Data element
		bool appendToNodeList(const FountainParseMessage* msg);
}; 
}; 
//! \class FountainPasreMessage 
//! \class FountainParseMessage 
//! \brief simple wrapper class around the bamboo library ParseMsg class 
class FountainParseMessage : public ParseMsg { 
public: 
//! \brief simple wrapper class around the bamboo library ParseMsg class 
class FountainParseMessage : public ParseMsg { 
public: 
Line 275 Line 281
#endif 
 
 
#endif 
 
 


Legend
Lines deleted from 1.47  
Lines Modified
  Lines added in revision 1.42