seal::Array1D< T > Class Template Reference

#include <array1d.h>

Inheritance diagram for seal::Array1D< T >:

seal::Collection< T > seal::RandomAccess< T > seal::CellArray< DataType > seal::HexByte

List of all members.

Public Member Functions

 Array1D (void)
 Array1D (unsigned int length)
 Array1D (const Array1D< T > &v)
virtual ~Array1D ()
virtual unsigned int size (void) const
virtual AbstractIterator< T > * iteratorPtr (void) const
Array1D< T >::Iterator iterator (void) const
virtual void purge (void)
virtual bool isEmpty (void) const
virtual const T & operator[] (int index) const throw (OutOfRangeException<int>)
virtual T & operator[] (int index) throw (OutOfRangeException<int>)
void operator= (const Array1D< T > &v)
virtual T & first (void) throw (EmptyCollectionException)
virtual const T & first (void) const throw (EmptyCollectionException)
virtual T & last (void) throw (EmptyCollectionException)
virtual const T & last (void) const throw (EmptyCollectionException)

Classes

class  Iterator


Detailed Description

template<typename T>
class seal::Array1D< T >

This class encapsulates a 1-dimensional array. It provides an array indexing operator [] which facilitates indexed access to the array elements. This indexed access is protected from out of range accesses through suitable exceptions.

Constructor & Destructor Documentation

template<typename T>
seal::Array1D< T >::Array1D ( void   )  [inline]

Default Constructor. It initialises a vector of size zero. It is practically useless as one cannot resize the array after construction.

template<typename T>
seal::Array1D< T >::Array1D ( unsigned int  length  )  [inline]

This constructor initialises a vector with the specified size/length.

Parameters:
length An array of this size will be constructed.

template<typename T>
seal::Array1D< T >::Array1D ( const Array1D< T > &  v  )  [inline]

Copy constructor. It is only a reference copier.

template<typename T>
seal::Array1D< T >::~Array1D (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<typename T>
virtual unsigned int seal::Array1D< T >::size ( void   )  const [inline, virtual]

Returns the siza/lengthe of the array.

Implements seal::Collection< T >.

template<typename T>
virtual AbstractIterator<T>* seal::Array1D< T >::iteratorPtr ( void   )  const [inline, virtual]

Returns a pointer to an iterator of the array. This iterator can be used to iterate over the array elements starting from the element with index 0 to the last element in the array. The client of this function should be responsible of deleting the returned iterator object using delete.

Implements seal::Collection< T >.

template<typename T>
Array1D<T>::Iterator seal::Array1D< T >::iterator ( void   )  const [inline]

Returns the iterator of the array object. This iterator can be used to iterator over the array elements starting from the element with index 0 to the last element in the array.

template<typename T>
virtual void seal::Array1D< T >::purge ( void   )  [inline, virtual]

Deletes all the elements of the array. The size of the array will be zero after a call to this function. Note however that one cannot resize the array again to a non-zero size!

Implements seal::Collection< T >.

template<typename T>
virtual bool seal::Array1D< T >::isEmpty ( void   )  const [inline, virtual]

Returns true if the array size is zero. Else, it returns false for arrays of a non-zero size.

Implements seal::Collection< T >.

template<typename T>
const T & seal::Array1D< T >::operator[] ( int  index  )  const throw (OutOfRangeException<int>) [inline, virtual]

Array indexing operator. Throws OutOfRangeException<int> if an element with an invalid index is requested

Implements seal::RandomAccess< T >.

template<typename T>
T & seal::Array1D< T >::operator[] ( int  index  )  throw (OutOfRangeException<int>) [inline, virtual]

Array indexing operator. Throws OutOfRangeException<int> if an element with an invalid index is requested

Implements seal::RandomAccess< T >.

template<typename T>
void seal::Array1D< T >::operator= ( const Array1D< T > &  v  )  [inline]

Assignment operator. It is only a reference copier. That is, after the assignment, the left array and the right array will share the same data.

template<typename T>
T & seal::Array1D< T >::first ( void   )  throw (EmptyCollectionException) [inline, virtual]

Returns a reference to the first element in the array. Throws an seal::EmptyCollectionException if the array is empty.

Implements seal::Collection< T >.

template<typename T>
const T & seal::Array1D< T >::first ( void   )  const throw (EmptyCollectionException) [inline, virtual]

Returns a constant reference to the first element in the array. Throws an seal::EmptyCollectionException if the array is empty.

Implements seal::Collection< T >.

template<typename T>
T & seal::Array1D< T >::last ( void   )  throw (EmptyCollectionException) [inline, virtual]

Returns a reference to the last element in the array. Throws an seal::EmptyCollectionException if the array is empty.

Implements seal::Collection< T >.

template<typename T>
const T & seal::Array1D< T >::last ( void   )  const throw (EmptyCollectionException) [inline, virtual]

Returns a constant reference to the last element in the array. Throws an seal::EmptyCollectionException if the array is empty.

Implements seal::Collection< T >.


The documentation for this class was generated from the following file:

Generated on Sat May 16 21:35:20 2009 for SEAL by  doxygen 1.5.5