Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

Message Class Reference

#include <Message.h>


Public Member Functions

 Message (RefCountBuffer buf)
 Message (HEADER_CODE header, const AGENT &agent)
RefCountBuffer serialize ()
RefCountBuffer unpackMsg ()
bool unpackCenterMsg (AGENT_VECTOR *agents, CENTER_PARAMS *params)

Private Attributes

HEADER_CODE _header
RefCountBuffer _buffer


Detailed Description

Implements a message, which is passed between agents and the Center server, and between agents themself.


Constructor & Destructor Documentation

Message::Message RefCountBuffer    buf [inline]
 

Constructs Message from message's code and the message to send. Used when we forward the message.

Message::Message HEADER_CODE    header,
const AGENT   agent
 

Constructs Message for sending "Get agents" request and for unregister. Puts the fields of the agent structure in the message using the format.


Member Function Documentation

RefCountBuffer Message::serialize  
 

Packs all the message's data into the RefCountBuffer for future sending in the net. Adds the magic number and the header.

bool Message::unpackCenterMsg AGENT_VECTOR *    agents,
CENTER_PARAMS   params
 

Removes header from the message that is stored in class' buffer and reads the list of the agents and parameters recieved from the Center.

RefCountBuffer Message::unpackMsg  
 

Removes the magic number from the message that is stored in class' buffer.


Field Documentation

RefCountBuffer Message::_buffer [private]
 

Buffer for storing the message itself

HEADER_CODE Message::_header [private]
 

Header for recognizing the type of the message.


The documentation for this class was generated from the following file:
Generated on Sun Mar 2 01:48:12 2003 for Agent by doxygen1.3-rc3