NVIDIA DeepStream SDK API Reference

6.4 Release
cvcore::ArrayN< T, N > Class Template Reference

Detailed Description

template<typename T, std::size_t N>
class cvcore::ArrayN< T, N >

Implementation of ArrayN class.

Template Parameters
Ttype of element in array.
Ncapacity of array.

Definition at line 258 of file Array.h.

Inheritance diagram for cvcore::ArrayN< T, N >:
Collaboration diagram for cvcore::ArrayN< T, N >:

Public Member Functions

 ArrayN ()
 Default constructor of ArrayN (create an owning Tensor with capacity N). More...
 
 ArrayN (std::size_t size, void *dataPtr, bool isCPU=true)
 Constructor of a non-owning ArrayN. More...
 
 ArrayN (bool isCPU)
 Constructor of a memory-owning ArrayN. More...
 
 ~ArrayN ()
 Destructor of the ArrayN. More...
 
 ArrayN (const ArrayN &)=delete
 ArrayN is non-copyable. More...
 
ArrayNoperator= (const ArrayN &)=delete
 ArrayN is non-copyable. More...
 
 ArrayN (ArrayN &&t)
 Move constructor of ArrayN. More...
 
ArrayNoperator= (ArrayN &&t)
 Move assignment operator of ArrayN. More...
 
void setSize (std::size_t size)
 Set size of the ArrayN. More...
 
const T & operator[] (int idx) const
 Const ArrayN index operator. More...
 
T & operator[] (int idx)
 ArrayN 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

◆ ArrayN() [1/5]

template<typename T , std::size_t N>
cvcore::ArrayN< T, N >::ArrayN ( )
inline

Default constructor of ArrayN (create an owning Tensor with capacity N).

Definition at line 264 of file Array.h.

◆ ArrayN() [2/5]

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

Constructor of a non-owning ArrayN.

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

Definition at line 276 of file Array.h.

References cvcore::ArrayBase::isCPU().

◆ ArrayN() [3/5]

template<typename T , std::size_t N>
cvcore::ArrayN< T, N >::ArrayN ( bool  isCPU)
inline

Constructor of a memory-owning ArrayN.

Parameters
isCPUwhether to allocate array on CPU or GPU.

Definition at line 286 of file Array.h.

References cvcore::ArrayBase::isCPU().

◆ ~ArrayN()

template<typename T , std::size_t N>
cvcore::ArrayN< T, N >::~ArrayN ( )
inline

Destructor of the ArrayN.

Definition at line 295 of file Array.h.

References cvcore::ArrayN< T, N >::setSize().

◆ ArrayN() [4/5]

template<typename T , std::size_t N>
cvcore::ArrayN< T, N >::ArrayN ( const ArrayN< T, N > &  )
delete

ArrayN is non-copyable.

◆ ArrayN() [5/5]

template<typename T , std::size_t N>
cvcore::ArrayN< T, N >::ArrayN ( ArrayN< T, N > &&  t)
inline

Move constructor of ArrayN.

Definition at line 316 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 , std::size_t N>
ArrayN& cvcore::ArrayN< T, N >::operator= ( ArrayN< T, N > &&  t)
inline

Move assignment operator of ArrayN.

Definition at line 325 of file Array.h.

◆ operator=() [2/2]

template<typename T , std::size_t N>
ArrayN& cvcore::ArrayN< T, N >::operator= ( const ArrayN< T, N > &  )
delete

ArrayN is non-copyable.

◆ operator[]() [1/2]

template<typename T , std::size_t N>
T& cvcore::ArrayN< T, N >::operator[] ( int  idx)
inline

ArrayN index operator.

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

Definition at line 370 of file Array.h.

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

◆ operator[]() [2/2]

template<typename T , std::size_t N>
const T& cvcore::ArrayN< T, N >::operator[] ( int  idx) const
inline

Const ArrayN index operator.

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

Definition at line 359 of file Array.h.

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

◆ setSize()

template<typename T , std::size_t N>
void cvcore::ArrayN< T, N >::setSize ( std::size_t  size)
inline

Set size of the ArrayN.

Parameters
sizesize of the ArrayN.

Definition at line 335 of file Array.h.

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

Referenced by cvcore::ArrayN< T, N >::~ArrayN().


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