GL Studio C++ Runtime API
|
#include <dynamic_array.h>
Public Types | |
typedef T | ElementType |
Typedef for the type of object contained in this array. | |
Public Member Functions | |
DynamicArray (unsigned initialCapacity=0) | |
DynamicArray (std::initializer_list< T > list) | |
DynamicArray (const DynamicArray< T, true > &other) | |
DynamicArray (const DynamicArray< T, false > &other) | |
DynamicArray & | operator= (const DynamicArray< T, true > &other) |
DynamicArray & | operator= (const DynamicArray< T, false > &other) |
DynamicArray (DynamicArray< T, true > &&other) | |
DynamicArray (DynamicArray< T, false > &&other) | |
DynamicArray & | operator= (DynamicArray< T, true > &&other) |
DynamicArray & | operator= (DynamicArray< T, false > &&other) |
~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.:
list | The list of items to construct from. |
|
inline |
Initialize this array by deep-copying other
other | The array to copy from. |
|
inline |
Initialize this array by deep-copying other
other | The array to copy from. |
|
inline |
Construct this array by taking ownership of other's contents.
other | The array to move from. |
|
inline |
Construct this array by taking ownership of other's contents.
other | The array to move from. |
|
inline |
DistiException | if array is empty. |
|
inline |
DistiException | if array is empty. |
|
inline |
|
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.
newCount | The new count to allocate. |
|
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 |
Adds the specified object into the list, at the end of the list
object | The object to insert. |
|
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
object | The object to insert. |
|
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 |
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 |
|
inline |
|
inline |
|
inline |
Assign this array by deep-copying other
other | The array to copy from. |
|
inline |
Assign this array by deep-copying other
other | The array to copy from. |
|
inline |
Assign this array by clearing any current contents and then taking ownership of other's contents.
other | The array to move from. |
|
inline |
Assign this array by clearing any current contents and then taking ownership of other's contents.
other | The array to move from. |
|
inline |
Overload of array operator to get element at desired index
index | The index of the item to return. |
|
inline |
Overload of array operator to get element at desired index
index | The index of the item to return. |
|
inline |
Get the index position of the specified object in the list
object | The object whose index is to be found. |
|
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
object | The object to add. |
|
inline |
Adds the specified object at the head of the list.
object | The object to add. |
|
inline |
Adds the specified object at the head of the list.
object | The object to add. |
|
inline |
Adds the specified object into the list, at the head of the list Treats the list like a stack, hence the name Push
object | The object to add. |
|
inline |
Adds the specified object at the head of the list.
object | The object to add. |
|
inline |
|
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()).