ot_lib::ot_messageCodec Class Reference

OT_LIB Message Handler. More...

#include <ot_lib.h>

Inheritance diagram for ot_lib::ot_messageCodec:

ot_lib::ot_messageCodecGZip ot_lib::ot_messageCodecStd

List of all members.

Public Member Functions

virtual ~ot_messageCodec (void)
 Codec destructor.
virtual void encodeDataStream (ostream &s, const ot_map &msg) const =0
virtual auto_ptr< ot_mapdecodeDataStream (istream &s) const =0
void buildDataStream (ostream &s, const ot_map &msg) const
string getCodecName (void) const
void encode (ostream &s, const ot_messageBase &message) const
 Encode a message.
auto_ptr< ot_messageBasedecode (istream &s) const
 Decode a message.

Static Public Member Functions

static auto_ptr< ot_messageBasedecodeDataFromNet (ost::TCPStream *s, string &requesCodec)
static void encodeDataToNet (ost::TCPStream *s, const ot_messageCodec *codec, const ot_messageBase &message)

Protected Member Functions

 ot_messageCodec (const string &codecName)

Private Attributes

string m_codecName
 The codec name.


Detailed Description

OT_LIB Message Handler.

Message codec


Constructor & Destructor Documentation

ot_lib::ot_messageCodec::ot_messageCodec ( const string &  codecName  )  [protected]

Codec contructor

Parameters:
codecName The name of the codec (string format)

virtual ot_lib::ot_messageCodec::~ot_messageCodec ( void   )  [inline, virtual]

Codec destructor.


Member Function Documentation

virtual void ot_lib::ot_messageCodec::encodeDataStream ( ostream &  s,
const ot_map msg 
) const [pure virtual]

Encode a binary stream from a sequence

Parameters:
s Writing stream
msg The message to encode

Implemented in ot_lib::ot_messageCodecStd, and ot_lib::ot_messageCodecGZip.

virtual auto_ptr<ot_map> ot_lib::ot_messageCodec::decodeDataStream ( istream &  s  )  const [pure virtual]

Decode a binary stream from a sequence

Parameters:
s Reading stream
msg The message decoded

Implemented in ot_lib::ot_messageCodecStd, and ot_lib::ot_messageCodecGZip.

void ot_lib::ot_messageCodec::buildDataStream ( ostream &  s,
const ot_map msg 
) const

Send the binary stream

Parameters:
s Writing stream
msg The message to send

static auto_ptr<ot_messageBase> ot_lib::ot_messageCodec::decodeDataFromNet ( ost::TCPStream *  s,
string &  requesCodec 
) [static]

static void ot_lib::ot_messageCodec::encodeDataToNet ( ost::TCPStream *  s,
const ot_messageCodec codec,
const ot_messageBase message 
) [static]

string ot_lib::ot_messageCodec::getCodecName ( void   )  const

Get the codec name

Returns:
The codec name

void ot_lib::ot_messageCodec::encode ( ostream &  s,
const ot_messageBase message 
) const

Encode a message.

auto_ptr<ot_messageBase> ot_lib::ot_messageCodec::decode ( istream &  s  )  const

Decode a message.


Member Data Documentation

The codec name.


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

Generated on Sun May 4 12:42:45 2008 for OT_LIB 4.1 by  doxygen 1.5.5