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

CODEX_Server::ServerMessageDispatcher Class Reference

This is a concrete CODEX_Quorum::MessageDispatcher. More...

#include <ServerMessageDispatcher.h>

Inheritance diagram for CODEX_Server::ServerMessageDispatcher:

Inheritance graph
[legend]
Collaboration diagram for CODEX_Server::ServerMessageDispatcher:

Collaboration graph
[legend]
List of all members.

Public Types

typedef map< unsigned char,
MessageParser * > 
MapType
 Useful short name.


Public Methods

 ServerMessageDispatcher ()
 Constructor.

virtual ~ServerMessageDispatcher ()
 Virtual destructor.

void operator() (CODEX_Quorum::Message *m)
 Method used to dispatch a message.

bool addParser (unsigned char mType, MessageParser *mp)
 Add another parser to the internal list.


Detailed Description

This is a concrete CODEX_Quorum::MessageDispatcher.

It is designed for a system in which different classes of messages are distinguished by a one-byte type identifier, after which class-specific parsers are employed. This is dynamically configurable, in that new parsers can be added at any time, as long as they use unique type identifers.

Definition at line 37 of file ServerMessageDispatcher.h.


Member Function Documentation

bool ServerMessageDispatcher::addParser unsigned char    mType,
MessageParser   mp
 

Add another parser to the internal list.

Parameters:
mType  The unique message type identifier.
mp  The appropriate parser for this type.
Returns:
true if the parser was successfully added, false otherwise.

Definition at line 71 of file ServerMessageDispatcher.cc.

void ServerMessageDispatcher::operator() CODEX_Quorum::Message   m [virtual]
 

Method used to dispatch a message.

Parameters:
m  A Message to dispatch, including all headers. This object takes ownership of the Message.

Implements CODEX_Quorum::MessageDispatcher.

Definition at line 24 of file ServerMessageDispatcher.cc.

References CODEX_Quorum::Message::buffer(), and CODEX_Quorum::Message::length().


The documentation for this class was generated from the following files:
Generated on Wed Jun 2 16:33:21 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18