ot_lib::ot_map Class Reference

OT_LIB Map class. More...

#include <ot_lib.h>

Inheritance diagram for ot_lib::ot_map:

ot_lib::ot_obj map

List of all members.

Public Member Functions

 ot_map (void)
 ot_map (const ot_map &c)
virtual ~ot_map ()
 Destructor.
ot_objdup (void) const
void asXml (ostream &s=cout, int i=0) const
bool asData (ostream &s) const
const ot_objget (const string &pos) const
 Get the element at position pos (0..Size-1).
ot_objgetPtr (const string &pos)
 Get the element at position pos (0..Size-1).
bool insert (const string &pos, const ot_obj *o)
 Insert an ot_object into the array.
bool insert (const string &pos, const ot_obj &o)
 Insert an ot_object into the array.
bool insertPtr (const string &pos, ot_obj *o)
bool erase (const ot_obj *o)
 Erase an object from the array.
bool erase (const string &o)
 Erase an object from the array.
ot_mapoperator= (const ot_map &c)
 Assign op.
bool operator== (const ot_map &c)
 Eq op.
bool operator!= (const ot_map &v)
 Operator !=.
bool operator== (const ot_obj *o) const
 Eq op.

Private Member Functions

void clearAll (void)
void copyFrom (const ot_map &c)


Detailed Description

OT_LIB Map class.

This class implement a map of OT objects.


Constructor & Destructor Documentation

ot_lib::ot_map::ot_map ( void   ) 

Parameters:
size size of the array

ot_lib::ot_map::ot_map ( const ot_map c  ) 

Copy constructor

Parameters:
c Object to copy

virtual ot_lib::ot_map::~ot_map (  )  [virtual]

Destructor.


Member Function Documentation

void ot_lib::ot_map::clearAll ( void   )  [private]

void ot_lib::ot_map::copyFrom ( const ot_map c  )  [private]

ot_obj* ot_lib::ot_map::dup ( void   )  const [virtual]

Duplicate the object Clone the array and all the objects contained.

Returns:
The new object

Implements ot_lib::ot_obj.

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

Print the XML rappresentation of object into string

Parameters:
s the output string
i The indent spaces

Implements ot_lib::ot_obj.

bool ot_lib::ot_map::asData ( ostream &  s  )  const [virtual]

Build a binary image of object

Parameters:
s The output stream

Implements ot_lib::ot_obj.

const ot_obj* ot_lib::ot_map::get ( const string &  pos  )  const

Get the element at position pos (0..Size-1).

Return the pointer to the object at the postion pos.

Parameters:
pos The object position in the array (0..Size-1)
Returns:
Pointer to the requested object or 0 if fail

ot_obj* ot_lib::ot_map::getPtr ( const string &  pos  ) 

Get the element at position pos (0..Size-1).

Return the pointer to the object at the postion pos.

Warning:
Remember that the returned object is a reference of the object contained in the array,if you modify it, modify also the object contained into the array.
Parameters:
pos The object position in the array (0..Size-1)
Returns:
Pointer to ot_object or 0 if fail

bool ot_lib::ot_map::insert ( const string &  pos,
const ot_obj o 
)

Insert an ot_object into the array.

This function make the copy of the input object and then insert it in the array.

Parameters:
pos The object position in array (0..Size-1)
o The object to insert
Returns:
False if the function fail else True

bool ot_lib::ot_map::insert ( const string &  pos,
const ot_obj o 
)

Insert an ot_object into the array.

This function make the copy of the input object and then insert it in the array.

Parameters:
pos The object position in array (0..Size-1)
o The object to insert
Returns:
False if the function fail else True

bool ot_lib::ot_map::insertPtr ( const string &  pos,
ot_obj o 
)

bool ot_lib::ot_map::erase ( const ot_obj o  ) 

Erase an object from the array.

Erase an obect from the array

Parameters:
o The object to erase
Returns:
False if the function fail else the object pointer

bool ot_lib::ot_map::erase ( const string &  o  ) 

Erase an object from the array.

Erase an obect from the array

Parameters:
o The object to erase
Returns:
False if the function fail else the object pointer

ot_map& ot_lib::ot_map::operator= ( const ot_map c  ) 

Assign op.

bool ot_lib::ot_map::operator== ( const ot_map c  ) 

Eq op.

bool ot_lib::ot_map::operator!= ( const ot_map v  ) 

Operator !=.

bool ot_lib::ot_map::operator== ( const ot_obj o  )  const [inline, virtual]

Eq op.

Implements ot_lib::ot_obj.


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