#include <vector.h>
Public Member Functions | |
Vector (void) | |
Vector (unsigned int length) | |
Vector (const Vector< T > &v) | |
virtual | ~Vector () |
virtual unsigned int | size (void) const |
virtual bool | isEmpty (void) const |
virtual AbstractIterator< T > * | iteratorPtr (void) const |
Vector< T >::Iterator | iterator (void) const |
virtual void | purge (void) |
virtual const T & | operator[] (int index) const throw (OutOfRangeException<int>) |
virtual T & | operator[] (int index) throw (OutOfRangeException<int>) |
void | operator= (const Vector< T > &v) |
virtual void | pushBack (const T element) |
virtual void | popBack (void) |
virtual void | pushFront (const T element) |
virtual void | popFront (void) |
virtual void | insert (const T element, unsigned int index) |
virtual void | remove (unsigned int index) |
virtual const T & | first (void) const throw (EmptyCollectionException) |
virtual const T & | last (void) const throw (EmptyCollectionException) |
virtual T & | first (void) throw (EmptyCollectionException) |
virtual T & | last (void) throw (EmptyCollectionException) |
Classes | |
class | Iterator |
Vector
in the SEAL library is derived from the abstract classes List
and RandomAccess
. seal::Vector< T >::Vector | ( | void | ) | [inline] |
Default Constructor. It initialises a vector of size zero. Size of a vector is the number of elements in the vector.
seal::Vector< T >::Vector | ( | unsigned int | length | ) | [inline] |
This constructor initialises a vector with the specified size.
seal::Vector< T >::Vector | ( | const Vector< T > & | v | ) | [inline] |
Copy constructor. It is only a reference copier. The new and the old vector objects share the same data elements.
seal::Vector< T >::~Vector | ( | ) | [inline, virtual] |
Destructor.
virtual unsigned int seal::Vector< T >::size | ( | void | ) | const [inline, virtual] |
Returns the current size of the vector. Size of a vector is the number of elements in the vector.
Implements seal::Collection< T >.
virtual bool seal::Vector< T >::isEmpty | ( | void | ) | const [inline, virtual] |
Returns true if the vector is empty (ie., if the size of the vector is zero).
Implements seal::Collection< T >.
virtual AbstractIterator<T>* seal::Vector< T >::iteratorPtr | ( | void | ) | const [inline, virtual] |
Returns a pointer to an iterator object of the vector. The client of this function should be responsible to delete the returned iterator object using delete
.
Implements seal::Collection< T >.
Vector<T>::Iterator seal::Vector< T >::iterator | ( | void | ) | const [inline] |
Returns an iterator object corresponding to the vector.
void seal::Vector< T >::purge | ( | void | ) | [inline, virtual] |
Deletes all the elements of the vector. The size of the vector will be zero after a call to this function.
Implements seal::Collection< T >.
const T & seal::Vector< T >::operator[] | ( | int | index | ) | const throw (OutOfRangeException<int>) [inline, virtual] |
The random-access array like constant time operator.
Implements seal::RandomAccess< T >.
T & seal::Vector< T >::operator[] | ( | int | index | ) | throw (OutOfRangeException<int>) [inline, virtual] |
The random-access array like constant time operator.
Implements seal::RandomAccess< T >.
void seal::Vector< T >::operator= | ( | const Vector< T > & | v | ) | [inline] |
Assignment operator. It is only a reference copier. That is, after the assignment, the LHS and RHS will share the same data elements.
void seal::Vector< T >::pushBack | ( | const T | element | ) | [inline, virtual] |
Appends an element at the back end of the vector.
element | The element to be appended to the vector. |
Implements seal::List< T >.
void seal::Vector< T >::popBack | ( | void | ) | [inline, virtual] |
Pops an element from the back end of the list.
Implements seal::List< T >.
void seal::Vector< T >::pushFront | ( | const T | element | ) | [inline, virtual] |
Appends an element at the front end of the vector.
element | The element to be appended to the vector. |
Implements seal::List< T >.
void seal::Vector< T >::popFront | ( | void | ) | [inline, virtual] |
Pops an element from the front end of the vector.
Implements seal::List< T >.
void seal::Vector< T >::insert | ( | const T | element, | |
unsigned int | index | |||
) | [inline, virtual] |
Inserts an element, at the specified index, in to the vector. If the specified index is greater than or equal to the size of the vector, then the element is appended to the back end of the vector.
element | The element to be inserted. | |
index | The index at which the element should be inserted. |
Implements seal::List< T >.
void seal::Vector< T >::remove | ( | unsigned int | index | ) | [inline, virtual] |
Removes the element at the specified index in the vector. If the specified index is greater than or equal to the size of the vector, then nothing is done.
index | The element at this index will be removed from the vector. |
Implements seal::List< T >.
const T & seal::Vector< T >::first | ( | void | ) | const throw (EmptyCollectionException) [inline, virtual] |
Returns a reference to the first element in the vector. Throws an seal::EmptyCollectionException
if the vector is empty.
Implements seal::Collection< T >.
const T & seal::Vector< T >::last | ( | void | ) | const throw (EmptyCollectionException) [inline, virtual] |
Returns a reference to the last element in the vector. Throws an seal::EmptyCollectionException
if the vector is empty.
Implements seal::Collection< T >.
T & seal::Vector< T >::first | ( | void | ) | throw (EmptyCollectionException) [inline, virtual] |
Returns a reference to the first element in the vector. Throws an seal::EmptyCollectionException
if the vector is empty.
Implements seal::Collection< T >.
T & seal::Vector< T >::last | ( | void | ) | throw (EmptyCollectionException) [inline, virtual] |
Returns a reference to the last element in the vector. Throws an seal::EmptyCollectionException
if the vector is empty.
Implements seal::Collection< T >.