Array< base > Class Template Reference

This can be used to make arrays out of anything. More...

#include <array.h>

Inheritance diagram for Array< base >:

MakeArray< base >

List of all members.

Public Member Functions

 Array ()
 Array (Index n)
 Array (Index n, const base &fill)
 Constructor filling with constant value.
 Array (const Array< base > &A)
Arrayoperator= (base x)
 Assignment from base type (fill entire Array with this value).
Arrayoperator= (const Array< base > &A)
 Assignment from another Array.
Index nelem () const
 Number of elements.
const base & operator[] (Index n) const
 Constant index operator.
base & operator[] (Index n)
 Non-constant index operator.


Detailed Description

template<class base>
class Array< base >

This can be used to make arrays out of anything.

A simple define does not do for this, since I have to implement member functions like nelem, in order to be consistent with Vector.

Because constructors are not inherited, I have to re-define all costructors. In addition to the constructors here, explicit constructors are provided by the derived class MakeArray.

Definition at line 47 of file array.h.


Constructor & Destructor Documentation

template<class base>
Array< base >::Array (  )  [inline]

Definition at line 51 of file array.h.

template<class base>
Array< base >::Array ( Index  n  )  [inline, explicit]

Definition at line 52 of file array.h.

template<class base>
Array< base >::Array ( Index  n,
const base &  fill 
) [inline]

Constructor filling with constant value.

Definition at line 74 of file array.h.

template<class base>
Array< base >::Array ( const Array< base > &  A  )  [inline]

Definition at line 54 of file array.h.


Member Function Documentation

template<class base>
Array< base > & Array< base >::operator= ( base  x  )  [inline]

Assignment from base type (fill entire Array with this value).

Definition at line 84 of file array.h.

template<class base>
Array< base > & Array< base >::operator= ( const Array< base > &  A  )  [inline]

Assignment from another Array.

The Behavior of this one is a bit special: If the size of the target Array is 0 then it will be automatically resized to match (this is needed to have the correct initialization for constructed classes that use the assignment operator to initialize their data).

In all other cases sizes must match exactly!

Definition at line 101 of file array.h.

template<class base>
Index Array< base >::nelem (  )  const [inline]

Number of elements.

Definition at line 115 of file array.h.

template<class base>
const base & Array< base >::operator[] ( Index  n  )  const [inline]

Constant index operator.

We redifine this here so that we can have range checking by assert.

Definition at line 125 of file array.h.

template<class base>
base & Array< base >::operator[] ( Index  n  )  [inline]

Non-constant index operator.

We redifine this here so that we can have range checking by assert.

Definition at line 135 of file array.h.


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

Generated on Wed Feb 4 08:17:27 2009 for ARTS by  doxygen 1.5.6