Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

VOS::MessageBlock Class Reference

A message block is a list of messages which have been bundled together into a single block. More...

#include <vos/corelibs/vos/messageblock.hh>

Inheritance diagram for VOS::MessageBlock:

VOS::RefCounted List of all members.

Public Member Functions


Detailed Description

A message block is a list of messages which have been bundled together into a single block.

It is used for various purposes. One useful feature of a message block is that it is processed all at once: the first message will not be delivered until the entire message block has been received, parsed and queued. This is be useful for supporting transactions.

Definition at line 64 of file messageblock.hh.


Constructor & Destructor Documentation

MessageBlock::MessageBlock  ) 
 

Definition at line 35 of file messageblock.cc.

MessageBlock::~MessageBlock  ) 
 

Definition at line 46 of file messageblock.cc.


Member Function Documentation

Message * MessageBlock::getMessage int  n  ) 
 

Retrieve a message from this messageblock.

Parameters:
n The desired position. May be negative, in which case the position will be counted from the end. The very last element can be accessed using -1.
Returns:
The message at the desired position, or 0 if the index is invalid. NOTE YOU MUST CALL release() WHEN DONE OR USE vRef.

Definition at line 75 of file messageblock.cc.

string MessageBlock::getName  ) 
 

Get the macro name.

Returns:
the macro name

Definition at line 57 of file messageblock.cc.

const string & MessageBlock::getString  ) 
 

Get the XML-like textual representation of this messageblock, suitable for sending over the network.

Definition at line 95 of file messageblock.cc.

void MessageBlock::insertMessage int  n,
Message m
 

Add a message to the message block.

Parameters:
n The position to insert into. May be negative, in which case the position will be counted from the end. To append to the end, use -1.
m the message to insert

Definition at line 67 of file messageblock.cc.

Message * MessageBlock::lastMessage  ) 
 

Convenience function returns the last message in this messageblock.

Returns:
The last message 0 if the message block is empty. NOTE YOU MUST CALL release() WHEN DONE OR USE vRef.

Definition at line 83 of file messageblock.cc.

Referenced by VOS::RemoteStreamSite::flushIncomingBuffers(), VOS::RemoteSocketSite::flushIncomingBuffers(), and getString().

int MessageBlock::numMessages  ) 
 

Get the number of messages in the messageblock.

Returns:
the number of messages in the messageblock.

Definition at line 90 of file messageblock.cc.

int MessageBlock::parseUpdate const string &  s  ) 
 

Internal parsing function.

Update the current partial parse of this messageblock with new data.

Parameters:
s the new data
Returns:
The number of bytes from the beginning of 's' which were read in. However, 0 is special: rather than meaning that nothing was read in, this indicates that the ENTIRE string was read in, but more data is still expected.

Definition at line 136 of file messageblock.cc.

Referenced by VOS::RemoteStreamSite::flushIncomingBuffers(), and VOS::RemoteSocketSite::flushIncomingBuffers().

void VOS::MessageBlock::removeMessage int  n  ) 
 

Remove a message from the message block.

Parameters:
n The position to remove.

void MessageBlock::setName const string &  s  ) 
 

Set the message block macro name, which can then be refered back to later in a message using <include>.

If this is blank, the message block will not be used as a macro template.

Parameters:
s the name

Definition at line 62 of file messageblock.cc.


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:56:04 2003 for Interreality Project - VOS by doxygen 1.3.2