#include <SIBCArray.h>
Public Member Functions |
|
| CSIBCArray (const long in_lNbElem=0) | |
| long | GetUsed () const |
| long | GetSize () const |
| long | UsedMem () const |
| long | AllocatedMem () const |
| long | Reserve (const long in_lNbElem) |
| long | Resize (const long in_lNewNbElem) |
| long | Extend (const long in_lNbElem) |
| long | Add (CElemType in_Elem) |
| long | InsertAt (const long idx, const long nb) |
| void | DeleteAt (const long idx, const long nb) |
| CElemType & | operator[] (const unsigned long in_lIndex) const |
| CElemType & | operator[] (const unsigned long in_lIndex) |
| long | Pack (long i_MaxWasted=4) |
| void | DisposeData (void) |
| int | Become (CSIBCArray< CElemType > &in_rSrcObject) |
| int | Copy (const CSIBCArray< CElemType > &in_rSrcObject) |
| CSIBCArray< CElemType > & | operator= (const CSIBCArray< CElemType > &in_rSrcObject) |
| CElemType * | ArrayPtr (void) |
| CElemType ** | ArrayPtrPtr (void) |
| void | Set (long start, long nb, CElemType value) |
This class is frequently used throughout the FTK and Semantic Layer. It is the desired method for using arrays.
| CSIBCArray | ( | const long | in_lNbElem = 0 |
) | [inline] |
Constructor. Allocates in_lNbElem elements of storage in the new array.
| in_lNbElem | Initial element storage space to allocate. (Defaults to 0). |
| long GetUsed | ( | ) | const [inline] |
Returns the number of element storage spaces that contain valid elements.
Returns the number of allocated element storage spaces.
Returns the amount memory used by element storage spaces that contain valid elements.
Returns the total memory allocated by element storage spaces in the array. This does not include the size of the SIBCArray object itself.
Marks in_lNbElem elements as used. If there is sufficient allocated space to reserve in_lNbElem, no extra element storage is allocated. Otherwise, storage space is resized to make room for exactly in_lNbElem storage spaces.
| in_lNbElem | Number of element storage spaces to reserve. |
Changes the number of cells used in the array to in_lNewNbElem. If there is sufficient space allocated to set in_lNewNbElem elements used, no space is allocated. Otherwise, twice the requested number of elements are allocated to the array, and in_lNewNbElem spaces are set to used. This is done so allocation occurs less frequently.
| in_lNewNbElem | Number of elements to resize the array to. |
Extends the number of cells used in the array by in_lNbElem elements. This is equivalent to calling SIBCArray::Resize with in_lNbElem + SIBCArray::GetUsed().
| in_lNbElem | Number of extra elements to set to used in the array. |
Adds an element to the end of the array.
| in_Elem | Element of the template declaration type to add at the end of the array. |
Inserts nb element storage spaces at the array index idx.
| idx | Index to insert element storage spaces at. | |
| nb | Number of element storage spaces to insert. |
Deletes nb element storage spaces at the array index idx.
| idx | Index to begin element deletion | |
| nb | Number of elements to delete. |
Indexing operator. Returns a reference to the element at the index in_lIndex.
| in_lIndex | Index of the parameter to get. |
in_lIndex. | CElemType & operator[] | ( | const unsigned long | in_lIndex | ) | [inline] |
Indexing operator. Returns a reference to the element at the index in_lIndex.
| in_lIndex | Index of the parameter to get. |
in_lIndex.
Discards element storage spaces allocated but not used in the array, if at least i_MaxWasted elements are unused. Note: This function should only be used after major array sizing is done.
| i_MaxWasted | Number of elements required to be wasted before packing occurs (defaults to 4). |
Deletes all element storage spaces, and sets allocated and used element storage spaces both to zero.
Sets this array to contain all data from the in_rSrcObject array, and then sets the in_rSrcObject to contain no elements. This destroys all data originally contained within this array.
| in_rSrcObject | The object to take data from. |
Allocates memory in which to store as many (or more) elements contained in in_rSrcObject, and copies the data from in_rSrcObject into this array. This destroy all data originally stored within this array.
| in_rSrcObject | The array source to copy data from. |
Sets this array to contain the same information as in_rSrcObject. The functionality is equivalent to SIBCArray::Copy.
| in_rSrcObject | Array object to copy data from. |
Returns the array used internally by this object.
Returns a pointer to the array used internally by this object.
Sets a given number of elements, nb, starting at index start to the element given by value.
| start | The index to start the modification of elements. | |
| nb | Number of elements to set the value of. | |
| value | The value to set the elements to. |