Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCArray Class Template Reference

Simple, all-purpose chunked array used by other classes. More...

#include <SIBCArray.h>

List of all members.

Public Methods


Detailed Description

template<class CElemType>
class CSIBCArray< CElemType >

Simple, all-purpose chunked array used by other classes.

This class is frequently used throughout the FTK and Semantic Layer. It is the desired method for using arrays.


Constructor & Destructor Documentation

template<class CElemType>
CSIBCArray< CElemType >::CSIBCArray const long    in_lNbElem = 0 [inline]
 

Constructor. Allocates in_lNbElem elements of storage in the new array.

Parameters:
in_lNbElem  Initial element storage space to allocate. (Defaults to 0).


Member Function Documentation

template<class CElemType>
long CSIBCArray< CElemType >::Add CElemType    in_Elem [inline]
 

Adds an element to the end of the array.

Parameters:
in_Elem  Element of the template declaration type to add at the end of the array.
Returns:
long Number of used elements in the array, with the new element added.
See also:
CSIBCArray::Reserve , CSIBCArray::Resize , CSIBCArray::Extend , CSIBCArray::InsertAt , CSIBCArray::operator[]

template<class CElemType>
long CSIBCArray< CElemType >::AllocatedMem   const [inline]
 

Returns the total memory allocated by element storage spaces in the array. This does not include the size of the SIBCArray object itself.

Returns:
long The amount of memory allocated by element storage spaces (in bytes).
See also:
CSIBCArray::GetSize , CSIBCArray::AllocatedMem

template<class CElemType>
CElemType* CSIBCArray< CElemType >::ArrayPtr void    [inline]
 

Returns the array used internally by this object.

Returns:
CElemType* Pointer to the first element in the internal array used by this object.

template<class CElemType>
CElemType* * CSIBCArray< CElemType >::ArrayPtrPtr void    [inline]
 

Returns a pointer to the array used internally by this object.

Returns:
CElemType** Pointer to a pointer to the first element in the internal array used by this object.

template<class CElemType>
int CSIBCArray< CElemType >::Become CSIBCArray< CElemType > &    in_rSrcObject [inline]
 

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.

Parameters:
in_rSrcObject  The object to take data from.
Returns:
int Always returns zero.
See also:
CSIBCArray::Copy

template<class CElemType>
int CSIBCArray< CElemType >::Copy const CSIBCArray< CElemType > &    in_rSrcObject [inline]
 

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.

Parameters:
in_rSrcObject  The array source to copy data from.
Returns:
int Returns the number of elements used.
See also:
CSIBCArray::operator=

template<class CElemType>
void CSIBCArray< CElemType >::DeleteAt const long    in_lIndex,
const long    in_lNbElem
[inline]
 

Deletes nb element storage spaces at the array index idx.

Parameters:
idx  Index to begin element deletion
nb  Number of elements to delete.
See also:
CSIBCArray::InsertAt , CSIBCArray::Set

template<class CElemType>
void CSIBCArray< CElemType >::DisposeData void    [inline]
 

Deletes all element storage spaces, and sets allocated and used element storage spaces both to zero.

See also:
CSIBCArray::Become

template<class CElemType>
long CSIBCArray< CElemType >::Extend const long    in_lNbElem [inline]
 

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().

Parameters:
in_lNbElem  Number of extra elements to set to used in the array.
Returns:
long Number of used elements in the extended array.
See also:
CSIBCArray::Reserve , CSIBCArray::Resize , CSIBCArray::InsertAt , CSIBCArray::Add

template<class CElemType>
long CSIBCArray< CElemType >::GetSize   const [inline]
 

Returns the number of allocated element storage spaces.

Returns:
long Number of allocated element storage spaces.
See also:
CSIBCArray::GetUsed , CSIBCArray::AllocatedMem

template<class CElemType>
long CSIBCArray< CElemType >::GetUsed   const [inline]
 

Returns the number of element storage spaces that contain valid elements.

Returns:
long Number of used element storage spaces.
See also:
CSIBCArray::GetSize , CSIBCArray::UsedMem

template<class CElemType>
long CSIBCArray< CElemType >::InsertAt const long    in_lIndex,
const long    in_lNbElem
[inline]
 

Inserts nb element storage spaces at the array index idx.

Parameters:
idx  Index to insert element storage spaces at.
nb  Number of element storage spaces to insert.
Returns:
long Number of used elements in the array, after the insertion.
See also:
CSIBCArray::Reserve , CSIBCArray::Resize , CSIBCArray::Extend , CSIBCArray::DeleteAt , CSIBCArray::Set

template<class CElemType>
CSIBCArray< CElemType > & CSIBCArray< CElemType >::operator= const CSIBCArray< CElemType > &    i_That [inline]
 

Sets this array to contain the same information as in_rSrcObject. The functionality is equivalent to SIBCArray::Copy.

Parameters:
in_rSrcObject  Array object to copy data from.
Returns:
SIBCArray<CElemType>& Reference to this array.
See also:
CSIBCArray::Copy

template<class CElemType>
CElemType & CSIBCArray< CElemType >::operator[] const unsigned long    in_lIndex [inline]
 

Indexing operator. Returns a reference to the element at the index in_lIndex.

Parameters:
in_lIndex  Index of the parameter to get.
Returns:
CElemType& Reference to the element at the index in_lIndex.
See also:
CSIBCArray::Add , CSIBCArray::Set

template<class CElemType>
CElemType & CSIBCArray< CElemType >::operator[] const unsigned long    in_lIndex const [inline]
 

Indexing operator. Returns a reference to the element at the index in_lIndex.

Parameters:
in_lIndex  Index of the parameter to get.
Returns:
CElemType& Reference to the element at the index in_lIndex.
See also:
CSIBCArray::Add , CSIBCArray::Set

template<class CElemType>
long CSIBCArray< CElemType >::Pack long    i_MaxWasted = 4 [inline]
 

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.

Parameters:
i_MaxWasted  Number of elements required to be wasted before packing occurs (defaults to 4).
Returns:
long Number of elements used in the array.
See also:
CSIBCArray::DisposeData

template<class CElemType>
long CSIBCArray< CElemType >::Reserve const long    in_lNbElem [inline]
 

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.

Parameters:
in_lNbElem  Number of element storage spaces to reserve.
Returns:
long The number of elements used in the array.
See also:
CSIBCArray::Resize , CSIBCArray::Extend , CSIBCArray::InsertAt

template<class CElemType>
long CSIBCArray< CElemType >::Resize const long    in_lNewNbElem [inline]
 

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.

Parameters:
in_lNewNbElem  Number of elements to resize the array to.
Returns:
long Number of used elements in the resized array.
See also:
CSIBCArray::Reserve , CSIBCArray::Extend , CSIBCArray::InsertAt

template<class CElemType>
void CSIBCArray< CElemType >::Set long    start,
long    nb,
CElemType    value
[inline]
 

Sets a given number of elements, nb, starting at index start to the element given by value.

Parameters:
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.

template<class CElemType>
long CSIBCArray< CElemType >::UsedMem   const [inline]
 

Returns the amount memory used by element storage spaces that contain valid elements.

Returns:
long The amount of memory used by valid element storage (in bytes).
See also:
CSIBCArray::GetUsed , CSIBCArray::AllocatedMem


The documentation for this class was generated from the following file: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.