#include <ULongVector.h>


Public Member Functions | |
| ULongVector (unsigned long capacity=0, unsigned long size=0) | |
| const ULongVector & | operator= (const ULongVector &) |
| bool | operator== (const ULongVector &) const |
| bool | operator!= (const ULongVector &) const |
| ULongVector (const ULongVector &) | |
| virtual | ~ULongVector () |
| unsigned long | size () const |
| void | clear () |
| void | setSize (unsigned long size) |
| ULongVector & | addValue (_type v) |
| void | addValue (const ULongVector &vect) |
| _type & | operator[] (unsigned long index) |
| _type | operator[] (unsigned long index) const |
| void | ascendingSort () const |
| void | removeValues (unsigned long f, unsigned long l) |
| _type * | getArray () const |
| void | setAllValues (unsigned long u) |
| virtual String | getClassName () const |
| virtual String | toString () const |
| void | save (const FileName &f) |
| void | load (const FileName &f) |
Private Types | |
| typedef unsigned long | _type |
Private Member Functions | |
| _type * | createArray () const |
Static Private Member Functions | |
| static int | compare (const void *, const void *) |
Private Attributes | |
| unsigned long | _size |
| unsigned long | _capacity |
| _type * | _array |
Friends | |
| class | TestULongVector |
This class implements a growable array of unsigned long values.
Definition at line 78 of file ULongVector.h.
typedef unsigned long alize::ULongVector::_type [private] |
Definition at line 84 of file ULongVector.h.
| ULongVector::ULongVector | ( | unsigned long | capacity = 0, |
| unsigned long | size = 0 |
||
| ) | [explicit] |
Create a vector of type unsigned long values.
| size | initial size of the array |
| capacity | maximum number of elements in the array The capacity will grow automatically when the size will overtake the capacity |
Definition at line 72 of file ULongVector.cpp.
References setSize().
| ULongVector::ULongVector | ( | const ULongVector & | v ) |
Definition at line 76 of file ULongVector.cpp.
| ULongVector::~ULongVector | ( | ) | [virtual] |
Definition at line 221 of file ULongVector.cpp.
References _array.
| ULongVector & ULongVector::addValue | ( | _type | v ) |
Appends a real_t data to the end of the vector
| v | the real_t value to add |
Definition at line 134 of file ULongVector.cpp.
References _array, _capacity, _size, createArray(), and NULL.
Referenced by addValue(), alize::ViterbiAccum::computeAndAccumulate(), and alize::FeatureFileList::getFeatureCount().
| void ULongVector::addValue | ( | const ULongVector & | vect ) |
Appends a real_t data vector to the end of the vector
| vect | the real_t vector to add |
Definition at line 150 of file ULongVector.cpp.
References _array, _size, and addValue().
| void ULongVector::ascendingSort | ( | ) | const |
| void ULongVector::clear | ( | ) |
Definition at line 204 of file ULongVector.cpp.
References _size.
Referenced by alize::ViterbiAccum::reset().
| int ULongVector::compare | ( | const void * | s1, |
| const void * | s2 | ||
| ) | [static, private] |
Definition at line 174 of file ULongVector.cpp.
Referenced by ascendingSort().
| ULongVector::_type * ULongVector::createArray | ( | ) | const [private] |
Definition at line 112 of file ULongVector.cpp.
References _capacity, and alize::Object::assertMemoryIsAllocated().
Referenced by addValue(), operator=(), and setSize().
| ULongVector::_type * ULongVector::getArray | ( | ) | const |
Use this method to access directly to the internal vector
Definition at line 202 of file ULongVector.cpp.
References _array.
Referenced by alize::Feature::copySelectedData().
| String ULongVector::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 208 of file ULongVector.cpp.
| void ULongVector::load | ( | const FileName & | f ) |
Definition at line 240 of file ULongVector.cpp.
References _array, _capacity, _size, alize::String::c_str(), and alize::Exception::toString().
| bool ULongVector::operator!= | ( | const ULongVector & | v ) | const |
Definition at line 109 of file ULongVector.cpp.
| const ULongVector & ULongVector::operator= | ( | const ULongVector & | v ) |
Definition at line 81 of file ULongVector.cpp.
References _array, _capacity, _size, createArray(), alize::Object::isSameObject(), and NULL.
| bool ULongVector::operator== | ( | const ULongVector & | v ) | const |
Definition at line 97 of file ULongVector.cpp.
| ULongVector::_type ULongVector::operator[] | ( | unsigned long | index ) | const |
like the other operator[] but for constant ULongVector object.
Definition at line 127 of file ULongVector.cpp.
References _array, _size, alize::Object::assertIsInBounds(), and NULL.
| ULongVector::_type & ULongVector::operator[] | ( | unsigned long | index ) |
Overloaded operator[] to access an element in the vector.
| index | index of the element to access |
| IndexOutOfBoundsException |
Definition at line 120 of file ULongVector.cpp.
References _array, _size, alize::Object::assertIsInBounds(), and NULL.
| void ULongVector::removeValues | ( | unsigned long | f, |
| unsigned long | l | ||
| ) |
Removes a set of values from the array.
| f | index of the first value to remove |
| l | index of the last value to remove |
Definition at line 189 of file ULongVector.cpp.
| void ULongVector::save | ( | const FileName & | f ) |
Definition at line 228 of file ULongVector.cpp.
References _array, _size, alize::String::c_str(), and alize::Exception::toString().
| void ULongVector::setAllValues | ( | unsigned long | u ) |
Sets all the values to a a particular value
| U | the unsigned long value to set |
Definition at line 223 of file ULongVector.cpp.
| void ULongVector::setSize | ( | unsigned long | size ) |
Set a new size
| size | new size |
Definition at line 157 of file ULongVector.cpp.
References _array, _capacity, _size, createArray(), NULL, and size().
Referenced by alize::ViterbiAccum::getPath(), and ULongVector().
| unsigned long ULongVector::size | ( | ) | const |
Definition at line 206 of file ULongVector.cpp.
References _size.
Referenced by alize::Feature::copySelectedData(), and setSize().
| String ULongVector::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
Definition at line 210 of file ULongVector.cpp.
References _array, _size, and alize::String::valueOf().
friend class TestULongVector [friend] |
Definition at line 80 of file ULongVector.h.
_type* alize::ULongVector::_array [private] |
Definition at line 163 of file ULongVector.h.
Referenced by addValue(), ascendingSort(), getArray(), load(), operator=(), operator==(), operator[](), removeValues(), save(), setAllValues(), setSize(), toString(), ULongVector(), and ~ULongVector().
unsigned long alize::ULongVector::_capacity [private] |
Definition at line 162 of file ULongVector.h.
Referenced by addValue(), createArray(), load(), operator=(), and setSize().
unsigned long alize::ULongVector::_size [private] |
Definition at line 161 of file ULongVector.h.
Referenced by addValue(), ascendingSort(), clear(), load(), operator=(), operator==(), operator[](), removeValues(), save(), setAllValues(), setSize(), size(), toString(), and ULongVector().
1.7.2