ot_obj Class Reference

OT_LIB base object class. More...

#include <ot_obj.h>

Inheritance diagram for ot_obj:

ot_bool OT_ENUM_FIELD_LIST ot_exception ot_ior ot_list ot_map ot_null ot_num< X > ot_num< float > ot_num< int > ot_num< unsigned int > ot_path ot_rawData ot_string ot_time ot_vector

List of all members.

Public Member Functions

virtual ~ot_obj ()
 Default destructor.
OT_OBJECT_TYPE getType (void) const
virtual ot_objdup (void) const =0
virtual bool operator== (const ot_obj *o) const =0
 Eq operator.
bool operator== (const ot_obj &o) const
 Eq operator.
virtual void asXml (ostream &s=cout, int i=0) const =0
virtual bool asData (ostream &s) const =0

Static Public Member Functions

static bool readStringFromData (istream &s, string &ret)
static bool readIntegerFromData (istream &s, int &ret)
static bool readUnsignedIntegerFromData (istream &s, unsigned int &ret)
static bool readFloatFromData (istream &s, float &ret)
static bool readBoolFromData (istream &s, bool &ret)
static bool readRawFromData (istream &s, char *&data, int &size)
static bool writeStringAsData (ostream &s, const string &val)
static bool writeIntegerAsData (ostream &s, int val)
static bool writeBoolAsData (ostream &s, bool val)
static bool writeRawAsData (ostream &s, const char *data, int size)

Protected Member Functions

 ot_obj (OT_OBJECT_TYPE type)

Private Attributes

OT_OBJECT_TYPE m_type
 Identify the object type.


Detailed Description

OT_LIB base object class.

This is the base class of all OT objects


Constructor & Destructor Documentation

ot_obj::ot_obj ( OT_OBJECT_TYPE  type  )  [protected]

Default costructor

Parameters:
type The object type

virtual ot_obj::~ot_obj (  )  [virtual]

Default destructor.


Member Function Documentation

OT_OBJECT_TYPE ot_obj::getType ( void   )  const

virtual ot_obj* ot_obj::dup ( void   )  const [pure virtual]

Clone the object and return the pointer of the new object

Returns:
Pointer to the new object

Implemented in ot_bool, OT_ENUM_FIELD_LIST, ot_float, ot_int, ot_ior, ot_list, ot_map, ot_null, ot_path, ot_rawData, ot_string, ot_time, ot_uint, and ot_vector.

virtual bool ot_obj::operator== ( const ot_obj o  )  const [pure virtual]

bool ot_obj::operator== ( const ot_obj o  )  const

Eq operator.

virtual void ot_obj::asXml ( ostream &  s = cout,
int  i = 0 
) const [pure virtual]

Write the object XML rappresentation on output stream

Parameters:
s The output stream
i The indent spaces

Implemented in ot_bool, OT_ENUM_FIELD_LIST, ot_exception, ot_ior, ot_list, ot_map, ot_null, ot_num< X >, ot_path, ot_rawData, ot_string, ot_time, ot_vector, ot_num< float >, ot_num< int >, and ot_num< unsigned int >.

virtual bool ot_obj::asData ( ostream &  s  )  const [pure virtual]

Build a binary image of the object

Parameters:
s The output stream

Implemented in ot_bool, OT_ENUM_FIELD_LIST, ot_ior, ot_list, ot_map, ot_null, ot_num< X >, ot_path, ot_rawData, ot_string, ot_time, ot_vector, ot_num< float >, ot_num< int >, and ot_num< unsigned int >.

static bool ot_obj::readStringFromData ( istream &  s,
string &  ret 
) [static]

Read a string from data stream

Parameters:
s The input stream
ret The readed string
Returns:
True if ok or error

static bool ot_obj::readIntegerFromData ( istream &  s,
int ret 
) [static]

Read a integer from data stream

Parameters:
s The input stream
ret The readed intefer
Returns:
True if ok or error

static bool ot_obj::readUnsignedIntegerFromData ( istream &  s,
unsigned int ret 
) [static]

Read a unsigned integer from data stream

Parameters:
s The input stream
ret The readed intefer
Returns:
True if ok or error

static bool ot_obj::readFloatFromData ( istream &  s,
float ret 
) [static]

Read a float from data stream

Parameters:
s The input stream
ret The readed float
Returns:
True if ok or error

static bool ot_obj::readBoolFromData ( istream &  s,
bool &  ret 
) [static]

Read a bool from data stream

Parameters:
s The input stream
ret The readed bool
Returns:
True if ok or error

static bool ot_obj::readRawFromData ( istream &  s,
char *&  data,
int size 
) [static]

Read buffer from data stream

Parameters:
s The input stream
data The readed buffer
size The size of readed buffer
Returns:
True if ok or error

static bool ot_obj::writeStringAsData ( ostream &  s,
const string &  val 
) [static]

Write string on data stream

Parameters:
s The output stream
val The string to write
Returns:
True if ok or error

static bool ot_obj::writeIntegerAsData ( ostream &  s,
int  val 
) [static]

Write integer on data stream

Parameters:
s The output stream
val The integer to write
Returns:
True if ok or error

static bool ot_obj::writeBoolAsData ( ostream &  s,
bool  val 
) [static]

Write bool on data stream

Parameters:
s The output stream
val The boolean to write
Returns:
True if ok or error

static bool ot_obj::writeRawAsData ( ostream &  s,
const char *  data,
int  size 
) [static]

Write buffer on data stream

Parameters:
s The output stream
data Pointer to data
size The size of the buffer
Returns:
True if ok or error


Member Data Documentation

OT_OBJECT_TYPE ot_obj::m_type [private]

Identify the object type.

Reimplemented in ot_ior.


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

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