#include <arrays.h>
Public Member Functions | |
OneDArray () | |
Default constructor. | |
OneDArray (const int len) | |
'Length' constructor. | |
OneDArray (const Range &r) | |
Range constructor. | |
~OneDArray () | |
Destructor. | |
OneDArray (const OneDArray< T > &cpy) | |
Copy constructor. | |
OneDArray< T > & | operator= (const OneDArray< T > &rhs) |
Assignment=. | |
void | Resize (int l) |
Resize the array, throwing away the current data. | |
T & | operator[] (const int pos) |
Element access. | |
const T & | operator[] (const int pos) const |
Element access. | |
int | Length () const |
Returns the length of the array. | |
int | First () const |
Returns the index of the first element. | |
int | Last () const |
Returns the index of the last element. |
A template class for one-D arrays. Can be used wherever built-in arrays are used, and eliminates the need for explicit memory (de-)allocation. Also supports arrays not based at zero.
Definition at line 88 of file arrays.h.
|
Default constructor. Default constructor produces an empty array. |
|
'Length' constructor. Length constructor produces a zero-based array. |
|
Range constructor. Range constructor produces an array with values indexed within the range parameters.
|
|
Destructor. Destructor frees the data allocated in the constructors. |
|
Copy constructor. Copy constructor copies both data and metadata. Definition at line 184 of file arrays.h. References dirac::OneDArray< T >::m_first, dirac::OneDArray< T >::m_last, and dirac::OneDArray< T >::m_ptr. |
|
Assignment=. Assignment= assigns both data and metadata. Definition at line 199 of file arrays.h. References dirac::OneDArray< T >::m_first, dirac::OneDArray< T >::m_last, dirac::OneDArray< T >::m_length, and dirac::OneDArray< T >::m_ptr. |