Compute Library
 20.02.1
Array< T > Class Template Reference

Basic implementation of the IArray interface which allocates a static number of T values. More...

#include <Array.h>

Collaboration diagram for Array< T >:
[legend]

Public Member Functions

 Array ()
 Default constructor: empty array. More...
 
 Array (size_t max_num_values)
 Constructor: initializes an array which can contain up to max_num_points values. More...
 
T * buffer () const override
 Pointer to the first element of the array. More...
 
- Public Member Functions inherited from IArray< T >
 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 & 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...
 

Detailed Description

template<class T>
class arm_compute::Array< T >

Basic implementation of the IArray interface which allocates a static number of T values.

Definition at line 37 of file Array.h.

Constructor & Destructor Documentation

◆ Array() [1/2]

Array ( )
inline

Default constructor: empty array.

Definition at line 41 of file Array.h.

42  : IArray<T>(0), _values(nullptr)
43  {
44  }

◆ Array() [2/2]

Array ( size_t  max_num_values)
inline

Constructor: initializes an array which can contain up to max_num_points values.

Parameters
[in]max_num_valuesMaximum number of values the array will be able to stored

Definition at line 49 of file Array.h.

51  {
52  }
_Unique_if< T >::_Single_object make_unique(Args &&... args)
Construct a single object and return a unique pointer to it.
size_t max_num_values() const
Maximum number of values which can be stored in this array.
Definition: IArray.h:58

Member Function Documentation

◆ buffer()

T* buffer ( ) const
inlineoverridevirtual

Pointer to the first element of the array.

Other elements of the array can be accessed using buffer()[idx] for 0 <= idx < num_poins().

Returns
A pointer to the first element of the array

Implements IArray< T >.

Definition at line 55 of file Array.h.

56  {
57  return _values.get();
58  }

The documentation for this class was generated from the following file: