FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoArray< T > Class Template Reference

#include <Array.h>

List of all members.


Detailed Description

template<typename T>
class FdoArray< T >

Abstract template class for defining dynamic arrays.

WARNING: This array uses a single memory allocation to store array elements and may re-allocate that memory when the array size needs to change. Therefore, do not keep pointers to array elements and avoid using for objects which cannot be safely moved around in memory or which have non-empty destructors.

Definition at line 68 of file Array.h.


Public Member Functions

FdoInt32 AddRef ()
 Increase the reference count.
void Clear ()
 Removes all items from the array.
FdoInt32 GetCount () const
 Gets the number of items in the array.
const T * GetData () const
 Get a pointer to the data in the array.
T * GetData ()
 Get a pointer to the data in the array.
FdoInt32 GetRefCount ()
 Retrieves the reference count.
T & operator[] (int i)
 Provide index operator [] access to array members.
const T & operator[] (int i) const
 Provide index operator [] access to array members.
FdoInt32 Release ()
 Decrease the reference count.

Static Public Member Functions

FdoArray< T > * Append (FdoArray< T > *array, T element)
 Adds the specified item to the end of the array. Returns a new array pointer.
FdoArray< T > * Append (FdoArray< T > *array, FdoInt32 numElements, T *elements)
 Adds the specified array of items to the end of the array. Returns a new array pointer.
FdoArray< T > * Create (const T *elements, FdoInt32 initialNumElements)
 Create a dynamic array from a pointer to a fixed array.
FdoArray< T > * Create (FdoInt32 initialAlloc)
 Create a dynamic array preallocated to a specific size.
FdoArray< T > * Create ()
 Create an empty array.
FdoArray< T > * SetSize (FdoArray< T > *array, FdoInt32 numElements)
 Resize the array.

Protected Member Functions

void Dispose ()
 the rest of FdoIDisposable
 FdoArray ()
 Constructor.
T & GetValue (FdoInt32 i)
const T & GetValue (FdoInt32 i) const
 Access elements.
void SetValue (FdoInt32 i, T newElement)

Static Protected Member Functions

FdoArray< T > * AllocMore (FdoArray< T > *array, FdoInt32 atLeastThisMuch, bool exactly)
FdoArray< T > * SetAlloc (FdoArray< T > *array, FdoInt32 numElements)

Constructor & Destructor Documentation

template<typename T>
FdoArray< T >::FdoArray  )  [inline, protected]
 

Constructor.

Definition at line 224 of file Array.h.


Member Function Documentation

template<typename T>
FdoInt32 FdoArray< T >::AddRef  )  [inline]
 

Increase the reference count.

Returns:
Returns the new reference count. For debugging use only.

Definition at line 108 of file Array.h.

template<class T>
FdoArray< T > * FdoArray< T >::AllocMore FdoArray< T > *  array,
FdoInt32  atLeastThisMuch,
bool  exactly
[inline, static, protected]
 

Definition at line 316 of file Array.h.

References FdoArrayHelper::AllocMore().

Referenced by FdoArray< T >::Create().

Here is the call graph for this function:

template<class T>
FdoArray< T > * FdoArray< T >::Append FdoArray< T > *  array,
element
[inline, static]
 

Adds the specified item to the end of the array. Returns a new array pointer.

Parameters:
array Input array pointer
element Input item to be appended to array
Returns:
Returns the new array pointer.

Definition at line 272 of file Array.h.

References FdoArrayHelper::AllocMore(), and FdoArray< T >::GetValue().

Here is the call graph for this function:

template<class T>
FdoArray< T > * FdoArray< T >::Append FdoArray< T > *  array,
FdoInt32  numElements,
T *  elements
[inline, static]
 

Adds the specified array of items to the end of the array. Returns a new array pointer.

Parameters:
array Input array pointer
numElements Input number of items to be added
elements Input pointer to array to append
Returns:
Returns the new array pointer.

Definition at line 264 of file Array.h.

References FdoArrayHelper::Append(), and FdoByte.

Here is the call graph for this function:

template<class T>
void FdoArray< T >::Clear  )  [inline]
 

Removes all items from the array.

Returns:
Returns nothing

Definition at line 284 of file Array.h.

References FdoArray< T >::SetSize().

Here is the call graph for this function:

template<class T>
FdoArray< T > * FdoArray< T >::Create const T *  elements,
FdoInt32  initialNumElements
[inline, static]
 

Create a dynamic array from a pointer to a fixed array.

Parameters:
elements Input pointer to array of elements
initialNumElements Input number of elements to be added
Returns:
Returns a FdoArray pointer

