|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
template<class TYPE> class XArray { public: XArray(); ~XArray(); public: int GetSize(); void SetSize(int nSize) const; void RemoveAll(); TYPE GetAt(int nIndex) const; void SetAt(int nIndex, const TYPE &element); const TYPE *GetData() const; TYPE *GetData(); int Add(const TYPE &element); void InsertAt(int nIndex, const TYPE &element, int nCount=1); void RemoveAt(int nIndex, int nCount=1); TYPE &operator[](int nIndex); TYPE operator[](int nIndex) const; };
The template class for variable-sized arrays.
Constructor/Destructor Summary | |
XArray
();
����������Constructs the array. |
|
~XArray
();
����������Destroys the array. |
Function Summary | |
int
|
GetSize
() const;
����������Returns the number of elements in this array. |
void
|
SetSize
(int nSize);
����������Sets the number of elements in this array. |
void
|
RemoveAll
();
����������Removes all elements from this array. |
TYPE
|
GetAt
(int nIndex) const;
����������Returns the element at the given index in this array. |
void
|
SetAt
(int nIndex, const TYPE &element);
����������Sets the element at the given index in this array. |
const�TYPE�*
|
GetData
() const;
����������Returns the pointer to the C++ array containing all elements of this array. |
TYPE�*
|
GetData
();
����������Returns the pointer to the C++ array containing all elements of this array. |
int
|
Add
(const TYPE &element);
����������Adds the specified element to the end of this array. |
void
|
InsertAt
(int nIndex, const TYPE &element, int nCount=1);
����������Inserts the specified element at the specified index into this array. |
void
|
RemoveAt
(int nIndex, int nCount=1);
����������Removes elements at the specified index from this array. |
TYPE�&
|
operator[]
(int nIndex);
����������Returns the reference to the element at the specified index in this array. |
TYPE
|
operator[]
(int nIndex) const;
����������Returns the element at the specified index in this array. |
Constructor/Destructor Detail |
XArray();
Constructs the array.
The array is initially empty.
~XArray();
Destroys the array.
Function Detail |
int GetSize() const;
Returns the number of elements in this array.
void SetSize(int nSize);
Sets the number of elements in this array.
nSize
- the new number of elementsvoid RemoveAll();
Removes all elements from this array.
TYPE GetAt(int nIndex) const;
Returns the element at the given index in this array.
The result is unspecified if the index is out of range.
nIndex
- the index (zero-based)void SetAt(int nIndex, const TYPE &element);
Sets the element at the given index in this array.
The result is unspecified if the index is out of range.
nIndex
- the index (zero-based)element
- the new elementconst TYPE *GetData() const;
Returns the pointer to the C++ array containing all elements of this array.
This pointer may become invalid after any operation that modifies content of this array.
TYPE *GetData();
Returns the pointer to the C++ array containing all elements of this array.
This pointer may become invalid after any operation that modifies content of this array.
int Add(const TYPE &element);
Adds the specified element to the end of this array.
element
- the element to addvoid InsertAt(int nIndex, const TYPE &element, int nCount=1);
Inserts the specified element at the specified index into this array.
The index may be greater than the number of elements in this array.
nIndex
- the index (zero-based)element
- the element to insertnCount
- the repetition countvoid RemoveAt(int nIndex, int nCount=1);
Removes elements at the specified index from this array.
The result is unspecified if the index is out of range.
nIndex
- the index (zero-based)nCount
- the number of elements to removeTYPE &operator[](int nIndex);
Returns the reference to the element at the specified index in this array.
The result is unspecified if the index is out of range.
nIndex
- the index (zero-based)TYPE operator[](int nIndex) const;
Returns the element at the specified index in this array.
The result is unspecified if the index is out of range.
nIndex
- the index (zero-based)
|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |