#include <daeArray.h>
Public Member Functions | |
size_t | append (const T &value) |
void | append2 (const T &one, const T &two) |
void | append3 (const T &one, const T &two, const T &three) |
void | append4 (const T &one, const T &two, const T &three, const T &four) |
void | appendArray (const daeTArray< T > &array) |
void | appendArray (size_t num, T *array) |
size_t | appendUnique (const T &value) |
virtual void | clear () |
daeTArray (const T &el) | |
daeTArray (const daeTArray< T > &cpy) | |
daeTArray (T *prototype) | |
daeTArray () | |
T * | find (const T &value) const |
daeInt | find (const T &value, size_t &index) const |
const T & | get (size_t index) const |
T & | get (size_t index) |
daeInt | get2at (size_t index, T &one, T &two) |
daeInt | get3at (size_t index, T &one, T &two, T &three) |
daeInt | get4at (size_t index, T &one, T &two, T &three, T &four) |
void | grow (size_t minCapacity) |
void | insert (size_t index, size_t n, const T &val=T()) |
void | insert2at (size_t index, const T &one, const T &two) |
void | insert3at (size_t index, const T &one, const T &two, const T &three) |
void | insert4at (size_t index, const T &one, const T &two, const T &three, const T &four) |
void | insertAt (size_t index, const T &value) |
daeTArray< T > & | operator= (const daeTArray< T > &other) |
bool | operator== (const daeTArray< T > &other) |
const T & | operator[] (size_t index) const |
T & | operator[] (size_t index) |
void | prepend (const T &value) |
daeInt | remove (const T &value, size_t *idx=NULL) |
virtual daeInt | removeIndex (size_t index) |
void | set (size_t index, const T &value) |
void | set2 (const T &one, const T &two) |
void | set2at (size_t index, const T &one, const T &two) |
void | set3 (const T &one, const T &two, const T &three) |
void | set3at (size_t index, const T &one, const T &two, const T &three) |
void | set4 (const T &one, const T &two, const T &three, const T &four) |
void | set4at (size_t index, const T &one, const T &two, const T &three, const T &four) |
virtual void | setCount (size_t nElements) |
void | setCount (size_t nElements, const T &value) |
virtual | ~daeTArray () |
Protected Attributes | |
T * | prototype |
COLLADA C++ templated version of daeArray
for storing items of various types.
Definition at line 100 of file daeArray.h.
Constructor.
Definition at line 108 of file daeArray.h.
Constructor.
Definition at line 115 of file daeArray.h.
Copy Constructor
Definition at line 121 of file daeArray.h.
Constructor that takes one element and turns into an array
Definition at line 128 of file daeArray.h.
Destructor.
Definition at line 136 of file daeArray.h.
size_t daeTArray< T >::append | ( | const T & | value | ) | [inline] |
Appends a new object to the end of the daeArray
.
value | Value of the object to append. |
Definition at line 263 of file daeArray.h.
void daeTArray< T >::append2 | ( | const T & | one, | |
const T & | two | |||
) | [inline] |
Appends two values to the array.
one | The first value. | |
two | The second value. |
Definition at line 516 of file daeArray.h.
void daeTArray< T >::append3 | ( | const T & | one, | |
const T & | two, | |||
const T & | three | |||
) | [inline] |
Appends three values to the array.
one | The first value. | |
two | The second value. | |
three | The third value. |
Definition at line 527 of file daeArray.h.
void daeTArray< T >::append4 | ( | const T & | one, | |
const T & | two, | |||
const T & | three, | |||
const T & | four | |||
) | [inline] |
Appends four values to the array.
one | The first value. | |
two | The second value. | |
three | The third value. | |
four | The fourth value. |
Definition at line 540 of file daeArray.h.
Appends a number of elements to this array from another daeTArray.
array | The daeTArray that contains the values to append. |
Definition at line 693 of file daeArray.h.
void daeTArray< T >::appendArray | ( | size_t | num, | |
T * | array | |||
) | [inline] |
Appends a number of elements to this array from a C native array.
num | The number of elements to append. | |
array | The C native array that contains the values to append. |
Definition at line 681 of file daeArray.h.
size_t daeTArray< T >::appendUnique | ( | const T & | value | ) | [inline] |
Appends a unique object to the end of the daeArray
. Functions the same as append()
, but does nothing if the value is already in the daeArray
.
value | Value of the object to append. |
Definition at line 275 of file daeArray.h.
virtual void daeTArray< T >::clear | ( | ) | [inline, virtual] |
Frees the memory in this array and resets it to it's initial state.
Implements daeArray.
Definition at line 143 of file daeArray.h.
T* daeTArray< T >::find | ( | const T & | value | ) | const [inline] |
Just like the previous function, but has a more reasonable interface.
value | The value to find. |
Definition at line 339 of file daeArray.h.
Finds an item from the daeArray
.
value | A reference to the item to find. | |
index | If the function returns DAE_OK, this is set to the index where the value appears in the array. |
Definition at line 320 of file daeArray.h.
const T& daeTArray< T >::get | ( | size_t | index | ) | const [inline] |
Gets the object at a specific index in the daeArray
.
index | Index of the object to get, asserts if the index is out of bounds. |
Definition at line 254 of file daeArray.h.
T& daeTArray< T >::get | ( | size_t | index | ) | [inline] |
Gets the object at a specific index in the daeArray
.
index | Index of the object to get, asserts if the index is out of bounds. |
Definition at line 246 of file daeArray.h.
Gets two values from the array at the specified location.
index | The position in the array to start getting. | |
one | Variable to store the first value. | |
two | Variable to store the second value. |
Definition at line 598 of file daeArray.h.
daeInt daeTArray< T >::get3at | ( | size_t | index, | |
T & | one, | |||
T & | two, | |||
T & | three | |||
) | [inline] |
Gets three values from the array at the specified location.
index | The position in the array to start getting. | |
one | Variable to store the first value. | |
two | Variable to store the second value. | |
three | Variable to store the third value. |
Definition at line 621 of file daeArray.h.
daeInt daeTArray< T >::get4at | ( | size_t | index, | |
T & | one, | |||
T & | two, | |||
T & | three, | |||
T & | four | |||
) | [inline] |
Gets four values from the array at the specified location.
index | The position in the array to start getting. | |
one | Variable to store the first value. | |
two | Variable to store the second value. | |
three | Variable to store the third value. | |
four | Variable to store the fourth value. |
Definition at line 650 of file daeArray.h.
void daeTArray< T >::grow | ( | size_t | minCapacity | ) | [inline, virtual] |
Increases the capacity of the daeArray
.
minCapacity | The minimum array capacity (the actual resulting capacity may be higher). |
Implements daeArray.
Definition at line 157 of file daeArray.h.
void daeTArray< T >::insert | ( | size_t | index, | |
size_t | n, | |||
const T & | val = T() | |||
) | [inline] |
Inserts the specified number of elements at a specific location in the array.
index | Index into the array where the elements will be inserted | |
n | The number of elements to insert | |
val | The value to insert |
Definition at line 368 of file daeArray.h.
void daeTArray< T >::insert2at | ( | size_t | index, | |
const T & | one, | |||
const T & | two | |||
) | [inline] |
Inserts two values into the array at the specified location.
index | The position in the array to start inserting. | |
one | The first value. | |
two | The second value. |
Definition at line 554 of file daeArray.h.
void daeTArray< T >::insert3at | ( | size_t | index, | |
const T & | one, | |||
const T & | two, | |||
const T & | three | |||
) | [inline] |
Inserts three values into the array at the specified location.
index | The position in the array to start inserting. | |
one | The first value. | |
two | The second value. | |
three | The third value. |
Definition at line 567 of file daeArray.h.
void daeTArray< T >::insert4at | ( | size_t | index, | |
const T & | one, | |||
const T & | two, | |||
const T & | three, | |||
const T & | four | |||
) | [inline] |
Inserts four values into the array at the specified location.
index | The position in the array to start inserting. | |
one | The first value. | |
two | The second value. | |
three | The third value. | |
four | The fourth value. |
Definition at line 582 of file daeArray.h.
void daeTArray< T >::insertAt | ( | size_t | index, | |
const T & | value | |||
) | [inline] |
Inserts an object at a specific index in the daeArray, growing the array if neccessary
index | Index into the array for where to place the object | |
value | The object to append |
Definition at line 390 of file daeArray.h.
Overloaded assignment operator.
other | A reference to the array to copy |
Definition at line 400 of file daeArray.h.
Overloaded equality operator
other | A reference to the other array. |
Definition at line 418 of file daeArray.h.
const T& daeTArray< T >::operator[] | ( | size_t | index | ) | const [inline] |
Gets the object at a specific index in the daeArray
.
index | Index of the object to get, asserts if the index is out of bounds. |
index
. Definition at line 358 of file daeArray.h.
T& daeTArray< T >::operator[] | ( | size_t | index | ) | [inline] |
Gets the object at a specific index in the daeArray
.
index | Index of the object to get, asserts if the index is out of bounds. |
index
. Definition at line 350 of file daeArray.h.
void daeTArray< T >::prepend | ( | const T & | value | ) | [inline] |
Adds a new item to the front of the daeArray
.
value | Item to be added. |
Definition at line 287 of file daeArray.h.
Removes an item from the daeArray
.
value | A reference to the item to delete. |
daeElement
objects sometimes list objects in two places, the class member and the _contents
array, when you remove something from the do, you must remove it from both places. Definition at line 299 of file daeArray.h.
Removes an item at a specific index in the daeArray
.
index | Index number of the item to delete. |
daeElement
objects sometimes list objects in two places, the class member and the _contents
array, when you remove something from the dom, you must remove it from both places. Implements daeArray.
Definition at line 186 of file daeArray.h.
void daeTArray< T >::set | ( | size_t | index, | |
const T & | value | |||
) | [inline] |
Sets a specific index in the daeArray
, growing the array if necessary.
index | Index of the object to set, asserts if the index is out of bounds. | |
value | Value to store at index in the array. |
Definition at line 235 of file daeArray.h.
void daeTArray< T >::set2 | ( | const T & | one, | |
const T & | two | |||
) | [inline] |
Sets the array to the contain the two values specified.
one | The first value. | |
two | The second value. |
Definition at line 433 of file daeArray.h.
void daeTArray< T >::set2at | ( | size_t | index, | |
const T & | one, | |||
const T & | two | |||
) | [inline] |
Sets the values in the array at the specified location to the contain the two values specified. This function will grow the array if needed.
index | The position in the array to start setting. | |
one | The first value. | |
two | The second value. |
Definition at line 475 of file daeArray.h.
void daeTArray< T >::set3 | ( | const T & | one, | |
const T & | two, | |||
const T & | three | |||
) | [inline] |
Sets the array to the contain the three values specified.
one | The first value. | |
two | The second value. | |
three | The third value. |
Definition at line 445 of file daeArray.h.
void daeTArray< T >::set3at | ( | size_t | index, | |
const T & | one, | |||
const T & | two, | |||
const T & | three | |||
) | [inline] |
Sets the values in the array at the specified location to the contain the three values specified. This function will grow the array if needed.
index | The position in the array to start setting. | |
one | The first value. | |
two | The second value. | |
three | The third value. |
Definition at line 488 of file daeArray.h.
void daeTArray< T >::set4 | ( | const T & | one, | |
const T & | two, | |||
const T & | three, | |||
const T & | four | |||
) | [inline] |
Sets the array to the contain the four values specified.
one | The first value. | |
two | The second value. | |
three | The third value. | |
four | The fourth value. |
Definition at line 459 of file daeArray.h.
void daeTArray< T >::set4at | ( | size_t | index, | |
const T & | one, | |||
const T & | two, | |||
const T & | three, | |||
const T & | four | |||
) | [inline] |
Sets the values in the array at the specified location to the contain the four values specified. This function will grow the array if needed.
index | The position in the array to start setting. | |
one | The first value. | |
two | The second value. | |
three | The third value. | |
four | The fourth value. |
Definition at line 503 of file daeArray.h.
virtual void daeTArray< T >::setCount | ( | size_t | nElements | ) | [inline, virtual] |
Resets the number of elements in the array. If the array increases in size, the new elements will be initialized with a default constructor.
nElements | The new size of the array. |
Implements daeArray.
Definition at line 223 of file daeArray.h.
void daeTArray< T >::setCount | ( | size_t | nElements, | |
const T & | value | |||
) | [inline] |
Resets the number of elements in the array. If the array increases in size, the new elements will be initialized to the specified value.
nElements | The new size of the array. | |
value | The value new elements will be initialized to. |
Definition at line 205 of file daeArray.h.
Definition at line 103 of file daeArray.h.