
Public Types | |
| typedef T | TTemplateType |
| typedef T * | TValueType |
| The template type on which the array is based. | |
| typedef TMCPtrIterator< T, TMCCountedPtrArray < T > > | iterator |
| typedef TMCConstPtrIterator < T, TMCCountedPtrArray < T > > | const_iterator |
Public Member Functions | |
| TMCCountedPtrArray (void) | |
| A type that represents the data type stored in the array. | |
| TMCCountedPtrArray (uint32 initialCount) | |
| TMCCountedPtrArray (uint32 initialCount, uint32 initialSpace, uint32 initialGrowSize) | |
| TMCCountedPtrArray (const TMCCountedPtrArray< T > &inFromArray) | |
| TMCCountedPtrArray (const TMCPtrArray< T > &inFromPtrArray) | |
| TMCCountedPtrArray (T **const &baseAddress, boolean inAquireMemory, uint32 elemCount, uint32 elemSpace) | |
| TMCCountedPtrArray (TMCCountedPtrArray< T > &array, uint32 elemStart, uint32 elemCount) | |
| ~TMCCountedPtrArray (void) | |
| template<class TArray2> | |
| void | QueryArray (const MCIID &iid, TArray2 &outArray) const |
| Fills outArray. | |
| void | ArrayFree (void) |
| boolean | IsValid (void) const |
| int8 * | BaseAddress (void) |
| const int8 * | BaseAddress (void) const |
| uint32 | GetElemSize (void) const |
| uint32 | GetGrowSize (void) const |
| uint32 | GetElemSpace (void) const |
| uint32 | GetElemCount (void) const |
| boolean | ExternalMemory () |
| boolean | GetSmartGrow (void) const |
| T ** | ArrayData (void) |
| T **const | ArrayData (void) const |
| void | SetValid (boolean valid) |
| void | SetGrowSize (uint32 g) |
| void | SetSmartGrow () |
| boolean | SetElemSpace (uint32 n) |
| boolean | SetElemCount (uint32 n) |
| boolean | AddElemCount (uint32 n) |
| const_iterator | Begin (void) const |
| iterator | Begin (void) |
| const_iterator | End (void) const |
| iterator | End (void) |
| void | FirstElem (T **data) |
| T * | FirstElemNoAddRef (void) |
| const T * | FirstElemNoAddRef (void) const |
| void | LastElem (T **data) |
| T * | LastElemNoAddRef (void) |
| const T * | LastElemNoAddRef (void) const |
| void | Erase (const iterator &elementToErase) |
| void | Erase (const iterator &start, const iterator &end) |
| boolean | CopyElems (const TMCCountedPtrArray< T > &fromArray, uint32 startIndex, uint32 nbItems, uint32 insertIndex) |
| boolean | Append (const TMCCountedPtrArray< T > &fromArray) |
| TMCCountedPtrArray< T > & | operator= (const TMCCountedPtrArray< T > &fromArray) |
| TMCCountedPtrArray< T > & | operator= (const TMCPtrArray< T > &fromPtrArray) |
| T * | operator[] (uint32 i) |
| T * | operator[] (uint32 i) const |
| boolean | SetElem (uint32 index, T *data) |
| boolean | GetElem (uint32 index, T **data) const |
| boolean | AddElem (T *data) |
| boolean | InsertElem (uint32 index, T *data) |
| boolean | RemoveElem (uint32 index, uint32 count) |
| void | RemoveElem (T *elemToRemove) |
| boolean | CompactArray (void) |
| uint32 | FindElem (const T *item) const |
| void | CheckLastRefs () |
| T ** | Pointer (uint32 i) |
| const T ** | Pointer (uint32 i) const |
| void | Swap (TMCCountedPtrArray< T > &fromArray) |
Protected Member Functions | |
| boolean | ArrayAlloc (uint32 initialCount, uint32 initialSpace, uint32 initialGrowSize) |
| boolean | ArrayAllocFromBuffer (T **baseAddress, boolean inAquireMemory, uint32 elemCount, uint32 elemSpace) |
| void | UpdateDataPointer (void) |
| void | ZeroInternals (void) |
Protected Attributes | |
| friend | iterator |
| friend | const_iterator |
| uint32 | fElemCount |
| The number of elements in use. | |
| uint32 | fElemSpace |
| The number of elements allocated (unconstructed). | |
| uint32 | fArrayFlags |
| Flags that control the behavior of the array. | |
| T ** | fArrayData |
| The memory block used by the array. | |
Indexes to access the Array classes are ZERO based (array[0] gives you the first element)
Arrays grows dynamically as you add elements. For better efficiency, preallocate the number of elements you'll need (or use an estimation of the space if possible).
In eSmartGrow mode (the default), the size of the extra space added when the array is reallocated (the grow size) depends on the number of elements already in the array. Otherwise, a constant grow size is used.
Other array classes are: TMCArray, TMCPtrArray, TMCClassArray and TMCExtensibleArray.
| typedef T TMCCountedPtrArray< T >::TTemplateType |
| typedef T* TMCCountedPtrArray< T >::TValueType |
The template type on which the array is based.
| typedef TMCPtrIterator<T, TMCCountedPtrArray<T> > TMCCountedPtrArray< T >::iterator |
Declare iterator types for this array
| typedef TMCConstPtrIterator<T, TMCCountedPtrArray<T> > TMCCountedPtrArray< T >::const_iterator |
Declare iterator types for this array
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | void | ) | [inline] |
A type that represents the data type stored in the array.
Creates an empty array
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | uint32 | initialCount | ) | [inline, explicit] |
Constructs an array with a certain number of elements already accessible (and initialized to NULL).
| initialCount | initial number of array elements. |
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | uint32 | initialCount, | |
| uint32 | initialSpace, | |||
| uint32 | initialGrowSize | |||
| ) | [inline] |
Constructs an array with a certain number of elements already accessible (and constructed), and/or some extra space to extend the array without reallocating it.
| initialCount | Initial number of array elements. | |
| initialSpace | Pre-allocate space for this many elements (must be bigger than initialCount). | |
| initialGrowSize | How many elements to grow the array when we grow past the end |
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | const TMCCountedPtrArray< T > & | inFromArray | ) | [inline] |
Copy constructor: Construct an array from an existing array.
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | const TMCPtrArray< T > & | inFromPtrArray | ) | [inline] |
Copy constructor: Construct an array from an existing array.
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | T **const & | baseAddress, | |
| boolean | inAquireMemory, | |||
| uint32 | elemCount, | |||
| uint32 | elemSpace | |||
| ) | [inline] |
Constructs an array from existing memory.
| baseAddress | External memory to use for this array. | |
| inAquireMemory | Should we take possession this memory. | |
| elemCount | The number of array elements in use in that memory. | |
| elemSpace | The number of array elements that can be used in that memory. |
| TMCCountedPtrArray< T >::TMCCountedPtrArray | ( | TMCCountedPtrArray< T > & | array, | |
| uint32 | elemStart, | |||
| uint32 | elemCount | |||
| ) | [inline] |
Constructs an alias to an existing array.
| array | Alias elements from this array. | |
| elemStart | Start alias here. | |
| elemCount | Alias this many elements. |
| TMCCountedPtrArray< T >::~TMCCountedPtrArray | ( | void | ) | [inline] |
Releases all the elements of the array and frees the memory (if the array owns it).
| void TMCCountedPtrArray< T >::QueryArray | ( | const MCIID & | iid, | |
| TArray2 & | outArray | |||
| ) | const [inline] |
Fills outArray.
| boolean TMCCountedPtrArray< T >::ArrayAlloc | ( | uint32 | initialCount, | |
| uint32 | initialSpace, | |||
| uint32 | initialGrowSize | |||
| ) | [inline, protected] |
!!! DO NOT CALL THIS !!!
| boolean TMCCountedPtrArray< T >::ArrayAllocFromBuffer | ( | T ** | baseAddress, | |
| boolean | inAquireMemory, | |||
| uint32 | elemCount, | |||
| uint32 | elemSpace | |||
| ) | [inline, protected] |
!!! DO NOT CALL THIS !!!
| void TMCCountedPtrArray< T >::ArrayFree | ( | void | ) | [inline] |
Releases all the elements of the array and frees the memory (if the array owns it) And sets the element count to 0.
| boolean TMCCountedPtrArray< T >::IsValid | ( | void | ) | const [inline] |
IsValid(): Check to see if the class is valid.
| int8* TMCCountedPtrArray< T >::BaseAddress | ( | void | ) | [inline] |
Returns the address at which the elements of the array begin
| const int8* TMCCountedPtrArray< T >::BaseAddress | ( | void | ) | const [inline] |
Returns the address at which the elements of the array begin
| uint32 TMCCountedPtrArray< T >::GetElemSize | ( | void | ) | const [inline] |
Returns the size of one element (sizeof(T*))
| uint32 TMCCountedPtrArray< T >::GetGrowSize | ( | void | ) | const [inline] |
Returns the size by which the array grows
| uint32 TMCCountedPtrArray< T >::GetElemSpace | ( | void | ) | const [inline] |
Returns the number of elements that can be stored in the array (before the next reallocation)
| uint32 TMCCountedPtrArray< T >::GetElemCount | ( | void | ) | const [inline] |
Returns the actual number of (valid) elements in the array. Those elements can be accessed with the operator []
| boolean TMCCountedPtrArray< T >::ExternalMemory | ( | ) | [inline] |
Returns true if the array doesn't own its memory
| boolean TMCCountedPtrArray< T >::GetSmartGrow | ( | void | ) | const [inline] |
Returns true if the grow size is dynamic
| T** TMCCountedPtrArray< T >::ArrayData | ( | void | ) | [inline] |
Returns a pointer to the first element
| T** const TMCCountedPtrArray< T >::ArrayData | ( | void | ) | const [inline] |
Returns a pointer to the first element
| void TMCCountedPtrArray< T >::SetValid | ( | boolean | valid | ) | [inline] |
Sets the valid flag to true
| void TMCCountedPtrArray< T >::SetGrowSize | ( | uint32 | g | ) | [inline] |
Sets the growSize (and sets the eSmartGrow flag to false)
| void TMCCountedPtrArray< T >::SetSmartGrow | ( | ) | [inline] |
Sets the eSmartGrow flag and computes the maximum grow size (in elements count)
| boolean TMCCountedPtrArray< T >::SetElemSpace | ( | uint32 | n | ) | [inline] |
Set the number of elements to have memory allocated for.
| boolean TMCCountedPtrArray< T >::SetElemCount | ( | uint32 | n | ) | [inline] |
Set the number of elements in the array.
| boolean TMCCountedPtrArray< T >::AddElemCount | ( | uint32 | n | ) | [inline] |
Add the passed in number of elemens to the array.
| const_iterator TMCCountedPtrArray< T >::Begin | ( | void | ) | const [inline] |
Returns a reference to the begining iterator for the array.
| iterator TMCCountedPtrArray< T >::Begin | ( | void | ) | [inline] |
Returns a reference to the begining iterator for the array.
| const_iterator TMCCountedPtrArray< T >::End | ( | void | ) | const [inline] |
| iterator TMCCountedPtrArray< T >::End | ( | void | ) | [inline] |
| void TMCCountedPtrArray< T >::FirstElem | ( | T ** | data | ) | [inline] |
Returns the first element in the array (addrefs it).
| T * TMCCountedPtrArray< T >::FirstElemNoAddRef | ( | void | ) | [inline] |
Returns the first element in the array (without calling addref on it).
| const T * TMCCountedPtrArray< T >::FirstElemNoAddRef | ( | void | ) | const [inline] |
Returns the first element in the array (without calling addref on it).
| void TMCCountedPtrArray< T >::LastElem | ( | T ** | data | ) | [inline] |
| T * TMCCountedPtrArray< T >::LastElemNoAddRef | ( | void | ) | [inline] |
Returns the last element in the array (without calling addref on it).
| const T * TMCCountedPtrArray< T >::LastElemNoAddRef | ( | void | ) | const [inline] |
Returns the last element in the array (without calling addref on it).
| void TMCCountedPtrArray< T >::Erase | ( | const iterator & | elementToErase | ) | [inline] |
Erases a single element in the array that is referenced by the iterator.
| void TMCCountedPtrArray< T >::Erase | ( | const iterator & | start, | |
| const iterator & | end | |||
| ) | [inline] |
Erases a range of elements in the array from the startIterator to the endIterator.
| boolean TMCCountedPtrArray< T >::CopyElems | ( | const TMCCountedPtrArray< T > & | fromArray, | |
| uint32 | startIndex, | |||
| uint32 | nbItems, | |||
| uint32 | insertIndex | |||
| ) | [inline] |
Copy elements from one array to another.
| boolean TMCCountedPtrArray< T >::Append | ( | const TMCCountedPtrArray< T > & | fromArray | ) | [inline] |
Append one array on to the end of another.
| TMCCountedPtrArray< T > & TMCCountedPtrArray< T >::operator= | ( | const TMCCountedPtrArray< T > & | fromArray | ) | [inline] |
operator=: Assignment operator copies all the data from one array to another.
| TMCCountedPtrArray< T > & TMCCountedPtrArray< T >::operator= | ( | const TMCPtrArray< T > & | fromPtrArray | ) | [inline] |
operator=: Assignment operator copies all the data from one array to another.
| T* TMCCountedPtrArray< T >::operator[] | ( | uint32 | i | ) | [inline] |
Returns the data at the passed in index.
| i | the index of the element to return |
| T* TMCCountedPtrArray< T >::operator[] | ( | uint32 | i | ) | const [inline] |
Returns the data at the passed in index.
| i | the index of the element to return |
| boolean TMCCountedPtrArray< T >::SetElem | ( | uint32 | index, | |
| T * | data | |||
| ) | [inline] |
Set the contents of array index to the passed in data reference.
| boolean TMCCountedPtrArray< T >::GetElem | ( | uint32 | index, | |
| T ** | data | |||
| ) | const [inline] |
Get the contents of arrray index into the passed in data reference.
| boolean TMCCountedPtrArray< T >::AddElem | ( | T * | data | ) | [inline] |
Add an element to the end of the array and assign it the data reference that is passed in.
| boolean TMCCountedPtrArray< T >::InsertElem | ( | uint32 | index, | |
| T * | data | |||
| ) | [inline] |
Inserts one element at the given index
| index | where to insert | |
| data | the data to insert |
| boolean TMCCountedPtrArray< T >::RemoveElem | ( | uint32 | index, | |
| uint32 | count | |||
| ) | [inline] |
Removes one or more elements from the array starting from the passed in index.
Reimplemented in TTimeBasedList.
| void TMCCountedPtrArray< T >::RemoveElem | ( | T * | elemToRemove | ) | [inline] |
Removes one element from the array starting from the passed in index.
| boolean TMCCountedPtrArray< T >::CompactArray | ( | void | ) | [inline] |
Gets rid of any space that has been allocated to the array and isn't being used.
| uint32 TMCCountedPtrArray< T >::FindElem | ( | const T * | item | ) | const [inline] |
Finds the index in this array of the given element
| item | the element to search for |
| void TMCCountedPtrArray< T >::CheckLastRefs | ( | ) | [inline] |
In debug, verifies that the refcount of every object in the array is 1 (ie they'll be deleted when the array is destroyed)
| T** TMCCountedPtrArray< T >::Pointer | ( | uint32 | i | ) | [inline] |
Returns a pointer to the data at the passed in index.
| const T** TMCCountedPtrArray< T >::Pointer | ( | uint32 | i | ) | const [inline] |
Returns a pointer to the data at the passed in index.
| void TMCCountedPtrArray< T >::Swap | ( | TMCCountedPtrArray< T > & | fromArray | ) | [inline] |
| void TMCCountedPtrArray< T >::UpdateDataPointer | ( | void | ) | [inline, protected] |
| void TMCCountedPtrArray< T >::ZeroInternals | ( | void | ) | [inline, protected] |
friend TMCCountedPtrArray< T >::iterator [protected] |
friend TMCCountedPtrArray< T >::const_iterator [protected] |
uint32 TMCCountedPtrArray< T >::fElemCount [protected] |
The number of elements in use.
uint32 TMCCountedPtrArray< T >::fElemSpace [protected] |
The number of elements allocated (unconstructed).
uint32 TMCCountedPtrArray< T >::fArrayFlags [protected] |
Flags that control the behavior of the array.
T** TMCCountedPtrArray< T >::fArrayData [protected] |
The memory block used by the array.
1.5.3