Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Types | Protected Attributes
Saf::Collection::StaticArray< N, T > Class Template Reference

Class representing a static array of N elements of the same data type. More...

#include <StaticArray.h>

Inheritance diagram for Saf::Collection::StaticArray< N, T >:
Saf::Math::Algebra::Vector< N, T >

List of all members.

Public Types

typedef const T * ConstIterator
typedef T * Iterator

Public Member Functions

 StaticArray ()
 Constructor.
 StaticArray (const T &val)
 Constructor.
 StaticArray (const T &v1, const T &v2)
 Constructor applicable to arrays of 2 elements.
 StaticArray (const T &v1, const T &v2, const T &v3)
 Constructor applicable to arrays of 3 elements.
 StaticArray (const T &v1, const T &v2, const T &v3, const T &v4)
 Constructor applicable to arrays of 4 elements.
 StaticArray (const MyType &t)
 Copy constructor.
Iterator Back ()
 Iterator to the last element.
ConstIterator Back () const
 Iterator to the last element.
Iterator Begin ()
 Iterator to the first element.
ConstIterator Begin () const
 Iterator to the first element.
Size Elements () const
 Get the size of the array.
Iterator End ()
 Iterator one after the last element.
ConstIterator End () const
 Iterator one after the last element.
Iterator Front ()
 Iterator to the first element.
ConstIterator Front () const
 Iterator to the first element.
bool operator!= (const MyType &t) const
 Not equal to operator.
MyTypeoperator= (const MyType &t)
 Assignment operator.
bool operator== (const MyType &t) const
 Equal to operator.
const T & operator[] (Size i) const
 Subscript operator.
T & operator[] (Size i)
 Subscript operator.
MyTypeSet (const T &v1, const T &v2)
 Set the values of elements in an array of size 2.
MyTypeSet (const T &v1, const T &v2, const T &v3)
 Set the values of elements in an array of size 3.
MyTypeSet (const T &v1, const T &v2, const T &v3, const T &v4)
 Set the values of elements in an array of size 4.

Protected Types

typedef StaticArray< N, T > MyType

Protected Attributes

m_data [N]
 Data container.

Detailed Description

template<Size N, class T>
class Saf::Collection::StaticArray< N, T >

Class representing a static array of N elements of the same data type.

The size of the array cannot be changed during its lifetime. However, its possible to freely access the individual elements and change their values.

Template Parameters:
NNumber of elements (size of the array).
TData type.

Member Typedef Documentation

template<Size N, class T>
typedef const T* Saf::Collection::StaticArray< N, T >::ConstIterator
template<Size N, class T>
typedef T* Saf::Collection::StaticArray< N, T >::Iterator
template<Size N, class T>
typedef StaticArray<N,T> Saf::Collection::StaticArray< N, T >::MyType [protected]

Constructor & Destructor Documentation

template<Size N, class T>
Saf::Collection::StaticArray< N, T >::StaticArray ( ) [inline]

Constructor.

All elements are initialized using their default constructor.

template<Size N, class T>
Saf::Collection::StaticArray< N, T >::StaticArray ( const T &  val) [inline, explicit]

Constructor.

Initializes all elements with a value val.

template<Size N, class T>
Saf::Collection::StaticArray< N, T >::StaticArray ( const T &  v1,
const T &  v2 
) [inline]

Constructor applicable to arrays of 2 elements.

template<Size N, class T>
Saf::Collection::StaticArray< N, T >::StaticArray ( const T &  v1,
const T &  v2,
const T &  v3 
) [inline]

Constructor applicable to arrays of 3 elements.

template<Size N, class T>
Saf::Collection::StaticArray< N, T >::StaticArray ( const T &  v1,
const T &  v2,
const T &  v3,
const T &  v4 
) [inline]

Constructor applicable to arrays of 4 elements.

template<Size N, class T>
Saf::Collection::StaticArray< N, T >::StaticArray ( const MyType t) [inline]

Copy constructor.


Member Function Documentation

template<Size N, class T>
Iterator Saf::Collection::StaticArray< N, T >::Back ( ) [inline]

Iterator to the last element.

template<Size N, class T>
ConstIterator Saf::Collection::StaticArray< N, T >::Back ( ) const [inline]

Iterator to the last element.

template<Size N, class T>
Iterator Saf::Collection::StaticArray< N, T >::Begin ( ) [inline]

Iterator to the first element.

template<Size N, class T>
ConstIterator Saf::Collection::StaticArray< N, T >::Begin ( ) const [inline]

Iterator to the first element.

template<Size N, class T>
Size Saf::Collection::StaticArray< N, T >::Elements ( ) const [inline]

Get the size of the array.

template<Size N, class T>
Iterator Saf::Collection::StaticArray< N, T >::End ( ) [inline]

Iterator one after the last element.

template<Size N, class T>
ConstIterator Saf::Collection::StaticArray< N, T >::End ( ) const [inline]

Iterator one after the last element.

template<Size N, class T>
Iterator Saf::Collection::StaticArray< N, T >::Front ( ) [inline]

Iterator to the first element.

template<Size N, class T>
ConstIterator Saf::Collection::StaticArray< N, T >::Front ( ) const [inline]

Iterator to the first element.

template<Size N, class T>
bool Saf::Collection::StaticArray< N, T >::operator!= ( const MyType t) const [inline]

Not equal to operator.

template<Size N, class T>
MyType& Saf::Collection::StaticArray< N, T >::operator= ( const MyType t) [inline]
template<Size N, class T>
bool Saf::Collection::StaticArray< N, T >::operator== ( const MyType t) const [inline]

Equal to operator.

template<Size N, class T>
const T& Saf::Collection::StaticArray< N, T >::operator[] ( Size  i) const [inline]

Subscript operator.

template<Size N, class T>
T& Saf::Collection::StaticArray< N, T >::operator[] ( Size  i) [inline]

Subscript operator.

template<Size N, class T>
MyType& Saf::Collection::StaticArray< N, T >::Set ( const T &  v1,
const T &  v2 
) [inline]

Set the values of elements in an array of size 2.

Remarks:
The size of the array must be 2. Otherwise throws an InvalidOperationException.
template<Size N, class T>
MyType& Saf::Collection::StaticArray< N, T >::Set ( const T &  v1,
const T &  v2,
const T &  v3 
) [inline]

Set the values of elements in an array of size 3.

Remarks:
The size of the array must be 3. Otherwise throws an InvalidOperationException.
template<Size N, class T>
MyType& Saf::Collection::StaticArray< N, T >::Set ( const T &  v1,
const T &  v2,
const T &  v3,
const T &  v4 
) [inline]

Set the values of elements in an array of size 4.

Remarks:
The size of the array must be 4. Otherwise throws an InvalidOperationException.

Member Data Documentation

template<Size N, class T>
T Saf::Collection::StaticArray< N, T >::m_data[N] [protected]

Data container.

Todo:
Make this private.

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