Web API Reference MapGuide Open Source

GisArray< T > Class Template Reference

List of all members.

Detailed Description

template<typename T>
class GisArray< 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.


Public Member Functions

INT32 AddRef ()
 GisIDisposable simulation Increase the reference count.
void Clear ()
 Removes all items from the array.
INT32 GetCount () const
 simple access (count and data) 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.
T & operator[] (int i)
 Provide index operator [] access to array members.
const T & operator[] (int i) const
 overloaded operators Provide index operator [] access to array members.
INT32 Release ()
 Decrease the reference count.

Static Public Member Functions

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