|
| Array () |
| Initializes an empty array. More...
|
|
| Array (size_t initUsedLength, const T &defaultVal=T(), size_t initGrowLength=kDefaultGrowthLength) |
| Initializes an array with an initial size. More...
|
|
| Array (const Array< T > &src) |
| Copy constructor. More...
|
|
template<class InputIt > |
| Array (InputIt begin, InputIt end) |
| Copy constructor. More...
|
|
| ~Array () |
| Destructor. Destroys every element stored in the array, and frees the allocated storage. More...
|
|
Array< T > & | operator= (const Array< T > &src) |
| Copy operator. More...
|
|
bool | operator== (const Array< T > &op) const |
| Equality operator. More...
|
|
Array< T > & | setAt (size_t index, const T &value) |
| Sets a copy of value at the given index. More...
|
|
Array< T > & | setAll (const T &value) |
| Sets all the elements of the array to the given value. More...
|
|
bool | isValidIndex (size_t) const |
| Returns whether the given array index is valid for this array. More...
|
|
|
T & | operator[] (size_t i) |
| Subscript operator. More...
|
|
const T & | operator[] (size_t i) const |
| Subscript operator. More...
|
|
|
const T & | at (size_t index) const |
| Same as subscript operator. More...
|
|
T & | at (size_t index) |
| Same as subscript operator. More...
|
|
|
T & | first () |
| Accesses the first element in the array. More...
|
|
const T & | first () const |
| Accesses the first element in the array. More...
|
|
T * | begin () |
| Accesses the begin iterator, which is a plain pointer in this case. More...
|
|
const T * | begin () const |
| Accesses the const begin iterator, which is a plain pointer in this case. More...
|
|
T & | last () |
| Accesses the last element in the array. More...
|
|
const T & | last () const |
| Accesses the first element in the array. More...
|
|
T * | end () |
| Accesses the end iterator (one past last valid element). Do not dereference. More...
|
|
const T * | end () const |
| Accesses the const end iterator (one past last valid element). Do not dereference. More...
|
|
size_t | append (const T &value) |
| Appends a copy of value to the array. More...
|
|
Array< T > & | append (const T *values, size_t count) |
| Appends one or more element(s) to the array. More...
|
|
Array< T > & | append (const Array< T > &array) |
| Appends the contents of another array to this array. More...
|
|
Array< T > & | insertAt (size_t index, const T &value) |
| Inserts a single value, at a given location, into this array. More...
|
|
Array< T > & | insertAt (size_t index, const T *values, size_t count) |
| Inserts a one or more value(s), at a given location, into this array. More...
|
|
Array< T > & | removeAt (size_t index) |
| Removes a single element from the array. More...
|
|
bool | remove (const T &value, size_t start=0) |
| Searches for a value in the array and, if it is found, removes it from the array. More...
|
|
Array< T > & | removeFirst () |
| Removes the first element of the array. More...
|
|
Array< T > & | removeLast () |
| Removes the last element of the array. More...
|
|
Array< T > & | removeAll () |
| Removes all the elements from the array. More...
|
|
Array< T > & | removeSubArray (size_t startIndex, size_t endIndex) |
| Removes a subset of the array. More...
|
|
bool | contains (const T &value, size_t start=0) const |
| Determines if a value is stored in the array. More...
|
|
bool | find (const T &value, size_t &foundAt, size_t start=0) const |
| Searches for a value in the array. More...
|
|
size_t | find (const T &value) const |
| Searches for a value in the array. More...
|
|
size_t | findFrom (const T &value, size_t start) const |
| Searches for a value in the array, starting at a given index. More...
|
|
size_t | length () const |
| Returns the number of used elements (as opposed to simply allocated/reserved) in the array. More...
|
|
bool | isEmpty () const |
| Returns true if the number of used elements in the array is 0; returns false otherwise. More...
|
|
size_t | lengthUsed () const |
| Returns the number of elements used (as opposed to simply allocated/reserved) in the array. More...
|
|
Array< T > & | setLengthUsed (size_t length, const T &defaultVal=T()) |
| Sets the number of elements used (as opposed to simply allocated/reserved) in the array. More...
|
|
size_t | lengthReserved () const |
| Returns the number of elements allocated/reserved (as opposed to actually used) in the array. More...
|
|
Array< T > & | setLengthReserved (size_t length) |
| Sets the number of elements allocated/reserved (as opposed to actually used) in the array. More...
|
|
void | reserve (size_t capacity) |
| Alias for setLengthReserved. More...
|
|
size_t | growLength () const |
| Returns the growth length of the array. More...
|
|
Array< T > & | setGrowLength (size_t) |
| Sets the growth length of the array. More...
|
|
Array< T > & | reverse () |
| Reverses the sequence of elements in the array. More...
|
|
Array< T > & | swap (size_t i1, size_t i2) |
| Swaps two elements in this array. More...
|
|
void | sort (CompareFnc cmp) |
| Sorts the elements of the array using a custom comparison function. More...
|
|
const T * | asArrayPtr () const |
| Returns the array storage as a C-style array pointer. More...
|
|
T * | asArrayPtr () |
| Accesses the first element in the array. More...
|
|
|
static size_t | quickSortPartition (T *data, size_t first, size_t last, CompareFnc cmp) |
| The partition portion of the QuickSort algorithm. More...
|
|
static void | quickSortRecursive (T *data, size_t first, size_t last, CompareFnc cmp) |
| Recursive QuickSort function used to sort the elements of the array. More...
|
|
static void | handleOutOfMemory () |
| Utility function, called when the array fails to allocate memory. More...
|
|
static T * | ArrayAllocate (size_t len) |
| Allocates an array of elements without constructing them. More...
|
|
static void | ArrayConstruct (T *arrayBegin, size_t len, const T &defaultVal) |
| Constructs an array of elements. More...
|
|
static void | ArrayDeAllocate (T *arrayBegin) |
| De-allocates an array of elements without destructing them. More...
|
|
static void | ArrayDestruct (T *arrayBegin, size_t len) |
| Destructs an array of elements. More...
|
|
static void | ArrayCopy (T *pCopy, size_t nMaxCount, const T *pSource, size_t nCount) |
| Copies an array of elements to an already-constructed buffer. More...
|
|
static void | ArrayCopyOverlap (T *pCopy, size_t nMaxCount, const T *pSource, size_t nCount) |
| Copies an array of elements when the target and destination memory buffers may overlap. More...
|
|
static void | ArrayCopyConstruct (T *pCopy, size_t nMaxCount, const T *pSource, size_t nCount) |
| Copies and array of elements to a non-constructed. More...
|
|
|
static UtilExport void * | operator new (size_t size) |
| Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
| Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
| New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
| New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
| New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new (size_t size, unsigned long flags) |
| New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
| New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new[] (size_t size) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
| New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
| New operator used to allocate arrays of objects. More...
|
|
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
| New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
| New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void | operator delete (void *ptr) |
| Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
| Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
| Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
| Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
| Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
| Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
| Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete[] (void *ptr) |
| Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
| Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
| Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
| Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
| Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
| Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
| Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
| Placement new operator. More...
|
|
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
| Placement delete operator. More...
|
|
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
| Allocates memory on a specified alignment boundary. More...
|
|
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
| Reallocates memory on a specified alignment boundary. More...
|
|
static UtilExport void | aligned_free (void *ptr) |
| Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
|
|
template<class T>
class MaxSDK::Array< T >
A generic array container, with proper support for non-POD types.
This template class is a generic, dynamic array container, similar to the STL class "vector". Whereas the classical 3ds Max SDK class Tab supports only POD types, this class supports non-POD types as well.
- Note
- POD stands for "plain old data", and basically denotes any data type which does not need to be constructed, destructed, and which can be copied with memcpy() rather than requiring a copy operator to be called.