dune-fem  2.4.1-rc
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Dune::Fem::FixedSizeArray< Element, Size > Class Template Reference

standard array with fixed size More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/storage/array.hh>

Inheritance diagram for Dune::Fem::FixedSizeArray< Element, Size >:
Inheritance graph

Public Types

typedef Element ElementType
 type of the array elements More...
 
typedef FixedSizeArray< Element, Size > ArrayType
 type of the implementation (Barton-Nackman) More...
 
typedef ArrayDefaultTraits< ElementType, ArrayTypeTraits
 type of the traits More...
 
typedef Traits::ConstIteratorType ConstIteratorType
 type of constant iterator More...
 
typedef Traits::IteratorType IteratorType
 type of (non-constant) iterator More...
 
typedef ThisType ArrayInterfaceType
 type of this interface More...
 
typedef ElementType value_type
 make consistent with std::vector More...
 
typedef ConstIteratorType const_iterator
 type of constant iterator More...
 
typedef IteratorType iterator
 type of (non-constant) iterator More...
 
typedef unsigned int size_type
 type of unsigned integral type of indexing More...
 

Public Member Functions

 FixedSizeArray ()
 default constructor More...
 
 FixedSizeArray (const ElementType &element)
 initializing constructor More...
 
 FixedSizeArray (const ThisType &other)
 copy constructor More...
 
const ElementTypeoperator[] (unsigned int index) const
 access an array element More...
 
ElementTypeoperator[] (unsigned int index)
 access an array element More...
 
unsigned int size () const
 
void assign (const ElementType &element)
 fill the array with copies of an element More...
 
void assign (const ArrayInterface< T > &other)
 copy another array to this one More...
 
ConstIteratorType begin () const
 obtain begin iterator More...
 
IteratorType begin ()
 obtain begin iterator More...
 
ConstIteratorType end () const
 obtain end iterator More...
 
IteratorType end ()
 obtain end iterator More...
 

Static Public Attributes

static const unsigned int fixedSize = Size
 compile time constant size of the array More...
 

Protected Member Functions

const ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayTypeasImp () const
 
ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayTypeasImp ()
 

Static Protected Member Functions

static const ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayTypeasImp (const ThisType &other)
 
static ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayTypeasImp (ThisType &other)
 

Protected Attributes

ElementType elements_ [fixedSize]
 

Detailed Description

template<class Element, unsigned int Size>
class Dune::Fem::FixedSizeArray< Element, Size >

standard array with fixed size

This array's size is a compile time constant. Hence, the memory needed to store the array elements can be provided within the object. There is no need to allocate it dynamically.

Basically, FixedSizeArray is just a standard C++ array. It's strength lies in the following two properties:

Parameters
Elementtype of the array elements (must be default constructable)
Sizenumber of elements in the array

Member Typedef Documentation

typedef ThisType Dune::Fem::ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > >::ArrayInterfaceType
inherited

type of this interface

typedef FixedSizeArray< Element, Size > Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::ArrayType
inherited

type of the implementation (Barton-Nackman)

type of constant iterator

typedef Traits :: ConstIteratorType Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::ConstIteratorType
inherited

type of constant iterator

template<class Element , unsigned int Size>
typedef Element Dune::Fem::FixedSizeArray< Element, Size >::ElementType

type of the array elements

typedef IteratorType Dune::Fem::ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > >::iterator
inherited

type of (non-constant) iterator

typedef Traits :: IteratorType Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::IteratorType
inherited

type of (non-constant) iterator

typedef unsigned int Dune::Fem::ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > >::size_type
inherited

type of unsigned integral type of indexing

typedef ArrayDefaultTraits< ElementType, ArrayType > Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::Traits
inherited

type of the traits

typedef ElementType Dune::Fem::ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > >::value_type
inherited

make consistent with std::vector

Constructor & Destructor Documentation

template<class Element , unsigned int Size>
Dune::Fem::FixedSizeArray< Element, Size >::FixedSizeArray ( )
inline

default constructor

The array elements are not initialized with this constructor

template<class Element , unsigned int Size>
Dune::Fem::FixedSizeArray< Element, Size >::FixedSizeArray ( const ElementType element)
inlineexplicit

initializing constructor

Initializes the entire array with a default value

Parameters
[in]elementdefault value

References Dune::Fem::ArrayInterface< AT >::assign().

template<class Element , unsigned int Size>
Dune::Fem::FixedSizeArray< Element, Size >::FixedSizeArray ( const ThisType other)
inline

copy constructor

Parameters
[in]otherarray to copy

References Dune::Fem::ArrayInterface< AT >::assign().

Member Function Documentation

static const ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType & Dune::Fem::BartonNackmanInterface< ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > > , ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType >::asImp ( const ThisType other)
inlinestaticprotectedinherited
static ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType & Dune::Fem::BartonNackmanInterface< ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > > , ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType >::asImp ( ThisType other)
inlinestaticprotectedinherited
const ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType & Dune::Fem::BartonNackmanInterface< ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > > , ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType >::asImp ( ) const
inlineprotectedinherited
ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType & Dune::Fem::BartonNackmanInterface< ArrayInterface< ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > > > , ArrayDefaultTraits< Element, FixedSizeArray< Element, Size > >::ArrayType >::asImp ( )
inlineprotectedinherited
void Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::assign ( const ElementType element)
inlineinherited

fill the array with copies of an element

Parameters
[in]elementelement wich shall be copied into every array entry
void Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::assign ( const ArrayInterface< T > &  other)
inlineinherited

copy another array to this one

Copies the data from another array to this one. Both arrays must be of the same size.

Parameters
[in]otherarray to copy
ConstIteratorType Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::begin ( ) const
inlineinherited

obtain begin iterator

Returns
an iterator pointing to the first array element
IteratorType Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::begin ( )
inlineinherited

obtain begin iterator

Returns
an iterator pointing to the first array element
ConstIteratorType Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::end ( ) const
inlineinherited

obtain end iterator

Returns
an iterator pointing behind the last array element
IteratorType Dune::Fem::ArrayDefault< Element , FixedSizeArray< Element, Size > >::end ( )
inlineinherited

obtain end iterator

Returns
an iterator pointing behind the last array element
template<class Element , unsigned int Size>
const ElementType& Dune::Fem::FixedSizeArray< Element, Size >::operator[] ( unsigned int  index) const
inline

access an array element

Parameters
[in]indexindex of the array element to access
Returns
a const reference to the array element
template<class Element , unsigned int Size>
ElementType& Dune::Fem::FixedSizeArray< Element, Size >::operator[] ( unsigned int  index)
inline

access an array element

Parameters
[in]indexindex of the array element to access
Returns
a reference to the array element
template<class Element , unsigned int Size>
unsigned int Dune::Fem::FixedSizeArray< Element, Size >::size ( ) const
inline

obtain the size of the array

Returns
the size of the array

Member Data Documentation

template<class Element , unsigned int Size>
ElementType Dune::Fem::FixedSizeArray< Element, Size >::elements_[fixedSize]
protected
template<class Element , unsigned int Size>
const unsigned int Dune::Fem::FixedSizeArray< Element, Size >::fixedSize = Size
static

compile time constant size of the array


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