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

POGroupMsg Class Reference

Used to communicate group commands. More...

#include <POGroupMsg.h>

Inheritance diagram for POGroupMsg:

POMessage List of all members.

Public Types

enum  COMMAND { JOIN, LEAVE, ADD, REMOVE }

Public Member Functions

 POGroupMsg (int cmd=JOIN)
 Default constructor.

 POGroupMsg (const POAddress &add_address, int add_rem=ADD)
 POGroupMsg (const POGroupMsg &cpy)
 Copy Constructor.

virtual ~POGroupMsg ()
virtual string messageType () const
int getCommand () const
void setCommand (int cmd)
POAddress getAddress () const
void setAddress (const POAddress &adr)
 Only valid if getCommand() == ADD || REMOVE.

virtual POMessageclone () const
int packsize () const
int pack (char *buf) const
int unpack (char *buf)

Detailed Description

Used to communicate group commands.


Member Enumeration Documentation

enum POGroupMsg::COMMAND
 

Enumeration values:
JOIN 
LEAVE 
ADD 
REMOVE 


Constructor & Destructor Documentation

POGroupMsg::POGroupMsg int  cmd = JOIN  ) 
 

Default constructor.

POGroupMsg::POGroupMsg const POAddress adr,
int  cmd = ADD
 

Constructs a message that will add or remove an address from a group

Parameters:
cmd - ADD || REMOVE
adr - the address to add/remove to/from the group
Returns:

POGroupMsg::POGroupMsg const POGroupMsg cpy  ) 
 

Copy Constructor.

POGroupMsg::~POGroupMsg  )  [virtual]
 


Member Function Documentation

POMessage * POGroupMsg::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 from POMessage.

POAddress POGroupMsg::getAddress  )  const [inline]
 

Only valid if getCommand() == ADD || REMOVE

Returns:
the address to add or remove the group

int POGroupMsg::getCommand  )  const [inline]
 

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

Reimplemented from POMessage.

int POGroupMsg::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 from POMessage.

int POGroupMsg::packsize  )  const
 

calculates the number of bytes needed to pack this message

Returns:
size in bytes

Reimplemented from POMessage.

void POGroupMsg::setAddress const POAddress adr  )  [inline]
 

Only valid if getCommand() == ADD || REMOVE.

void POGroupMsg::setCommand int  cmd  )  [inline]
 

int POGroupMsg::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 from POMessage.


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