Overture  Version 25
Public Member Functions | Protected Member Functions | List of all members
ArraySimple< T > Class Template Reference

simple multidimensional arrays More...

#include <ArraySimple.h>

Inheritance diagram for ArraySimple< T >:
Inheritance graph
[legend]
Collaboration diagram for ArraySimple< T >:
Collaboration graph
[legend]

Public Member Functions

 ArraySimple ()
 default constructor
 
 ArraySimple (const ArraySimple< T > &a)
 copy constructor
 
template<int d1, int d2, int d3, int d4, int d5>
 ArraySimple (const ArraySimpleFixed< T, d1, d2, d3, d4, d5 > &a)
 copy from an ArraySimpleFixed
 
EXPLICIT ArraySimple (int n1)
 
EXPLICIT ArraySimple (int n1, int n2)
 
EXPLICIT ArraySimple (int n1, int n2, int n3)
 
EXPLICIT ArraySimple (int n1, int n2, int n3, int n4)
 
EXPLICIT ArraySimple (int n1, int n2, int n3, int n4, int n5)
 
 ~ArraySimple ()
 
int size () const
 
int size (const int &r_) const
 
int rank () const
 
void copy (const ArraySimple< T > &a)
 
void reference (ArraySimple< T > &a)
 
T * ptr ()
 
ArraySimple< T > & operator= (const ArraySimple< T > &a)
 
ArraySimple< T > & operator= (const T &a)
 
T & operator[] (const int &i)
 
const T & operator[] (const int &i) const
 
T & operator() (const int &i0)
 
const T & operator() (const int &i0) const
 
T & operator() (const int &i0, const int &i1)
 
const T & operator() (const int &i0, const int &i1) const
 
T & operator() (int i0, int i1, int i2)
 
const T & operator() (int i0, int i1, int i2) const
 
T & operator() (int i0, int i1, int i2, int i3)
 
const T & operator() (int i0, int i1, int i2, int i3) const
 
T & operator() (int i0, int i1, int i2, int i3, int i4)
 
const T & operator() (int i0, int i1, int i2, int i3, int i4) const
 
void resize (int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1)
 resize the array, copying the data
 
void redim (int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1)
 

Protected Member Functions

void allocate ()
 
void destroy ()
 
- Protected Member Functions inherited from AS_ReferenceCounting
 AS_ReferenceCounting (bool startCounting=TRUE)
 
 AS_ReferenceCounting (const AS_ReferenceCounting &ref)
 
 ~AS_ReferenceCounting ()
 
int numberOfReferences () const
 
AS_ReferenceCountingoperator= (const AS_ReferenceCounting &ref)
 
int breakReference ()
 
int decrement ()
 
int increment ()
 

Detailed Description

template<class T>
class ArraySimple< T >

simple multidimensional arrays

ArraySimple provides a simple array class for dealing with small arrays ( ~10x10 or so) Range checking is available by defining OV_DEBUG. The constructor sets the rank of an array which becomes immutable until a copy constructor is called or the array is destroyed. operator(), overloaded for the various ranks available (up to 4), provides Fortran like indexing. For arrays with a rank>1, it will be more efficient to compute the index inside the loop and use operator[] to access the element (no range checking is done, essentially the rank is ignored for []). This approach provides the compilers with a more easily optimizable loop.

Constructor & Destructor Documentation

template<class T>
ArraySimple< T >::ArraySimple ( )
inline

default constructor

create a blank array, suitable only for copying to

template<class T>
ArraySimple< T >::ArraySimple ( const ArraySimple< T > &  a)
inline

copy constructor

template<class T>
template<int d1, int d2, int d3, int d4, int d5>
ArraySimple< T >::ArraySimple ( const ArraySimpleFixed< T, d1, d2, d3, d4, d5 > &  a)
inline

copy from an ArraySimpleFixed

template<class T>
EXPLICIT ArraySimple< T >::ArraySimple ( int  n1)
inline
template<class T>
EXPLICIT ArraySimple< T >::ArraySimple ( int  n1,
int  n2 
)
inline
template<class T>
EXPLICIT ArraySimple< T >::ArraySimple ( int  n1,
int  n2,
int  n3 
)
inline
template<class T>
EXPLICIT ArraySimple< T >::ArraySimple ( int  n1,
int  n2,
int  n3,
int  n4 
)
inline
template<class T>
EXPLICIT ArraySimple< T >::ArraySimple ( int  n1,
int  n2,
int  n3,
int  n4,
int  n5 
)
inline
template<class T>
ArraySimple< T >::~ArraySimple ( )
inline

Member Function Documentation

template<class T>
void ArraySimple< T >::allocate ( )
inlineprotected
template<class T>
void ArraySimple< T >::copy ( const ArraySimple< T > &  a)
inline
template<class T>
void ArraySimple< T >::destroy ( )
inlineprotected
template<class T>
T& ArraySimple< T >::operator() ( const int &  i0)
inline
template<class T>
const T& ArraySimple< T >::operator() ( const int &  i0) const
inline
template<class T>
T& ArraySimple< T >::operator() ( const int &  i0,
const int &  i1 
)
inline
template<class T>
const T& ArraySimple< T >::operator() ( const int &  i0,
const int &  i1 
) const
inline
template<class T>
T& ArraySimple< T >::operator() ( int  i0,
int  i1,
int  i2 
)
inline
template<class T>
const T& ArraySimple< T >::operator() ( int  i0,
int  i1,
int  i2 
) const
inline
template<class T>
T& ArraySimple< T >::operator() ( int  i0,
int  i1,
int  i2,
int  i3 
)
inline
template<class T>
const T& ArraySimple< T >::operator() ( int  i0,
int  i1,
int  i2,
int  i3 
) const
inline
template<class T>
T& ArraySimple< T >::operator() ( int  i0,
int  i1,
int  i2,
int  i3,
int  i4 
)
inline
template<class T>
const T& ArraySimple< T >::operator() ( int  i0,
int  i1,
int  i2,
int  i3,
int  i4 
) const
inline
template<class T>
ArraySimple<T>& ArraySimple< T >::operator= ( const ArraySimple< T > &  a)
inline
template<class T>
ArraySimple<T>& ArraySimple< T >::operator= ( const T &  a)
inline
template<class T>
T& ArraySimple< T >::operator[] ( const int &  i)
inline
template<class T>
const T& ArraySimple< T >::operator[] ( const int &  i) const
inline
template<class T>
T* ArraySimple< T >::ptr ( )
inline
template<class T>
int ArraySimple< T >::rank ( ) const
inline
template<class T>
void ArraySimple< T >::redim ( int  n1,
int  n2 = -1,
int  n3 = -1,
int  n4 = -1,
int  n5 = -1 
)
inline
template<class T>
void ArraySimple< T >::reference ( ArraySimple< T > &  a)
inline
template<class T>
void ArraySimple< T >::resize ( int  n1,
int  n2 = -1,
int  n3 = -1,
int  n4 = -1,
int  n5 = -1 
)
inline
template<class T>
int ArraySimple< T >::size ( ) const
inline
template<class T>
int ArraySimple< T >::size ( const int &  r_) const
inline

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