#include <FountainMessage.h>
Public Member Functions | |
| FountainParseMessage (const BambooLib::ParseMsg *msg) | |
| Default constructor. | |
| ~FountainParseMessage () | |
| Destructor. | |
| BambooParseMsg::PointerType | getParseMsg () const |
| Implicit conversion operator to a BambooParseMsg::PointerType pointer Explicity conversion to a BambooParseMsg::PointerType pointer. | |
| FountainMessage::MessageAction | getAction () const |
| returns the action attribute enum | |
| bool | getStatus () const |
| returns the Status element value | |
| BambooLib::SSS_Element_type | getMessageType () const |
| returns the SSS_Element_type element value | |
| BambooLib::XMLElement * | getRoot () const |
| returns the root element | |
| const char * | getActor () const |
| returns the actor attribute | |
| BambooLib::XMLElement * | getDataElement () const |
| returns the data element | |
| const char * | getDataElementValue (const char *value) const |
| returns the value of a data element | |
| const char * | getResponseMessage () const |
| returns the Response element value | |
| const char * | getSource () const |
| Returns the source NodeID. | |
| const char * | getDestination () const |
| returns the destination NodeID | |
| FountainErrorCode | getErrorCode () const |
| returns the error code from the status element | |
Private Types | |
| typedef Loki::SmartPtr< const BambooLib::ParseMsg, Loki::NoCopy, Loki::AllowConversion, Loki::RejectNullStrict > | BambooParseMsg |
| SmartPtr object wrapped around a const BambooLib::ParseMsg pointer. | |
Private Member Functions | |
| FountainParseMessage (const FountainParseMessage &rhs) | |
| Private copy constructor with no implementation so clients cannot use it. | |
| FountainParseMessage & | operator= (const FountainParseMessage &rhs) |
| Private assignment operator with no implementation so clients cannot use it. | |
Private Attributes | |
| BambooParseMsg | msg_ |
| The underlying pointer to a BambooLib::ParseMsg object. | |
Friends | |
| std::ostream & | operator<< (std::ostream &output, const FountainParseMessage &rhs) |
| ostream operator | |
This class adds a few Fountain specific features to the bamboo ParseMsg class. Most notable, it adds support for getting the Source and Destination elements as well as the FountainErrorCode enum if the Status element has a FAILURE value.
This class is modeled using composition since it retains a private pointer to the bamboo library ParseMsg object. Since this class does not add many new features to the ParseMsg class, it might make more sense to model this class using the "is-a" idiom since all FountainParseMessage objects could be considered ParseMsg objects. However, this is not currently possible for a couple of reasons:
An alternative to this composition design would be to implement a cloning factory design that would take each ParseMsg object received and clone it before creating a FountainParseMessage object. This would allow the "is-a" idiom to be used and get rid of the public "getter" methods that call the same method in the ParseMsg class. I decided against this decision since I felt cloning a ParseMsg object each time a message was received would be inefficient.
|
|
SmartPtr object wrapped around a const BambooLib::ParseMsg pointer. This object uses the following policy classes:
|
|
|
Default constructor.
|
|
|
returns the action attribute enum
|
|
|
returns the value of a data element
|
|
|
returns the destination NodeID
|
|
|
returns the error code from the status element
|
|
|
returns the Response element value
|
|
|
Returns the source NodeID.
|
1.4.6