A class that represents a dynamically-sized sequence of objects stored contiguously in memory.
More...
|
| Array () |
| Create an empty array. This constructor does not allocate any memory. More...
|
|
| Array (SizeType arraySize) |
| Create an array of the specified size with default-constructed elements. More...
|
|
| Array (SizeType arraySize, const T &prototype) |
| Create an array of the specified size with elements created from the specified prototype. More...
|
|
| Array (T *newArray, SizeType arraySize) |
| Create an array which uses the specified pointer to a block of memory. More...
|
|
| Array (const T *newArray, SizeType arraySize) |
| Create an array with elements from the specified pointer, copying the data. More...
|
|
| Array (const Array &other) |
| Create a deep copy of the specified array object. More...
|
|
| Array (const Array &other, SizeType number) |
| Create a deep copy of the specified array object, using only the specified number of elements. More...
|
|
Array & | operator= (const Array &other) |
| Copy the contents from another array into this array, replacing the current contents. More...
|
|
| ~Array () |
| Destroy an array object and deallocate its internal array. More...
|
|
T * | getPointer () |
| Convert this array to a pointer and return the result. More...
|
|
const T * | getPointer () const |
| Convert this array to a pointer and return the result, const version. More...
|
|
| operator T * () |
| Convert this array to a pointer. More...
|
|
| operator const T * () const |
| Convert this array to a pointer, const version. More...
|
|
Bool | operator== (const Array &array) const |
| Compare this array to another array for equality. More...
|
|
Bool | operator!= (const Array &array) const |
| Compare this array to another array for inequality. More...
|
|
Array | operator+ (const Array &other) const |
| Concatenate the contents of this array with another array and return the resulting new array. More...
|
|
SizeType | getSize () const |
| Get the size of this array. More...
|
|
void | setSize (SizeType newSize) |
| Resize this array, copying as many elements from the old array to the new array as possible. More...
|
|
void | setSize (SizeType newSize, const T &prototype) |
| Resize this array, copying as many elements from the old array to the new array as possible. More...
|
|
void | setAll (const T &prototype) |
| Set all of the values in this array to the specified value. More...
|
|
Bool | isNull () const |
| Return whether or not this array object's internal array is NULL. More...
|
|
Bool | isSet () const |
| Return whether or not this array object's internal array is not NULL. More...
|
|
template<class T, typename SizeType = Size, typename AllocatorType = Allocator>
class om::util::Array< T, SizeType, AllocatorType >
A class that represents a dynamically-sized sequence of objects stored contiguously in memory.
template<class T, typename SizeType = Size, typename AllocatorType = Allocator>
Create an array which uses the specified pointer to a block of memory.
After calling this constructor, the Array now owns the pointer and will automatically delete it when the array is destructed.
template<class T, typename SizeType = Size, typename AllocatorType = Allocator>
Bool om::util::Array< T, SizeType, AllocatorType >::operator== |
( |
const Array< T, SizeType, AllocatorType > & |
array | ) |
const |
|
inline |
Compare this array to another array for equality.
If this array has the same size as the other array and has the same elements, the arrays are equal and TRUE is returned. Otherwise, the arrays are not equal and FALSE is returned.
template<class T, typename SizeType = Size, typename AllocatorType = Allocator>
Bool om::util::Array< T, SizeType, AllocatorType >::operator!= |
( |
const Array< T, SizeType, AllocatorType > & |
array | ) |
const |
|
inline |
Compare this array to another array for inequality.
If this array has a different size than the other array or has different elements, the arrays are not equal and TRUE is returned. Otherwise, the arrays are equal and FALSE is returned.
template<class T, typename SizeType = Size, typename AllocatorType = Allocator>
void om::util::Array< T, SizeType, AllocatorType >::setSize |
( |
SizeType |
newSize | ) |
|
|
inline |
Resize this array, copying as many elements from the old array to the new array as possible.
If there are new elements created at the end of the array, they are default constructed.
template<typename T, typename SizeType, typename AllocatorType >
void om::util::Array< T, SizeType, AllocatorType >::setSize |
( |
SizeType |
newSize, |
|
|
const T & |
prototype |
|
) |
| |
Resize this array, copying as many elements from the old array to the new array as possible.
If there are new elements created at the end of the array, they are initialize to the specified default value.