#include <ot_lib.h>
Public Member Functions | |
ot_vector (int s=0) | |
ot_vector (const ot_vector &c) | |
virtual | ~ot_vector () |
Destructor. | |
ot_obj * | dup (void) const |
void | asXml (ostream &s=cout, int i=0) const |
bool | asData (ostream &s) const |
const ot_obj * | get (int pos) const |
Get the element at position pos (0..Size-1). | |
ot_obj * | getPtr (int pos) |
Get the element at position pos (0..Size-1). | |
bool | set (int pos, const ot_obj *o) |
Insert an ot_object into the array. | |
bool | set (int pos, const ot_obj &o) |
Insert an ot_object into the array. | |
bool | erase (const ot_obj *o) |
Erase an object from the array. | |
ot_vector & | operator= (const ot_vector &c) |
Assign op. | |
bool | operator== (const ot_vector &c) |
Eq op. | |
bool | operator!= (const ot_vector &v) |
Operator !=. | |
bool | operator== (const ot_obj *o) const |
Eq op. |
This class implement a vector of OT objects. When an object is inserted, this class clone the input object and insert the copy. The destructor free all the object preset into the array.
ot_lib::ot_vector::ot_vector | ( | int | s = 0 |
) |
size | size of the array |
ot_lib::ot_vector::ot_vector | ( | const ot_vector & | c | ) |
Copy constructor
c | Object to copy |
virtual ot_lib::ot_vector::~ot_vector | ( | ) | [virtual] |
Destructor.
ot_obj* ot_lib::ot_vector::dup | ( | void | ) | const [virtual] |
Duplicate the object Clone the array and all the objects contained.
Implements ot_lib::ot_obj.
void ot_lib::ot_vector::asXml | ( | ostream & | s = cout , |
|
int | i = 0 | |||
) | const [virtual] |
Print the XML rappresentation of object into string
s | the output string | |
i | The indent spaces |
Implements ot_lib::ot_obj.
bool ot_lib::ot_vector::asData | ( | ostream & | s | ) | const [virtual] |
Get the element at position pos (0..Size-1).
Return the pointer to the object at the postion pos.
pos | The object position in the array (0..Size-1) |
Get the element at position pos (0..Size-1).
Return the pointer to the object at the postion pos.
pos | The object position in the array (0..Size-1) |
Insert an ot_object into the array.
This function make the copy of the input object and then insert it in the array.
pos | The object position in array (0..Size-1) | |
o | The object to insert |
Insert an ot_object into the array.
This function make the copy of the input object and then insert it in the array.
pos | The object position in array (0..Size-1) | |
o | The object to insert |
bool ot_lib::ot_vector::erase | ( | const ot_obj * | o | ) |
Erase an object from the array.
Erase an obect from the array
o | The object to erase |
bool ot_lib::ot_vector::operator== | ( | const ot_vector & | c | ) |
Eq op.
bool ot_lib::ot_vector::operator!= | ( | const ot_vector & | v | ) |
Operator !=.
bool ot_lib::ot_vector::operator== | ( | const ot_obj * | o | ) | const [inline, virtual] |