Stores an intrnal array of objects. For this to work properly, any objects must
have overloaded assignment operators
1.0.1 Added copyBuffer function
Definition at line 36 of file TCollection.hpp.
Exponent::Collections::TCollection< TypeName >::TCollection | ( | const long | size | ) |
Construction
size | The size of the array |
Exponent::Collections::TCollection< TypeName >::TCollection | ( | const TCollection< TypeName > & | other | ) |
Copy construction
other | The aray to copy |
Exponent::Collections::TCollection< TypeName >::TCollection | ( | ) |
Construction
Exponent::Collections::TCollection< TypeName >::~TCollection | ( | ) |
Destruction
void Exponent::Collections::TCollection< TypeName >::addElementAtIndex | ( | const TypeName & | value, | |
const long | index | |||
) |
Set the value of an element
value | The value to give the element | |
index | The index of the element to set |
void Exponent::Collections::TCollection< TypeName >::clearArray | ( | ) |
Clear the array
void Exponent::Collections::TCollection< TypeName >::contract | ( | const long | contractBy | ) |
Contact the array (removes the number of entries starrting at the end
contractBy | The amount ot shrink the array by |
void Exponent::Collections::TCollection< TypeName >::copyBuffer | ( | const TypeName * | buffer, | |
const long | size | |||
) |
Copy another buffer
buffer | The buffer to copy | |
size | The size of the buffer |
void Exponent::Collections::TCollection< TypeName >::copyElements | ( | TypeName * | buffer, | |
const long | startIndex, | |||
const long | size | |||
) | const |
Copy a set of elements
buffer | The buffer to copy the values in to | |
startIndex | The start index to copy from | |
size | The size of the buffer being passed in |
TypeName Exponent::Collections::TCollection< TypeName >::elementAtIndex | ( | const long | index | ) | const |
Get the element at a specific index
index | The index of the element |
TypeName | The value |
TypeName* Exponent::Collections::TCollection< TypeName >::elementPointerAtIndex | ( | const long | index | ) |
Get a pointer to the element at a specific index
index | The index of the element |
TypeName* | The object or null on error |
void Exponent::Collections::TCollection< TypeName >::expand | ( | const long | expandBy | ) |
Expand the array (adds extra space at the end of the array
expandBy | The amount of extra space to add |
void Exponent::Collections::TCollection< TypeName >::freePointers | ( | ) | [protected] |
Free pointers -> deleteds (but not allways) all pointers
long Exponent::Collections::TCollection< TypeName >::getArraySize | ( | ) | const |
Get the size of the array
long | The size of the array |
Referenced by Exponent::MathTools::TRandomNumberGenerator< TypeName >::getNewRandomArray().
long Exponent::Collections::TCollection< TypeName >::getIndexOfObject | ( | const TypeName & | object | ) |
Get the index of an object
object | The object to find |
long | The index of the pointer or TPOINTERCOLLECTION_FAILED_TO_FIND_POINTER on error |
const TypeName* Exponent::Collections::TCollection< TypeName >::getInternalBuffer | ( | ) | const [inline] |
Get internal buffer
const | TypeName * The internal buffer |
Definition at line 206 of file TCollection.hpp.
References Exponent::Collections::TCollection< TypeName >::m_array.
TypeName* Exponent::Collections::TCollection< TypeName >::getMutableInternalBuffer | ( | ) | [inline] |
Get the internal buffer
const | TypeName * The internal buffer |
Definition at line 212 of file TCollection.hpp.
References Exponent::Collections::TCollection< TypeName >::m_array.
Referenced by Exponent::MathTools::TRandomNumberGenerator< TypeName >::getNewRandomArray().
void Exponent::Collections::TCollection< TypeName >::initialise | ( | const long | size | ) |
Initialise the unit
size | The size you want the array to be |
bool Exponent::Collections::TCollection< TypeName >::isObjectInArray | ( | const TypeName & | object | ) |
Is pointer in array
object | The object to look for |
bool | True if this object is stored in the array, false otherwise |
TCollection& Exponent::Collections::TCollection< TypeName >::operator= | ( | const TypeName & | element | ) |
Set all elements to
element | The element to set all to |
TVectory& | A reference to this |
TCollection& Exponent::Collections::TCollection< TypeName >::operator= | ( | const TCollection< TypeName > & | other | ) |
Assignment operator
other | The vector to copy |
TVector& | A reference to this |
TypeName* Exponent::Collections::TCollection< TypeName >::operator[] | ( | const long | index | ) |
Get the element at a specific index
index | The index of the item |
TypeName* | The object or null on error |
void Exponent::Collections::TCollection< TypeName >::setAllElementsTo | ( | const TypeName & | value | ) |
Set to a specific value
value | The value to set all the elements to |
void Exponent::Collections::TCollection< TypeName >::swapIndexes | ( | const long | index1, | |
const long | index2 | |||
) |
Swap two pointers
index1 | The index of the first pointer | |
index2 | The index of the second pointer |
TypeName* Exponent::Collections::TCollection< TypeName >::m_array [protected] |
The internal array
Definition at line 227 of file TCollection.hpp.
Referenced by Exponent::Collections::TCollection< TypeName >::getInternalBuffer(), and Exponent::Collections::TCollection< TypeName >::getMutableInternalBuffer().
long Exponent::Collections::TCollection< TypeName >::m_arraySize [protected] |
The size of the array
Definition at line 228 of file TCollection.hpp.