Public Member Functions | |
ArrayBase (std::size_t capacity, std::size_t elemSize, void *dataPtr, bool isCPU) | |
Constructor of a non-owning arrays. More... | |
ArrayBase (std::size_t capacity, std::size_t elemSize, bool isCPU) | |
Constructor of a memory-owning arrays. More... | |
~ArrayBase () | |
Destructor of ArrayBase. More... | |
ArrayBase (const ArrayBase &)=delete | |
ArrayBase is non-copyable. More... | |
ArrayBase & | operator= (const ArrayBase &)=delete |
ArrayBase is non-copyable. More... | |
ArrayBase (ArrayBase &&) | |
Move constructor of ArrayBase. More... | |
ArrayBase & | operator= (ArrayBase &&) |
Move assignment operator of ArrayBase. 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... | |
void | setSize (std::size_t size) |
Set the size of the array. 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... | |
cvcore::ArrayBase::ArrayBase | ( | std::size_t | capacity, |
std::size_t | elemSize, | ||
void * | dataPtr, | ||
bool | isCPU | ||
) |
Constructor of a non-owning arrays.
capacity | capacity of the array. |
elemSize | byte size of each element. |
dataPtr | data pointer to the raw source array. |
isCPU | whether to allocate the array on CPU or GPU. |
cvcore::ArrayBase::ArrayBase | ( | std::size_t | capacity, |
std::size_t | elemSize, | ||
bool | isCPU | ||
) |
Constructor of a memory-owning arrays.
capacity | capacity of the array. |
elemSize | byte size of each element. |
isCPU | whether to allocate the array on CPU or GPU. |
cvcore::ArrayBase::~ArrayBase | ( | ) |
Destructor of ArrayBase.
std::size_t cvcore::ArrayBase::getCapacity | ( | ) | const |
Get the capacity of the array.
void* cvcore::ArrayBase::getData | ( | ) | const |
Get the raw pointer to the array data.
void* cvcore::ArrayBase::getElement | ( | int | idx | ) | const |
Get the pointer to specified index.
idx | element index. |
Referenced by cvcore::Array< T >::operator[](), cvcore::ArrayN< T, N >::operator[](), cvcore::Array< T >::setSize(), and cvcore::ArrayN< T, N >::setSize().
std::size_t cvcore::ArrayBase::getElementSize | ( | ) | const |
Get the size of each element.
std::size_t cvcore::ArrayBase::getSize | ( | ) | const |
Get the size of the array.
Referenced by cvcore::Array< T >::operator[](), cvcore::ArrayN< T, N >::operator[](), cvcore::Array< T >::setSize(), and cvcore::ArrayN< T, N >::setSize().
bool cvcore::ArrayBase::isCPU | ( | ) | const |
Get the flag whether the array is CPU or GPU array.
Referenced by cvcore::Array< T >::Array(), cvcore::ArrayN< T, N >::ArrayN(), cvcore::Array< T >::setSize(), and cvcore::ArrayN< T, N >::setSize().
bool cvcore::ArrayBase::isOwning | ( | ) | const |
Get the flag whether the array is owning memory space.
void cvcore::ArrayBase::setSize | ( | std::size_t | size | ) |
Set the size of the array.
size | size of the array. |
Referenced by cvcore::Array< T >::setSize(), and cvcore::ArrayN< T, N >::setSize().