|
The blo Library
|
2D array. More...
#include <Array2D.h>
Public Member Functions | |
| Array2D ()=default | |
| Default constructor. | |
| Array2D (int rows, int columns) | |
| Constructs array of specified size. | |
| Array2D (int rows, int columns, const T &val) | |
| Constructs array of specified size and value. | |
| Array2D (const T *pSrc, int srcStride1, int rows, int columns) | |
| Constructs array that is a copy of specified array. | |
| Array2D (const T *pSrc, int srcStride1, int srcStride2, int rows, int columns) | |
| Constructs array that is a copy of specified array. | |
| Array2D (const Array2D &rhs) | |
| Copy constructor. | |
| Array2D (Array2D &&rhs) noexcept | |
| Move constructor. | |
| virtual | ~Array2D () |
| Destructor. | |
| Array2D & | operator= (const Array2D &rhs) |
| Copy assignment operator. | |
| Array2D & | operator= (Array2D &&rhs) noexcept |
| Move assignment operator. | |
| T * | operator[] (int row) |
| Index array row. | |
| const T * | operator[] (int row) const |
| Index array row. | |
| bool | empty () const |
| Tests if the array is empty. | |
| void | resize (int rows, int columns) |
| Resizes array. | |
| void | clear () |
| Resizes array to zero rows and zero columns. | |
| int | rows () const |
| Number of rows in the array. | |
| int | height () const |
| Height of the array. | |
| int | columns () const |
| Number of columns in the array. | |
| int | width () const |
| Width 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. | |
| int | stride1 () const |
| Stride in bytes between the rows in the array. | |
| int | step () const |
| Step in bytes between the rows in the array. | |
| int | ld () const |
| Leading dimension between the rows in the array. | |
| void | swap (Array2D &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. | |
2D array.
| T | Data type. |
|
default |
Default constructor.
| blo::Array2D< T >::Array2D | ( | int | rows, |
| int | columns | ||
| ) |
Constructs array of specified size.
| rows | Number of rows in the array. |
| columns | Number of columns in the array. |
| blo::Array2D< T >::Array2D | ( | int | rows, |
| int | columns, | ||
| const T & | val | ||
| ) |
Constructs array of specified size and value.
| rows | Number of rows in the array. |
| columns | Number of columns in the array. |
| val | Constant value to assign to each element in the array. |
| blo::Array2D< T >::Array2D | ( | const T * | pSrc, |
| int | srcStride1, | ||
| int | rows, | ||
| int | columns | ||
| ) |
Constructs array that is a copy of specified array.
| pSrc | Pointer to the source array. |
| srcStride1 | Stride in bytes between the rows in the source array. |
| rows | Number of rows in the array. |
| columns | Number of columns in the array. |
| blo::Array2D< T >::Array2D | ( | const T * | pSrc, |
| int | srcStride1, | ||
| int | srcStride2, | ||
| int | rows, | ||
| int | columns | ||
| ) |
Constructs array that is a copy of specified array.
| pSrc | Pointer to the source array. |
| srcStride1 | Stride in bytes between the rows in the source array. |
| srcStride2 | Stride in bytes between the elements in the source array. |
| rows | Number of rows in the array. |
| columns | Number of columns in the array. |
| blo::Array2D< T >::Array2D | ( | const Array2D< T > & | rhs | ) |
Copy constructor.
|
noexcept |
Move constructor.
|
virtual |
Destructor.
| void blo::Array2D< T >::clear | ( | ) |
Resizes array to zero rows and zero columns.
| int blo::Array2D< T >::columns | ( | ) | const |
Number of columns in the array.
| bool blo::Array2D< T >::empty | ( | ) | const |
Tests if the array is empty.
| int blo::Array2D< T >::height | ( | ) | const |
Height of the array.
| int blo::Array2D< T >::ld | ( | ) | const |
Leading dimension between the rows in the array.
|
noexcept |
Move assignment operator.
| Array2D & blo::Array2D< T >::operator= | ( | const Array2D< T > & | rhs | ) |
Copy assignment operator.
| T * blo::Array2D< T >::operator[] | ( | int | row | ) |
Index array row.
| row | Row of the array. |
| const T * blo::Array2D< T >::operator[] | ( | int | row | ) | const |
Index array row.
| row | Row of the array. |
| T * blo::Array2D< T >::ptrData | ( | ) |
Retrieves the pointer to the beginning of the array.
| const T * blo::Array2D< T >::ptrData | ( | ) | const |
Retrieves the pointer to the beginning of the array.
| void blo::Array2D< T >::resize | ( | int | rows, |
| int | columns | ||
| ) |
Resizes array.
| rows | Rows to resize array to. |
| columns | Columns to resize array to. |
| int blo::Array2D< T >::rows | ( | ) | const |
Number of rows in the array.
| void blo::Array2D< T >::set | ( | const T & | val | ) |
Sets array elements to a value.
| val | Constant value to assign to each element in the array. |
| int blo::Array2D< T >::step | ( | ) | const |
Step in bytes between the rows in the array.
| int blo::Array2D< T >::stride1 | ( | ) | const |
Stride in bytes between the rows in the array.
|
static |
Stride in bytes between the elements in the array.
| void blo::Array2D< T >::swap | ( | Array2D< T > & | rhs | ) |
Swaps this array with another one.
| int blo::Array2D< T >::width | ( | ) | const |
Width of the array.