OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Protected Attributes | List of all members
Array1D< T > Class Template Reference

One-dimensional array. More...

#include <Array1D.h>

Inheritance diagram for Array1D< T >:
Inheritance graph
[legend]

Public Types

typedef T value_type
 The value type of this array. More...
 
typedef T * iterator
 The iterator type for the array. More...
 
typedef const T * const_iterator
 The iterator type for constant array. More...
 

Public Member Functions

 Array1D ()
 Default constructor. More...
 
 Array1D (int n)
 Constructor. More...
 
 Array1D (int n, const T &t)
 Constructor. More...
 
 Array1D (const Array1D< T > &)
 
 ~Array1D ()
 
Array1D< T > & operator= (const Array1D< T > &)
 
T & operator() (int n)
 Get reference to element. More...
 
const T & operator() (int n) const
 Get value of element. More...
 
T & operator[] (int)
 Get reference to element. More...
 
const T & operator[] (int) const
 Get value of element. More...
 
iterator begin ()
 Get beginning of data. More...
 
iterator end ()
 Get end of data. More...
 
const_iterator begin () const
 Get beginning of data. More...
 
const_iterator end () const
 Get end of data. More...
 
int size () const
 Get array size. More...
 
void resize (int size)
 Change array size. More...
 

Protected Attributes

int len
 
T * data
 

Detailed Description

template<class T>
class Array1D< T >

One-dimensional array.

Definition at line 36 of file Array1D.h.

Member Typedef Documentation

◆ const_iterator

template<class T >
typedef const T* Array1D< T >::const_iterator

The iterator type for constant array.

Definition at line 47 of file Array1D.h.

◆ iterator

template<class T >
typedef T* Array1D< T >::iterator

The iterator type for the array.

Definition at line 44 of file Array1D.h.

◆ value_type

template<class T >
typedef T Array1D< T >::value_type

The value type of this array.

Definition at line 41 of file Array1D.h.

Constructor & Destructor Documentation

◆ Array1D() [1/4]

template<class T >
Array1D< T >::Array1D

Default constructor.

Definition at line 127 of file Array1D.h.

◆ Array1D() [2/4]

template<class T >
Array1D< T >::Array1D ( int  n)
explicit

Constructor.

Definition at line 140 of file Array1D.h.

◆ Array1D() [3/4]

template<class T >
Array1D< T >::Array1D ( int  n,
const T &  t 
)

Constructor.

Definition at line 146 of file Array1D.h.

References Array1D< T >::begin(), and Array1D< T >::end().

Here is the call graph for this function:

◆ Array1D() [4/4]

template<class T >
Array1D< T >::Array1D ( const Array1D< T > &  array)

Definition at line 133 of file Array1D.h.

References Array1D< T >::begin(), and Array1D< T >::end().

Here is the call graph for this function:

◆ ~Array1D()

template<class T >
Array1D< T >::~Array1D

Definition at line 153 of file Array1D.h.

Member Function Documentation

◆ begin() [1/2]

template<class T >
Array1D< T >::iterator Array1D< T >::begin

◆ begin() [2/2]

template<class T >
Array1D< T >::const_iterator Array1D< T >::begin

Get beginning of data.

Definition at line 216 of file Array1D.h.

◆ end() [1/2]

template<class T >
Array1D< T >::iterator Array1D< T >::end

◆ end() [2/2]

template<class T >
Array1D< T >::const_iterator Array1D< T >::end

Get end of data.

Definition at line 222 of file Array1D.h.

◆ operator()() [1/2]

template<class T >
T & Array1D< T >::operator() ( int  n)

Get reference to element.

Definition at line 186 of file Array1D.h.

◆ operator()() [2/2]

template<class T >
const T & Array1D< T >::operator() ( int  n) const

Get value of element.

Definition at line 195 of file Array1D.h.

◆ operator=()

template<class T >
Array1D< T > & Array1D< T >::operator= ( const Array1D< T > &  rhs)

Definition at line 159 of file Array1D.h.

References Array1D< T >::begin(), begin(), Array1D< T >::end(), Array1D< T >::len, and Attrib::Legacy::Distribution::T.

Referenced by Vector< T >::operator=().

Here is the call graph for this function:

◆ operator[]() [1/2]

template<class T >
T & Array1D< T >::operator[] ( int  i)
inline

Get reference to element.

Definition at line 174 of file Array1D.h.

◆ operator[]() [2/2]

template<class T >
const T & Array1D< T >::operator[] ( int  i) const
inline

Get value of element.

Definition at line 180 of file Array1D.h.

◆ resize()

template<class T >
void Array1D< T >::resize ( int  size)

Change array size.

Definition at line 234 of file Array1D.h.

References begin(), Hypervolume::n, and Attrib::Legacy::Distribution::T.

Here is the call graph for this function:

◆ size()

template<class T >
int Array1D< T >::size

Member Data Documentation

◆ data

template<class T >
T* Array1D< T >::data
protected

Definition at line 119 of file Array1D.h.

◆ len

template<class T >
int Array1D< T >::len
protected

Definition at line 116 of file Array1D.h.

Referenced by Array1D< T >::operator=().


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