Definition at line 254 of file Array.h.

References FdoArray< T >::AllocMore(), FdoArrayHelper::Append(), and FdoByte.

Here is the call graph for this function:

template<class T>
FdoArray< T > * FdoArray< T >::Create FdoInt32  initialAlloc  )  [inline, static]
 

Create a dynamic array preallocated to a specific size.

Parameters:
initialAlloc Input initial size of the array
Returns:
Returns a FdoArray pointer

Definition at line 247 of file Array.h.

References FdoArray< T >::AllocMore().

Here is the call graph for this function:

template<class T>
FdoArray< T > * FdoArray< T >::Create  )  [inline, static]
 

Create an empty array.

Returns:
Returns a FdoArray pointer

Definition at line 240 of file Array.h.

References FdoArray< T >::AllocMore().

Here is the call graph for this function:

template<class T>
void FdoArray< T >::Dispose  )  [inline, protected]
 

the rest of FdoIDisposable

Definition at line 324 of file Array.h.

References FdoArrayHelper::DisposeOfArray().

Here is the call graph for this function:

template<typename T>
FdoInt32 FdoArray< T >::GetCount  )  const [inline]
 

Gets the number of items in the array.

Returns:
Returns number of items in the array

Definition at line 143 of file Array.h.

Referenced by FdoArray< T >::GetValue(), and FdoArray< T >::SetValue().

template<typename T>
const T* FdoArray< T >::GetData  )  const [inline]
 

Get a pointer to the data in the array.

Returns:
Returns a pointer to the data

Definition at line 157 of file Array.h.

template<typename T>
T* FdoArray< T >::GetData  )  [inline]
 

Get a pointer to the data in the array.

Returns:
Returns a pointer to the data

Definition at line 150 of file Array.h.

Referenced by FdoArray< T >::GetValue(), FdoIoObjectStreamReader< FdoByte >::ReadNext(), and FdoArray< T >::SetValue().

template<typename T>
FdoInt32 FdoArray< T >::GetRefCount  )  [inline]
 

Retrieves the reference count.

Returns:
Returns the existing reference count value.

Definition at line 135 of file Array.h.

template<class T>
T & FdoArray< T >::GetValue FdoInt32  i  )  [inline, protected]
 

Definition at line 341 of file Array.h.

References FdoException::Create(), FDO_5_INDEXOUTOFBOUNDS, FDO_NLSID, FdoArray< T >::GetCount(), and FdoArray< T >::GetData().

Here is the call graph for this function:

template<class T>
const T & FdoArray< T >::GetValue FdoInt32  i  )  const [inline, protected]
 

Access elements.

Definition at line 331 of file Array.h.

References FdoException::Create(), FDO_5_INDEXOUTOFBOUNDS, FDO_NLSID, FdoArray< T >::GetCount(), and FdoArray< T >::GetData().

Referenced by FdoArray< T >::Append().

Here is the call graph for this function:

template<typename T>
T& FdoArray< T >::operator[] int  i  )  [inline]
 

Provide index operator [] access to array members.

Parameters:
i Input index to access
Returns:
Returns the value of the specified item in the array.

Definition at line 220 of file Array.h.

template<typename T>
const T& FdoArray< T >::operator[] int  i  )  const [inline]
 

Provide index operator [] access to array members.

Parameters:
i Input index to access
Returns:
Returns the value of the specified item in the array.

Definition at line 210 of file Array.h.

template<typename T>
FdoInt32 FdoArray< T >::Release  )  [inline]
 

Decrease the reference count.

Returns:
Returns the new reference count. For debugging use only.

Definition at line 115 of file Array.h.

template<class T>
FdoArray< T > * FdoArray< T >::SetAlloc FdoArray< T > *  array,
FdoInt32  numElements
[inline, static, protected]
 

Definition at line 300 of file Array.h.

References FdoArrayHelper::SetAlloc().

Here is the call graph for this function:

template<class T>
FdoArray< T > * FdoArray< T >::SetSize FdoArray< T > *  array,
FdoInt32  numElements
[inline, static]
 

Resize the array.

Returns:
Returns the new array pointer.

Definition at line 292 of file Array.h.

References FdoArrayHelper::SetSize().

Referenced by FdoArray< T >::Clear().

Here is the call graph for this function:

template<class T>
void FdoArray< T >::SetValue FdoInt32  i,
newElement
[inline, protected]
 

Definition at line 351 of file Array.h.

References FdoException::Create(), FDO_5_INDEXOUTOFBOUNDS, FDO_NLSID, FdoArray< T >::GetCount(), and FdoArray< T >::GetData().

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.