|
The blo Library
|
1D array. More...
#include <Array1D.h>
Public Member Functions | |
| Array1D ()=default | |
| Default constructor. | |
| Array1D (int len) | |
| Constructs array of specified size. | |
| Array1D (int len, const T &val) | |
| Constructs array of specified size and value. | |
| Array1D (const T *pSrc, int len) | |
| Constructs array that is a copy of specified array. | |
| Array1D (const T *pSrc, int srcStride2, int len) | |
| Constructs array that is a copy of specified array. | |
| Array1D (const Array1D &rhs) | |
| Copy constructor. | |
| Array1D (Array1D &&rhs) noexcept | |
| Move constructor. | |
| virtual | ~Array1D () |
| Destructor. | |
| Array1D & | operator= (const Array1D &rhs) |
| Copy assignment operator. | |
| Array1D & | operator= (Array1D &&rhs) noexcept |
| Move assignment operator. | |
| T & | operator[] (int index) |
| Index array element. | |
| const T & | operator[] (int index) const |
| Index array element. | |
| bool | empty () const |
| Tests if the array is empty. | |
| void | resize (int len) |
| Resizes array. | |
| void | clear () |
| Resizes array to zero length. | |
| int | size () const |
| Number of elements in the array. | |
| int | len () const |
| Length of the array. | |
| T * | ptrData () |
| Retrieves the pointer to the beginning of the array. | |
| const T * | ptrData () const |
| Retrieves the pointer to the beginning of the array. | |
| void | swap (Array1D &rhs) |
| Swaps this array with another one. | |
| void | set (const T &val) |
| Sets array elements to a value. | |
Static Public Member Functions | |
| static int | stride2 () |
| Stride in bytes between the elements in the array. | |
1D array.
| T | Data type. |
|
default |
Default constructor.
|
explicit |
Constructs array of specified size.
| len | Array length. |
| blo::Array1D< T >::Array1D | ( | int | len, |
| const T & | val | ||
| ) |
Constructs array of specified size and value.
| len | Array length. |
| val | Constant value to assign to each element in the array. |
| blo::Array1D< T >::Array1D | ( | const T * | pSrc, |
| int | len | ||
| ) |
Constructs array that is a copy of specified array.
| pSrc | Pointer to the source array. |
| len | Array length. |
| blo::Array1D< T >::Array1D | ( | const T * | pSrc, |
| int | srcStride2, | ||
| int | len | ||
| ) |
Constructs array that is a copy of specified array.
| pSrc | Pointer to the source array. |
| srcStride2 | Stride in bytes between the elements in the source array. |
| len | Array length. |
| blo::Array1D< T >::Array1D | ( | const Array1D< T > & | rhs | ) |
Copy constructor.
|
noexcept |
Move constructor.
|
virtual |
Destructor.
| void blo::Array1D< T >::clear | ( | ) |
Resizes array to zero length.
| bool blo::Array1D< T >::empty | ( | ) | const |
Tests if the array is empty.
| int blo::Array1D< T >::len | ( | ) | const |
Length of the array.
|
noexcept |
Move assignment operator.
| Array1D & blo::Array1D< T >::operator= | ( | const Array1D< T > & | rhs | ) |
Copy assignment operator.
| T & blo::Array1D< T >::operator[] | ( | int | index | ) |
Index array element.
| index | Index of the array. |
| const T & blo::Array1D< T >::operator[] | ( | int | index | ) | const |
Index array element.
| index | Index of the array. |
| T * blo::Array1D< T >::ptrData | ( | ) |
Retrieves the pointer to the beginning of the array.
| const T * blo::Array1D< T >::ptrData | ( | ) | const |
Retrieves the pointer to the beginning of the array.
| void blo::Array1D< T >::resize | ( | int | len | ) |
Resizes array.
| len | Length to resize array to. |
| void blo::Array1D< T >::set | ( | const T & | val | ) |
Sets array elements to a value.
| val | Constant value to assign to each element in the array. |
| int blo::Array1D< T >::size | ( | ) | const |
Number of elements in the array.
|
static |
Stride in bytes between the elements in the array.
| void blo::Array1D< T >::swap | ( | Array1D< T > & | rhs | ) |
Swaps this array with another one.