Class Hierarchy   Class Index   Method Index  

CHMwrapper Class Reference

#include <CHMwrapper.h>

Inheritance diagram for CHMwrapper:

CHMllpWrapper

Detailed Description

Class which abstracts the message wrapping protocol.

This is a pure virtual class designed to make it easy to replace the wrapping mechanisms used to delimit messages - it stores the incoming message streams in a vector of buffers. Whenever a message is detected by the virtual method DetectMessage the message chunk should be extracted and the OnMessage method called. By default this method will pass the message to the CHMengine object that CHMwrapper has a pointer to.

The CHMengine object should then parse the message and possibly send a reply using its Reply method. By default this reply method will call the SendResponseMessage of the CHMwrapper object which pipes it back to the CHMtransport interface, etc.

Deprecated:
New applications should use CHMllpServer and CHMllpClient.


Public Member Functions

 CHMwrapper ()
 Constructor.
virtual ~CHMwrapper ()
 Destructor.
virtual void AddWrapper (CHMstring &MessageData)=0
 Wrap an outgoing message.
void ClearData (size_t TransportIndex)
 Clear the buffer of the client at index TransportIndex.
virtual CHMboolean DetectMessage (CHMstring &Buffer, CHMstring &Message)=0
 Detect, and unwrap a message in an incoming stream.
CHMengineEngine ()
 Get the CHMengine object assigned to this class.
virtual void OnMessage (const CHMstring &MessageData, size_t TransportIndex)
 This method calls CHMengine to parse MessageData.
virtual size_t ReceiveData (const CHMstring &Data, size_t TransportIndex)
 Receive data from the client at index TransportIndex.
void SendResponseMessage (const CHMstring &MessageData, size_t TransportIndex)
 Send a response back to the sender.
void SetEngine (CHMengine *pEngine)
 Assign a CHMengine object to this class.
CHMtransportTransport ()
 Get the CHMtransport object assigned to the CHMengine associated with this class.


Constructor & Destructor Documentation

CHMwrapper::CHMwrapper  ) 
 

Constructor.

virtual CHMwrapper::~CHMwrapper  )  [virtual]
 

Destructor.


Member Function Documentation

virtual void CHMwrapper::AddWrapper CHMstring MessageData  )  [pure virtual]
 

Wrap an outgoing message.

Implemented in CHMllpWrapper.

void CHMwrapper::ClearData size_t  TransportIndex  ) 
 

Clear the buffer of the client at index TransportIndex.

virtual CHMboolean CHMwrapper::DetectMessage CHMstring Buffer,
CHMstring Message
[pure virtual]
 

Detect, and unwrap a message in an incoming stream.

This routine removes the read data from Buffer and sets the Message string to be equal to the message data. It returns true if a message is present in the buffer; otherwise, it returns false and leaves Buffer unaltered and the content of Message is undefined.

Implemented in CHMllpWrapper.

CHMengine* CHMwrapper::Engine  ) 
 

Get the CHMengine object assigned to this class.

virtual void CHMwrapper::OnMessage const CHMstring MessageData,
size_t  TransportIndex
[virtual]
 

This method calls CHMengine to parse MessageData.

virtual size_t CHMwrapper::ReceiveData const CHMstring Data,
size_t  TransportIndex
[virtual]
 

Receive data from the client at index TransportIndex.

Returns the number of messages detected.

void CHMwrapper::SendResponseMessage const CHMstring MessageData,
size_t  TransportIndex
 

Send a response back to the sender.

Message is routed back via the TransportIndex argument.

void CHMwrapper::SetEngine CHMengine pEngine  ) 
 

Assign a CHMengine object to this class.

CHMtransport* CHMwrapper::Transport  ) 
 

Get the CHMtransport object assigned to the CHMengine associated with this class.


The documentation for this class was generated from the following file: