NVIDIA DeepStream SDK API Reference

6.4 Release
cvcore::Array< T > Class Template Reference

Detailed Description

template<typename T>
class cvcore::Array< T >

Implementation of Array class.

Template Parameters
Ttype of element in array.

Definition at line 133 of file Array.h.

Inheritance diagram for cvcore::Array< T >:
Collaboration diagram for cvcore::Array< T >:

Public Member Functions

 Array ()
 Default constructor of an array. More...
 
 Array (std::size_t size, std::size_t capacity, void *dataPtr, bool isCPU=true)
 Constructor of a non-owning array. More...
 
 Array (std::size_t capacity, bool isCPU=true)
 Constructor of a memory-owning array. More...
 
 ~Array ()
 Destructor of the Array. More...
 
 Array (const Array &)=delete
 Array is non-copyable. More...
 
Arrayoperator= (const Array &)=delete
 Array is non-copyable. More...
 
 Array (Array &&t)
 Move constructor of Array. More...
 
Arrayoperator= (Array &&t)
 Move assignment operator of Array. More...
 
void setSize (std::size_t size)
 Set size of the Array. More...
 
const T & operator[] (int idx) const
 Const array index operator. More...
 
T & operator[] (int idx)
 Array index operator. More...
 
void * getElement (int idx) const
 Get the pointer to specified index. More...
 
std::size_t getSize () const
 Get the size of the array. More...
 
std::size_t getCapacity () const
 Get the capacity of the array. More...
 
std::size_t getElementSize () const
 Get the size of each element. More...
 
bool isCPU () const
 Get the flag whether the array is CPU or GPU array. More...
 
bool isOwning () const
 Get the flag whether the array is owning memory space. More...
 
void * getData () const
 Get the raw pointer to the array data. More...
 

Constructor & Destructor Documentation

◆ Array() [1/5]

template<typename T >
cvcore::Array< T >::Array ( )
inline

Default constructor of an array.

Definition at line 139 of file Array.h.

◆ Array() [2/5]

template<typename T >
cvcore::Array< T >::Array ( std::size_t  size,
std::size_t  capacity,
void *  dataPtr,
bool  isCPU = true 
)
inline

Constructor of a non-owning array.

Parameters
sizesize of the array.
capacitycapacity of the array.
dataPtrdata pointer to the raw source array.
isCPUwhether to allocate array on CPU or GPU.

Definition at line 151 of file Array.h.

References cvcore::ArrayBase::isCPU().

◆ Array() [3/5]

template<typename T >
cvcore::Array< T >::Array ( std::size_t  capacity,
bool  isCPU = true 
)
inline

Constructor of a memory-owning array.

Parameters
capacitycapacity of the array.
isCPUwhether to allocate array on CPU or GPU.

Definition at line 162 of file Array.h.

References cvcore::ArrayBase::isCPU().

◆ ~Array()

template<typename T >
cvcore::Array< T >::~Array ( )
inline

Destructor of the Array.

Definition at line 170 of file Array.h.

References cvcore::Array< T >::setSize().

◆ Array() [4/5]

template<typename T >
cvcore::Array< T >::Array ( const Array< T > &  )
delete

Array is non-copyable.

◆ Array() [5/5]

template<typename T >
cvcore::Array< T >::Array ( Array< T > &&  t)
inline

Move constructor of Array.

Definition at line 191 of file Array.h.

Member Function Documentation

◆ getCapacity()

std::size_t cvcore::ArrayBase::getCapacity ( ) const
inherited

Get the capacity of the array.

Returns
size of the array.

◆ getData()

void* cvcore::ArrayBase::getData ( ) const
inherited

Get the raw pointer to the array data.

Returns
void pointer to the first element of the array.

◆ getElement()

void* cvcore::ArrayBase::getElement ( int  idx) const
inherited

Get the pointer to specified index.

Parameters
idxelement index.
Returns
pointer to the specified element.

Referenced by cvcore::Array< T >::operator[](), cvcore::ArrayN< T, N >::operator[](), cvcore::Array< T >::setSize(), and cvcore::ArrayN< T, N >::setSize().

◆ getElementSize()

std::size_t cvcore::ArrayBase::getElementSize ( ) const
inherited

Get the size of each element.

Returns
size of each element.

◆ getSize()

std::size_t cvcore::ArrayBase::getSize ( ) const
inherited

◆ isCPU()

bool cvcore::ArrayBase::isCPU ( ) const
inherited

Get the flag whether the array is CPU or GPU array.

Returns
whether the array is CPU array.

Referenced by cvcore::Array< T >::Array(), cvcore::ArrayN< T, N >::ArrayN(), cvcore::Array< T >::setSize(), and cvcore::ArrayN< T, N >::setSize().

◆ isOwning()

bool cvcore::ArrayBase::isOwning ( ) const
inherited

Get the flag whether the array is owning memory space.

Returns
whether the array owns memory.

◆ operator=() [1/2]

template<typename T >
Array& cvcore::Array< T >::operator= ( Array< T > &&  t)
inline

Move assignment operator of Array.

Definition at line 200 of file Array.h.

◆ operator=() [2/2]

template<typename T >
Array& cvcore::Array< T >::operator= ( const Array< T > &  )
delete

Array is non-copyable.

◆ operator[]() [1/2]

template<typename T >
T& cvcore::Array< T >::operator[] ( int  idx)
inline

Array index operator.

Parameters
idxindex of element.
Returns
reference to the specified element.

Definition at line 245 of file Array.h.

References cvcore::ArrayBase::getElement(), and cvcore::ArrayBase::getSize().

◆ operator[]() [2/2]

template<typename T >
const T& cvcore::Array< T >::operator[] ( int  idx) const
inline

Const array index operator.

Parameters
idxindex of element.
Returns
const reference to the specified element.

Definition at line 234 of file Array.h.

References cvcore::ArrayBase::getElement(), and cvcore::ArrayBase::getSize().

◆ setSize()

template<typename T >
void cvcore::Array< T >::setSize ( std::size_t  size)
inline

Set size of the Array.

Parameters
sizesize of the Array.

Definition at line 210 of file Array.h.

References cvcore::ArrayBase::getElement(), cvcore::ArrayBase::getSize(), cvcore::ArrayBase::isCPU(), and cvcore::ArrayBase::setSize().

Referenced by cvcore::Array< T >::~Array().


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