24 #ifndef ARM_COMPUTE_IARRAY_H 25 #define ARM_COMPUTE_IARRAY_H 40 : _num_values(0), _max_size(0) {};
46 : _num_values(0), _max_size(max_num_values)
81 at(_num_values) = val;
105 virtual T *
buffer()
const = 0;
112 virtual T &
at(
size_t index)
const void clear()
Clear all the points from the array.
bool overflow() const
Did we lose some values because the array is too small?
void resize(size_t num)
Resizes the array to contain "num" elements.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Copyright (c) 2017-2021 Arm Limited.
IArray()
Default constructor.
virtual T * buffer() const =0
Pointer to the first element of the array.
size_t num_values() const
Number of values currently stored in the array.
IArray(size_t max_num_values)
Constructor: initializes an array which can contain up to max_num_points values.
size_t max_num_values() const
Maximum number of values which can be stored in this array.
bool push_back(const T &val)
Append the passed argument to the end of the array if there is room.
virtual ~IArray()=default
Default virtual destructor.
virtual T & at(size_t index) const
Reference to the element of the array located at the given index.