Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_Quorum::ResponseTracker Class Reference

ResponseTracker is an abstract helper class that provides a mechanism for matching a response to the original request. More...

#include <ResponseTracker.h>

Inheritance diagram for CODEX_Quorum::ResponseTracker:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~ResponseTracker ()
 Destructor.
virtual void insert (unsigned char *key, ResponseInfo *m)=0
 Attach a map of Message%s (keyed by server ID) with request identifier key.
virtual bool remove (const unsigned char *key, bool del=false)=0
 Remove the map of Message%s with request identifier key.
virtual bool check (const unsigned char *data, int length, unsigned int server)=0
 Check if the incoming data is a response to a registered request.
virtual ResponseInfooperator() (const unsigned char *msgID)=0
 Pointer to the ResponseInfo corresponding to the specified message ID, or 0 if the ID isn't found.
virtual unsigned char * extractKey (const unsigned char *data)=0
 Helper routine to extract the key (message ID) from an incoming or outgoing message.

Detailed Description

ResponseTracker is an abstract helper class that provides a mechanism for matching a response to the original request.

Typically, only the templated derived class ConcreteResponseTracker will be used in an application.

Definition at line 46 of file ResponseTracker.h.


Member Function Documentation

virtual bool CODEX_Quorum::ResponseTracker::check const unsigned char *  data,
int  length,
unsigned int  server
[pure virtual]
 

Check if the incoming data is a response to a registered request.

If so, the data is added to the corresponding MessageVector. Ownership of the data is kept by the calling routine.

Parameters:
data The full incoming message.
length The length of the array data.
server The ID of the server sending this message.
Return values:
true The message is a response to a known request.
false The message is not recognized and must be handled.

Implemented in CODEX_Quorum::ConcreteResponseTracker< ST, MT >.

Referenced by CODEX_Quorum::StaticByzantineQuorumSystem< N, T >::poll().

virtual unsigned char* CODEX_Quorum::ResponseTracker::extractKey const unsigned char *  data  )  [pure virtual]
 

Helper routine to extract the key (message ID) from an incoming or outgoing message.

Returns:
A new array of data, which the calling routine becomes responsible for.

Implemented in CODEX_Quorum::ConcreteResponseTracker< ST, MT >.

Referenced by CODEX_Quorum::QuorumSystem::extractKey().

virtual void CODEX_Quorum::ResponseTracker::insert unsigned char *  key,
ResponseInfo m
[pure virtual]
 

Attach a map of Message%s (keyed by server ID) with request identifier key.

Ownership of the arguments is taken by the object.

Implemented in CODEX_Quorum::ConcreteResponseTracker< ST, MT >.

Referenced by CODEX_Quorum::StaticByzantineQuorumSystem< N, T >::broadcastMessage(), and CODEX_Quorum::StaticByzantineQuorumSystem< N, T >::unicastMessage().

virtual bool CODEX_Quorum::ResponseTracker::remove const unsigned char *  key,
bool  del = false
[pure virtual]
 

Remove the map of Message%s with request identifier key.

Parameters:
key The request identifier
del Should the ResponseInfo be deleted?
Return values:
true The request was successfully found and removed
false The request was not found

Implemented in CODEX_Quorum::ConcreteResponseTracker< ST, MT >.

Referenced by CODEX_Quorum::StaticByzantineQuorumSystem< N, T >::poll().


The documentation for this class was generated from the following file:
Generated on Fri May 6 17:42:32 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1