ARTS  1.0.222
Public Member Functions | List of all members
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 >

Public Member Functions

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

Detailed Description

template<class base>
class Array< base >

This can be used to make arrays out of anything.

The type to use for all strings.

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.

This is just to have consistent notation for all the atomic ARTS types.

Definition at line 47 of file array.h.

Constructor & Destructor Documentation

◆ Array() [1/4]

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

Definition at line 51 of file array.h.

◆ Array() [2/4]

template<class base >
Array< base >::Array ( Index  n)
inlineexplicit

Definition at line 52 of file array.h.

◆ Array() [3/4]

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.

◆ Array() [4/4]

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

Definition at line 54 of file array.h.

Member Function Documentation

◆ nelem()

template<class base >
Index Array< base >::nelem
inline

Number of elements.

Definition at line 115 of file array.h.

◆ operator=() [1/2]

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.

◆ operator=() [2/2]

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.

◆ operator[]() [1/2]

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.

◆ operator[]() [2/2]

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.


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