CarobNS::TypeTag Class Reference

This class implements protocol type tags with an internal String, but offers an interface on top of it in order to be transparently substituted some day (with enums for instance). More...

#include <TypeTag.hpp>

List of all members.

Public Member Functions

 TypeTag (int tn)
 Constructor with the typetag number.
 TypeTag (const DriverSocket &in) throw (SocketIOException, UnexpectedException)
 Reads/deserializes/constructs a TypeTag from a stream.
void sendToStream (const DriverSocket &out) const throw (SocketIOException, UnexpectedException)
 Serialize "this" tag on the stream.
bool operator== (const int &ref)
 Comparison with an integer: compares typeNumber.
 operator int ()
 Cast to integer.


Detailed Description

This class implements protocol type tags with an internal String, but offers an interface on top of it in order to be transparently substituted some day (with enums for instance).

Advantages of using string types is human-readability (debugging, trace analysis, etc.) and earlier detection in case of protocol corruption. Drawback maybe a small performance cost.


Constructor & Destructor Documentation

CarobNS::TypeTag::TypeTag ( int  tn  )  [inline]

Constructor with the typetag number.

Parameters:
tn type number to affect
See also:
TypeTagConstants.hpp for possible values

CarobNS::TypeTag::TypeTag ( const DriverSocket in  )  throw (SocketIOException, UnexpectedException) [inline]

Reads/deserializes/constructs a TypeTag from a stream.

Parameters:
in input driver socket
Exceptions:
SocketIOException stream error


Member Function Documentation

void CarobNS::TypeTag::sendToStream ( const DriverSocket out  )  const throw (SocketIOException, UnexpectedException) [inline]

Serialize "this" tag on the stream.

Parameters:
out output stream
Exceptions:
SocketIOException stream error


The documentation for this class was generated from the following file:
Generated on Tue Oct 24 09:05:38 2006 for Carob by  doxygen 1.5.0