Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

POMessage Class Reference

The base class for all messages sent through the PostOffice. More...

#include <POMessage.h>

Inheritance diagram for POMessage:

POBoxListMsg POErrorMsg POGroupMsg POPartialMsg POSmallFileMsg POTextMsg List of all members.

Public Member Functions

 POMessage ()
 Default constructor.

 POMessage (const POMessage &cpy)
virtual ~POMessage ()
virtual string messageType () const
void setTag (int id)
void setSource (const POAddress &source)
void setDestination (const POAddress &dest)
POInt getTag () const
POAddress getSource () const
POAddress getDestination () const
string getPackedType () const
virtual POMessageclone () const
int packsize () const
int pack (char *buf) const
int unpack (char *buf)

Detailed Description

The base class for all messages sent through the PostOffice.


Constructor & Destructor Documentation

POMessage::POMessage  ) 
 

Default constructor.

POMessage::POMessage const POMessage cpy  ) 
 

POMessage::~POMessage  )  [virtual]
 


Member Function Documentation

POMessage * POMessage::clone  )  const [virtual]
 

Creates an identical copy of this message. This function must be overloaded in derived classes.

Returns:
a copy of this message

Reimplemented in POBoxListMsg, POErrorMsg, POGroupMsg, POPartialMsg, POSmallFileMsg, and POTextMsg.

POAddress POMessage::getDestination  )  const
 

string POMessage::getPackedType  )  const [inline]
 

POAddress POMessage::getSource  )  const
 

POInt POMessage::getTag  )  const [inline]
 

virtual string POMessage::messageType  )  const [inline, virtual]
 

Reimplemented in POBoxListMsg, POErrorMsg, POGroupMsg, POPartialMsg, POSmallFileMsg, and POTextMsg.

int POMessage::pack char *  buffer  )  const
 

packs the message into a pre-alocated buffer of size >= packsize()

Parameters:
buffer - the buffer to pack into
Returns:
the number of bytes packed

Reimplemented in POBoxListMsg, POErrorMsg, POGroupMsg, POPartialMsg, POSmallFileMsg, and POTextMsg.

int POMessage::packsize  )  const
 

calculates the number of bytes needed to pack this message

Returns:
size in bytes

Reimplemented in POBoxListMsg, POErrorMsg, POGroupMsg, POPartialMsg, POSmallFileMsg, and POTextMsg.

void POMessage::setDestination const POAddress dest  ) 
 

void POMessage::setSource const POAddress source  ) 
 

void POMessage::setTag int  id  )  [inline]
 

int POMessage::unpack char *  buffer  ) 
 

unpacks the message, setting source, destination, and derived type

Parameters:
buffer the buffer to unpack, must be valid, no error checking
Returns:
the number of bytes unpacked

Reimplemented in POBoxListMsg, POErrorMsg, POGroupMsg, POPartialMsg, POSmallFileMsg, and POTextMsg.


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 12:49:29 2004 for pexpr by doxygen 1.3.4