|
| PODArray () |
| Create a new empty POD array without any memory allocated. More...
|
|
| PODArray (SizeType newSize0, SizeType newSize1) |
| Create a new POD array of the given sizes without any memory allocated. More...
|
|
| PODArray (const PODArray &other) |
| Create a new empty POD array that copies the state of another array. More...
|
|
| ~PODArray () |
| Destroy a POD array, releasing any allocated memory. More...
|
|
PODArray & | operator= (const PODArray &other) |
| Assign the state of another PODArray to this one, copying its elements. More...
|
|
SizeType | getCapacity () const |
| Return the current capacity of the array's allocated storage. More...
|
|
SizeType | getSize (SizeType dimension) const |
| Return the current size of the array along the given dimension index. More...
|
|
SizeType | getSizeInBytes () const |
| Return the current number of bytes that are internally allocated, the memory usage. More...
|
|
void | setSize (SizeType newSize0, SizeType newSize1) |
| Set the current valid size of the array. More...
|
|
void | setSizeCopy (SizeType newSize0, SizeType newSize1) |
| Set the current valid size of the array. More...
|
|
void | setSizeCopyUnwrap (SizeType newSize0, SizeType newSize1, SizeType split0=0, SizeType split1=0) |
| Set the current valid size of the array, copying and unwrwapping the previous contents around a split point. More...
|
|
Bool | isAllocated () const |
| Return whether or not this PODArray's internal memory buffer is currently allocated. More...
|
|
void | allocate (SizeType newSize0, SizeType newSize1) |
| Make sure that the internal memory is allocated and has at least the given size. More...
|
|
void | allocate () |
| Make sure that the internal memory is allocated. More...
|
|
void | deallocate () |
| Free the memory used by the array but keep its current size. More...
|
|
T * | getPointer () const |
| Return a pointer to the first element in this array. More...
|
|
T * | operator[] (SizeType i) |
| Return a reference to the row at the specified index. More...
|
|
const T * | operator[] (SizeType i) const |
| Return a const reference to the row at the specified index. More...
|
|
T * | operator() (SizeType i) |
| Return a reference to the row at the specified index. More...
|
|
const T * | operator() (SizeType i) const |
| Return a const reference to the row at the specified index. More...
|
|
T & | operator() (SizeType i, SizeType j) |
| Return a reference to the array element at the specified 2D index. More...
|
|
const T & | operator() (SizeType i, SizeType j) const |
| Return a const reference to the array element at the specified 2D index. More...
|
|
void | zero () |
| Zero the entire contents of the array if it is allocated. More...
|
|
void | zero (SizeType start0, SizeType number0, SizeType start1, SizeType number1) |
| Zero a range of the array for each dimension if it is allocated. More...
|
|
template<typename T, typename SizeType, typename AllocatorType>
class om::util::PODArray< T, 2, SizeType, AllocatorType >
A specialization of the PODArray class with 2 dimensions.
template<typename T , typename SizeType , typename AllocatorType >
void om::util::PODArray< T, 2, SizeType, AllocatorType >::setSizeCopyUnwrap |
( |
SizeType |
newSize0, |
|
|
SizeType |
newSize1, |
|
|
SizeType |
split0 = 0 , |
|
|
SizeType |
split1 = 0 |
|
) |
| |
|
inline |
Set the current valid size of the array, copying and unwrwapping the previous contents around a split point.
This method is intended for efficient resizing of circular buffers. The old contents are copied after being unwrapped around the splitting point for each dimension. The split points indicate the new starting indices of the array. The array regions before the split points are copied after the end of the previous array data in the new array. The rest of the memory is uninitialized. If the array was not previously allocated the method does not allocate any memory.
template<typename T , typename SizeType , typename AllocatorType >
void om::util::PODArray< T, 2, SizeType, AllocatorType >::allocate |
( |
SizeType |
newSize0, |
|
|
SizeType |
newSize1 |
|
) |
| |
|
inline |
Make sure that the internal memory is allocated and has at least the given size.
If the memory is already allocated with at least the given size, the method has no effect. If new memory is allocated, its contents are undefined.
template<typename T , typename SizeType , typename AllocatorType >
Make sure that the internal memory is allocated.
If the memory is already allocated, the method has no effect. If new memory is allocated, its contents are undefined.
template<typename T , typename SizeType , typename AllocatorType >
Free the memory used by the array but keep its current size.
If the memory is already allocated, the method has no effect. If new memory is allocated, its contents are undefined.