Array of type T.
More...
#include <IArray.h>
|
| IArray () |
| Default constructor. More...
|
|
| IArray (size_t max_num_values) |
| Constructor: initializes an array which can contain up to max_num_points values. More...
|
|
size_t | max_num_values () const |
| Maximum number of values which can be stored in this array. More...
|
|
virtual | ~IArray ()=default |
| Default virtual destructor. More...
|
|
size_t | num_values () const |
| Number of values currently stored in the array. More...
|
|
bool | push_back (const T &val) |
| Append the passed argument to the end of the array if there is room. More...
|
|
void | clear () |
| Clear all the points from the array. More...
|
|
bool | overflow () const |
| Did we lose some values because the array is too small? More...
|
|
virtual T * | buffer () const =0 |
| Pointer to the first element of the array. More...
|
|
virtual T & | at (size_t index) const |
| Reference to the element of the array located at the given index. More...
|
|
void | resize (size_t num) |
| Resizes the array to contain "num" elements. More...
|
|
template<class T>
class arm_compute::IArray< T >
Array of type T.
Definition at line 36 of file IArray.h.
◆ IArray() [1/2]
Default constructor.
Definition at line 40 of file IArray.h.
40 : _num_values(0), _max_size(0){};
◆ IArray() [2/2]
IArray |
( |
size_t |
max_num_values | ) |
|
|
inline |
Constructor: initializes an array which can contain up to max_num_points values.
- Parameters
-
[in] | max_num_values | Maximum number of values the array will be able to stored |
Definition at line 45 of file IArray.h.
◆ ~IArray()
Default virtual destructor.
◆ at()
virtual T& at |
( |
size_t |
index | ) |
const |
|
inlinevirtual |
Reference to the element of the array located at the given index.
- Parameters
-
[in] | index | Index of the element |
- Returns
- A reference to the element of the array located at the given index.
Definition at line 111 of file IArray.h.
Referenced by IArray< cl_int >::push_back().
◆ buffer()
virtual T* buffer |
( |
| ) |
const |
|
pure virtual |
◆ clear()
Clear all the points from the array.
Definition at line 85 of file IArray.h.
◆ max_num_values()
size_t max_num_values |
( |
| ) |
const |
|
inline |
◆ num_values()
size_t num_values |
( |
| ) |
const |
|
inline |
Number of values currently stored in the array.
- Returns
- Number of values currently stored in the array or max_num_values + 1 if the array is overflowed.
Definition at line 62 of file IArray.h.
◆ overflow()
Did we lose some values because the array is too small?
- Returns
- True if we tried to add a value using push_back() but there wasn't any room left to store it. False if all the values were successfully added to the array.
Definition at line 94 of file IArray.h.
◆ push_back()
bool push_back |
( |
const T & |
val | ) |
|
|
inline |
Append the passed argument to the end of the array if there is room.
- Parameters
-
[in] | val | Value to add to the array. |
- Returns
- True if the point was successfully added to the array. False if the array is full and the point couldn't be added.
Definition at line 72 of file IArray.h.
80 at(_num_values) = val;
◆ resize()
void resize |
( |
size_t |
num | ) |
|
|
inline |
Resizes the array to contain "num" elements.
If "num" is smaller than the maximum array size, the content is reduced to its first "num" elements, "num" elements can't be bigger than the maximum number of values which can be stored in this array.
- Parameters
-
[in] | num | The new array size in number of elements |
Definition at line 122 of file IArray.h.
The documentation for this class was generated from the following file: