GL Studio C++ Runtime API
|
#include <dynamic_array.h>
Public Member Functions | |
DynamicArray (unsigned initialCapacity=0) | |
DynamicArray (std::initializer_list< T > list) | |
DynamicArray (const DynamicArray< T, true > &other) | |
Initialize this array by deep-copying other. | |
DynamicArray (const DynamicArray< T, false > &other) | |
Initialize this array by deep-copying other. | |
DynamicArray & | operator= (const DynamicArray< T, true > &other) |
Assign this array by deep-copying other. | |
DynamicArray & | operator= (const DynamicArray< T, false > &other) |
Assign this array by deep-copying other. | |
DynamicArray (DynamicArray< T, true > &&other) | |
Construct this array by taking ownership of other's contents. | |
DynamicArray (DynamicArray< T, false > &&other) | |
Construct this array by taking ownership of other's contents. | |
DynamicArray & | operator= (DynamicArray< T, true > &&other) |
Assign this array by clearing any current contents and then taking ownership of other's contents. | |
~DynamicArray () | |
DynamicArray destructor. Clears the array but does not delete the objects being pointed to by the array. | |
unsigned | Count () const |
void | Count (const unsigned newCount) |
void | Clear () |
unsigned | Capacity () const |
void | Capacity (const unsigned newCapacity) |
void | StripCapacity () |
unsigned | Insert (const T &object, unsigned loc) |
unsigned | PushBack (const T &object) |
void | PopBack () |
Removes the last item in the array. If the array is empty, it has no effect. | |
T & | Back () |
const T & | Back () const |
void | PushFront (const T &object) |
unsigned | Insert (T &&object, unsigned loc) |
unsigned | PushBack (T &&object) |
void | PushFront (T &&object) |
bool | Erase (const T &object) |
bool | EraseAt (const unsigned index) |
T & | operator[] (const unsigned index) |
const T & | operator[] (const unsigned index) const |
T * | InternalArray () |
const T * | InternalArray () const |
bool | IsEmpty () const |
unsigned | Size () const |
void | Size (unsigned newCapacity) |
unsigned | InsertObject (const T &object, unsigned loc) |
unsigned | InsertObject (const T &object) |
unsigned | InsertObjectAfter (const T &object, unsigned loc) |
void | PushObject (const T &object) |
void | InsertObject (T &&object, unsigned loc) |
unsigned | InsertObject (T &&object) |
void | InsertObjectAfter (T &&object, unsigned loc) |
void | PushObject (T &&object) |
bool | DeleteObject (const T &object) |
bool | DeleteObjectAtIndex (const unsigned index) |
void | EmptyList () |
void | ClearList () |
int | Position (const T &object) const |
A templated array of objects. The array dynamically resizes as needed.
T | The type of the objects contained. |
Obsolete | Obsolete parameter retained for backwards compatibility. Please ignore. |
|
inlineexplicit |
DynamicArray constructor
initialCapacity | The initial number of elements to be allocated for the array |
|
inline |
Construct from a list of items, e.g.:
|
inline |
Returns the last element in the array.
DistiException | if array is empty. |
|
inline |
Returns the last element in the array.
DistiException | if array is empty. |
|
inline |
Returns the capacity of this dynamic array
|
inline |
Reserves space for newCapacity elements in the array, reallocating as needed.
newCapacity | The new number of elements reserved in the array. |
|
inline |
Clears the list so Count() is zero, destroying all items. Does not strip capacity. Shorthand for Count( 0 ).
|
inline |
Clears the list so Count() is zero. Does not strip capacity. Shorthand for Count( 0 ).
|
inline |
Returns the number of elements used of this dynamic array
|
inline |
Set the "Count" value for this array, destroying items or creating default-constructed items as needed.
|
inline |
Removes the object, shrinking the array count. (Does not delete it, if pointer.)
object | A pointer to the object to delete |
|
inline |
Removes the object at the specified index. (Does not delete it, if pointer.)
index | Index of the object to delete |
|
inline |
Calls delete on each element and then clears the list.
|
inline |
Deletes the specified object from the list. Does not delete it, if a pointer.
object | A pointer to the object to delete |
|
inline |
Removes the object at the specified index. (Does not delete it, if pointer.)
index | Index of the object to delete |
|
inline |
Attempts to insert the object into the list at the specified location. If the specified location is beyond the array bounds, the object is inserted at the next position in the array.
object | The object to insert |
loc | The index location to insert into |
|
inline |
Attempts to insert the object into the list at the specified location. If the specified location is beyond the array bounds, the object is inserted at the next position in the array.
object | The object to insert |
loc | The index location to insert into |
|
inline |
Attempts to insert the object into the list at the specified location. If the specified location is beyond the array bounds, the object is inserted at the next position in the array.
object | The object to insert |
loc | The index location to insert into |
|
inline |
Adds the specified object into the list, at the end of the list
|
inline |
Attempts to insert the object into the list at the specified location. If the specified location is beyond the array bounds, the object is inserted at the next position in the array.
object | The object to insert |
loc | The index location to insert into |
|
inline |
Adds the specified object into the list, at the end of the list
|
inline |
Insert the object into the list at the specified location
object | The object to insert |
loc | The index location to insert into |
|
inline |
Insert the object into the list at the specified location
object | The object to insert |
loc | The index location to insert into |
|
inline |
Return the internal array pointer
|
inline |
Return the internal array pointer
|
inline |
|
inline |
Overload of array operator to get element at desired index
|
inline |
Overload of array operator to get element at desired index
|
inline |
Get the index position of the specified object in the list
|
inline |
Adds the specified object into the list, at the end of the list
object | A pointer to the object to add |
|
inline |
Adds the specified object into the list, at the end of the list
|
inline |
Adds the specified object at the head of the list.
|
inline |
Adds the specified object at the head of the list.
|
inline |
Adds the specified object into the list, at the head of the list Treats the list like a stack, hence the name Push
|
inline |
Adds the specified object at the head of the list.
|
inline |
Returns the capacity of this array
|
inline |
Reserves space for newCapacity elements in the array, reallocating as needed.
newCapacity | The new number of elements reserved in the array |
|
inline |
Remove all capacity, destroying any extant items (but deleting any pointees, if the item is a pointer; for that, see DeleteEachAndClear()).