#include <RefVector.h>


Public Member Functions | |
| RefVector (unsigned long capacity=1) | |
| RefVector (const RefVector< T > &v) | |
| const RefVector< T > & | operator= (const RefVector< T > &v) |
| virtual | ~RefVector () |
| void | clear () |
| void | setCapacity (unsigned long newCapacity) |
| unsigned long | size () const |
| bool | isEmpty () const |
| unsigned long | addObject (T &o) |
| unsigned long | addObject (T &o, unsigned long i) |
| void | setObject (T &o, unsigned long index) const |
| T & | getObject (unsigned long index) const |
| T & | operator[] (unsigned long index) |
| const T & | operator[] (unsigned long index) const |
| unsigned long | getObjectIndex (const T &o) const |
| void | removeObjects (unsigned long first, unsigned long last, DeleteFlag fl=DO_NOT_DELETE) |
| T & | removeObject (unsigned long i) |
| const T & | removeObject (const T &o) |
| T ** | getArray () const |
| void | deleteAllObjects (unsigned long first=0) |
| virtual String | getClassName () const |
Private Member Functions | |
| T ** | createArray () |
Private Attributes | |
| unsigned long | _size |
| unsigned long | _capacity |
| T ** | _array |
Friends | |
| class | TestRefVector |
This class implements a growable template array of objects. Note that the array just store pointers on the elements. If you delete the array, the pointed objects are not deleted. To delete all the pointed objects, call deleteAllObjects()
Definition at line 91 of file RefVector.h.
| alize::RefVector< T >::RefVector | ( | unsigned long | capacity = 1 ) |
[inline, explicit] |
Create an RefVector object.
| capacity | maximum number of elements in the array The capacity will automatically grow when the size will overtake the capacity |
| reserve | when the capacity grow, a number of locations equals to this value is added to the vector. |
Definition at line 104 of file RefVector.h.
| alize::RefVector< T >::RefVector | ( | const RefVector< T > & | v ) | [inline] |
Definition at line 108 of file RefVector.h.
| virtual alize::RefVector< T >::~RefVector | ( | ) | [inline, virtual] |
Definition at line 130 of file RefVector.h.
| unsigned long alize::RefVector< T >::addObject | ( | T & | o ) | [inline] |
Appends an object to the end of the vector
| o | the object to add |
Definition at line 157 of file RefVector.h.
Referenced by alize::XLine::addElement(), alize::LabelSet::addLabel(), alize::LabelServer::addLabel(), alize::XList::addLine(), alize::SegAbstract::addOwner(), alize::ViterbiAccum::addState(), alize::SegServer::assign(), alize::SegServer::createCluster(), alize::SegServer::createSeg(), alize::SegServer::duplicateSeg(), alize::XLine::getElements(), alize::LabelSet::LabelSet(), alize::XList::operator=(), alize::LabelSet::operator=(), alize::XLine::XLine(), and alize::XList::XList().
| unsigned long alize::RefVector< T >::addObject | ( | T & | o, |
| unsigned long | i | ||
| ) | [inline] |
Inserts an object at a specified place
| o | the object to add |
| i | index |
Definition at line 178 of file RefVector.h.
| void alize::RefVector< T >::clear | ( | ) | [inline] |
Definition at line 132 of file RefVector.h.
| T** alize::RefVector< T >::createArray | ( | ) | [inline, private] |
Definition at line 322 of file RefVector.h.
| void alize::RefVector< T >::deleteAllObjects | ( | unsigned long | first = 0 ) |
[inline] |
Definition at line 305 of file RefVector.h.
Referenced by alize::LabelSet::clear(), alize::LabelServer::clear(), alize::XList::operator=(), alize::XList::reset(), alize::XLine::reset(), alize::LabelSet::~LabelSet(), alize::XLine::~XLine(), and alize::XList::~XList().
| T** alize::RefVector< T >::getArray | ( | ) | const [inline] |
Use this method to access directly to the internal vector
Definition at line 303 of file RefVector.h.
| virtual String alize::RefVector< T >::getClassName | ( | ) | const [inline, virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 314 of file RefVector.h.
| T& alize::RefVector< T >::getObject | ( | unsigned long | index ) | const [inline] |
Returns the object at the specified index
| index | an index into this vector |
| IndexOutOfBoundsException |
Definition at line 208 of file RefVector.h.
Referenced by alize::ViterbiAccum::computeStateLLK(), alize::XList::findLine(), alize::XList::getAllElements(), alize::SegServer::getCluster(), alize::XLine::getElement(), alize::XLine::getElements(), alize::XLine::getIndex(), alize::SegServer::getIndex(), alize::LabelServer::getLabel(), alize::LabelServer::getLabelIndexByString(), alize::XList::getLine(), alize::LabelSet::getName(), alize::SegServer::getSeg(), alize::ViterbiAccum::getState(), alize::XList::operator=(), alize::XLine::operator=(), alize::XList::operator==(), alize::XLine::operator==(), alize::SegAbstract::removeAllOwners(), alize::XList::save(), alize::XList::searchValue(), alize::LabelServer::setLabel(), alize::XList::toString(), alize::XLine::toString(), alize::XLine::XLine(), and alize::XList::XList().
| unsigned long alize::RefVector< T >::getObjectIndex | ( | const T & | o ) | const [inline] |
Returns the index of the object (the first found)
| o | the object |
| Exception | if the object cannot be found |
Definition at line 233 of file RefVector.h.
| bool alize::RefVector< T >::isEmpty | ( | ) | const [inline] |
Definition at line 151 of file RefVector.h.
| const RefVector<T>& alize::RefVector< T >::operator= | ( | const RefVector< T > & | v ) | [inline] |
Definition at line 113 of file RefVector.h.
| T& alize::RefVector< T >::operator[] | ( | unsigned long | index ) | [inline] |
Definition at line 215 of file RefVector.h.
| const T& alize::RefVector< T >::operator[] | ( | unsigned long | index ) | const [inline] |
Definition at line 221 of file RefVector.h.
| const T& alize::RefVector< T >::removeObject | ( | const T & | o ) | [inline] |
Remove the first occurence of an object
| o | the object to remove |
| Exception | if the object is not referenced in the vector |
Definition at line 284 of file RefVector.h.
| T& alize::RefVector< T >::removeObject | ( | unsigned long | i ) | [inline] |
Removes an object from the array.
| i | index of the object to remove |
Definition at line 269 of file RefVector.h.
Referenced by alize::XLine::deleteElement(), alize::SegServer::remove(), and alize::SegAbstract::removeOwner().
| void alize::RefVector< T >::removeObjects | ( | unsigned long | first, |
| unsigned long | last, | ||
| DeleteFlag | fl = DO_NOT_DELETE |
||
| ) | [inline] |
Removes a set of objects from the array.
| first | index of the first object to remove |
| last | index of the last object to remove |
| fl | DELETE = remove and delete the objects DO_NOT_DELETE = remove but do not delete the objects |
Definition at line 248 of file RefVector.h.
| void alize::RefVector< T >::setCapacity | ( | unsigned long | newCapacity ) | [inline] |
Adjusts the size of the internal array Take care of consequences if the new capacity is smaller than the actual capacity
| c | new capacity |
Definition at line 139 of file RefVector.h.
| void alize::RefVector< T >::setObject | ( | T & | o, |
| unsigned long | index | ||
| ) | const [inline] |
Set an object at a specified location in the vector. Note that the previous object inside this location is not destroyed.
| o | the object to store |
| index | an index into this vector |
| IndexOutOfBoundsException |
Definition at line 196 of file RefVector.h.
Referenced by alize::LabelServer::setLabel().
| unsigned long alize::RefVector< T >::size | ( | ) | const [inline] |
Definition at line 150 of file RefVector.h.
Referenced by alize::ViterbiAccum::addState(), alize::SegServer::assign(), alize::ViterbiAccum::computeAndAccumulate(), alize::XList::findLine(), alize::XList::getAllElements(), alize::SegServer::getClusterCount(), alize::XLine::getElement(), alize::XLine::getElementCount(), alize::XLine::getElements(), alize::XLine::getIndex(), alize::SegServer::getIndex(), alize::LabelServer::getLabelIndexByString(), alize::XList::getLine(), alize::XList::getLineCount(), alize::ViterbiAccum::getPath(), alize::SegServer::getSegCount(), alize::ViterbiAccum::getStateCount(), alize::LabelSet::LabelSet(), alize::ViterbiAccum::logTransition(), alize::XList::operator=(), alize::XLine::operator=(), alize::LabelSet::operator=(), alize::XList::operator==(), alize::XLine::operator==(), alize::LabelSet::operator==(), alize::SegAbstract::removeAllOwners(), alize::XList::searchValue(), alize::LabelSet::size(), alize::LabelServer::size(), alize::XList::toString(), alize::XLine::toString(), alize::XLine::XLine(), and alize::XList::XList().
friend class TestRefVector [friend] |
Definition at line 93 of file RefVector.h.
T** alize::RefVector< T >::_array [private] |
Definition at line 320 of file RefVector.h.
Referenced by alize::RefVector< SegCluster >::operator=(), and alize::RefVector< SegCluster >::RefVector().
unsigned long alize::RefVector< T >::_capacity [private] |
Definition at line 319 of file RefVector.h.
unsigned long alize::RefVector< T >::_size [private] |
Definition at line 318 of file RefVector.h.
Referenced by alize::RefVector< SegCluster >::operator=().
1.7.2