![]() |
ULIS
dev4.0.7
Utility Library for Imaging Systems
|
The TArray class provides a simple dynamic array or vector class for ULIS interfaces. More...
Public Member Functions | |
TArray () | |
TArray (const TArray< T > &iOther)=delete | |
TArray (TArray< T > &&iOther) noexcept | |
TArray (uint64 iSize) | |
~TArray () | |
T & | At (uint64 iIndex) |
const T & | At (uint64 iIndex) const |
T & | Back () |
const T & | Back () const |
uint8 * | Bits () |
const uint8 * | Bits () const |
uint64 | Capacity () const |
void | Clear () |
T * | Data () |
const T * | Data () const |
template<class ... Args> | |
void | Emplace (uint64 iPos, Args &&... args) |
template<class ... Args> | |
void | EmplaceBack (Args &&... args) |
void | Erase (const T &iElement) |
void | Erase (uint64 iPos, uint64 iCount=1) |
T & | Front () |
const T & | Front () const |
void | Insert (uint64 iPos, const T &iValue) |
void | Insert (uint64 iPos, T &&iValue) |
void | Insert (uint64 iPos, uint64 iCount, const T &iValue) |
bool | IsEmpty () const |
TArray< T > & | operator= (const TArray< T > &iOther)=delete |
TArray< T > & | operator= (TArray< T > &&iOther)=delete |
T & | operator[] (uint64 iIndex) |
const T & | operator[] (uint64 iIndex) const |
void | PopBack () |
void | PushBack (const T &iValue=T()) |
void | PushBack (T &&iValue) |
void | Reserve (uint64 iCapacity) |
void | Resize (uint64 iSize) |
void | Shrink () |
uint64 | Size () const |
The need of a custom TArray class rose from the fact that std:: classes cannot be exported easily accross dll boundaries when ULIS is compiled as a shared library.
Default constructor with size 0, capicity 0, uninitialized.
Constructor with known size, both capacity and size will match the requested size. The array will have a size of iSize and the elements are default constructed.
Copy constructor, explicitly removed.
Move constructor. The first object is left in a valid but empty state. The second object steals the buffer and the state ( size and capacity ).
Access component at index. Alias of operator[]()
Access component at index. Alias of operator[]()
|
inline |
Access component at back. The behaviour is undefined if the array is empty.
|
inline |
Access const component at back. The behaviour is undefined if the array is empty.
|
inline |
Clear the array, deallocating everything.
|
inline |
Returns the storage.
|
inline |
Returns the const storage.
|
inline |
Emplace, emplace a new element at pos in the buffer, possibly reallocating the underlying storage if the capacity has been reached.
|
inline |
EmplaceBack, emplace a new element at the end of the buffer, possibly reallocating the underlying storage if the capacity has been reached.
|
inline |
Erase first found element, if found in the array. Behaviour is undefined if the array is empty. Does nothing if such element is not in the array.
Erase elements at pos in the array. Behaviour is undefined if the array is empty.
|
inline |
Access component at front. The behaviour is undefined if the array is empty.
|
inline |
Access const component at front. The behaviour is undefined if the array is empty.
Insert, insert a new element at pos in the buffer, possibly reallocating the underlying storage if the capacity has been reached.
Insert, insert a new element at pos in the buffer, possibly reallocating the underlying storage if the capacity has been reached.
|
inline |
Insert, insert count new elements at pos in the buffer, possibly reallocating the underlying storage if the capacity has been reached.
|
inline |
Returns wether the array is empty or not.
Copy Assignment Operator, explicitly removed.
Move Assignment Operator, explicitly removed.
Access component at index. The behaviour is undefined if the array has no size. The behaviour is undefined if the index is greater than the size. The behaviour is undefined if the underlying buffer is nullptr, which indicates a corrupted states anyway.
Access const component at index. The behaviour is undefined if the array has no size. The behaviour is undefined if the index is greater than the size. The behaviour is undefined if the underlying buffer is nullptr, which indicates a corrupted states anyway.
|
inline |
PopBack, remove last element. Behaviour is undefined if the array is empty.
|
inline |
PushBack, insert a new element at the end of the buffer, possibly reallocating the underlying storage if the capacity has been reached.
|
inline |
PushBack, insert a new element at the end of the buffer, possibly reallocating the underlying storage if the capacity has been reached.
Reserve some capacity for future usage, if iCapacity is bigger than the current capacity.
If iCapacity is lower or equal to capacity, this function does nothing.
This function might invalid existing pointers to the underlying buffer.
The size doesn't change.
Resize the actual usage size of the container. This function might invalid the underlying buffer when requesting a bigger size. It has no effect if the requested size is the same as the current size.
|
inline |
Shrink the capacity to fit the size. If the capacity is already the same as the size, the function does nothing. This function might invalid the underlying buffer. The size doesn't change.