CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csArray< T, ElementHandler, MemoryAllocator > Class Template Reference

A templated array class. More...

#include <csutil/array.h>

List of all members.

Public Member Functions

 csArray (size_t icapacity=0, size_t ithreshold=0)
 Initialize object to have initial capacity of 'icapacity' elements, and to increase storage by 'ithreshold' each time the upper bound is exceeded.
 ~csArray ()
 Destructor.
 csArray (const csArray &source)
 Copy constructor.
csArray< T, ElementHandler > & operator= (const csArray &other)
 Assignment operator.
size_t Length () const
 Return the number of elements in the Array.
size_t Capacity () const
 Query vector capacity. Note that you should rarely need to do this.
void TransferTo (csArray &destination)
 Transfer the entire contents of one array to the other.
void SetLength (size_t n, T const &what)
 Set the actual number of items in this array.
void SetLength (size_t n)
 Set array length to n.
T & Get (size_t n)
 Get an element (non-const).
T const & Get (size_t n) const
 Get an element (const).
T & GetExtend (size_t n)
 Get an item from the array.
T & operator[] (size_t n)
 Get an element (non-const).
T const & operator[] (size_t n) const
 Get a const reference.
void Put (size_t n, T const &what)
 Put an element at some position.
template<class K>
size_t FindKey (csArrayCmp< T, K > comparekey) const
 Find an element based on some key.
size_t Push (T const &what)
 Push an element onto the tail end of the array. Returns index of element.
size_t PushSmart (T const &what)
 Push a element onto the tail end of the array if not already present.
Pop ()
 Pop an element from tail end of array.
T const & Top () const
 Return the top element but do not remove it.
T & Top ()
 Return the top element but do not remove it.
bool Insert (size_t n, T const &item)
 Insert element 'item' before element 'n'.
csArray< T > Section (size_t low, size_t high) const
 Get the portion of the array between low and high inclusive.
template<class K>
size_t FindSortedKey (csArrayCmp< T, K > comparekey, size_t *candidate=0) const
 Find an element based on some key, using a comparison function.
size_t InsertSorted (const T &item, int(*compare)(T const &, T const &)=DefaultCompare, size_t *equal_index=0)
 Insert an element at a sorted position, using an element comparison function.
size_t Find (T const &which) const
 Find a element in array and return its index (or csArrayItemNotFound if not found).
size_t GetIndex (const T *which) const
 Given a pointer to an element in the array this function will return the index.
void Sort (int(*compare)(T const &, T const &)=DefaultCompare)
 Sort array.
void DeleteAll ()
 Clear entire vector.
void Truncate (size_t n)
 Truncate array to specified number of elements.
void Empty ()
 Remove all elements.
void SetCapacity (size_t n)
 Set vector capacity to approximately 'n' elements.
void ShrinkBestFit ()
 Make the array just as big as it needs to be.
bool DeleteIndex (size_t n)
 Delete element number 'n' from vector.
bool DeleteIndexFast (size_t n)
 Delete element number 'n' from vector.
void DeleteRange (size_t start, size_t end)
 Delete a given range (inclusive).
bool Delete (T const &item)
 Delete the given element from vector.
bool DeleteFast (T const &item)
 Delete the given element from vector.
Iterator GetIterator () const
 Returns an Iterator which traverses the Array.

Static Public Member Functions

int DefaultCompare (T const &r1, T const &r2)
 Compare two objects of the same type.

Protected Member Functions

void InitRegion (size_t start, size_t count)
 Initialize a region.


Detailed Description

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
class csArray< T, ElementHandler, MemoryAllocator >

A templated array class.

The objects in this class are constructed via copy-constructor and are destroyed when they are removed from the array or the array is destroyed. Note: If you want to store reference-counted object pointers (such as iSomething*), then you should look at csRefArray instead of this class.

Definition at line 321 of file array.h.


Constructor & Destructor Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
csArray< T, ElementHandler, MemoryAllocator >::csArray size_t  icapacity = 0,
size_t  ithreshold = 0
[inline]
 

Initialize object to have initial capacity of 'icapacity' elements, and to increase storage by 'ithreshold' each time the upper bound is exceeded.

Definition at line 437 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
csArray< T, ElementHandler, MemoryAllocator >::~csArray  )  [inline]
 

Destructor.

Definition at line 459 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
csArray< T, ElementHandler, MemoryAllocator >::csArray const csArray< T, ElementHandler, MemoryAllocator > &  source  )  [inline]
 

Copy constructor.

Definition at line 465 of file array.h.


Member Function Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::Capacity  )  const [inline]
 

Query vector capacity. Note that you should rarely need to do this.

Definition at line 490 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
int csArray< T, ElementHandler, MemoryAllocator >::DefaultCompare T const &  r1,
T const &  r2
[inline, static]
 

Compare two objects of the same type.

Parameters:
r1 Reference to first object.
r2 Reference to second object.
Returns:
Zero if the objects are equal; less-than-zero if the first object is less than the second; or greater-than-zero if the first object is greater than the second.
Remarks:
Assumes the existence of T::operator<(T). This is the default comparison function used by csArray for sorting if the client does not provide a custom function.

Definition at line 428 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
bool csArray< T, ElementHandler, MemoryAllocator >::Delete T const &  item  )  [inline]
 

Delete the given element from vector.

Definition at line 937 of file array.h.

Referenced by csFIFO< csRef< iJob > >::Delete(), and csObjectModel::RemoveListener().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::DeleteAll  )  [inline]
 

Clear entire vector.

Definition at line 798 of file array.h.

Referenced by csTreeNode::BSF(), csFrameDataHolder< csRenderMeshPtr >::Clear(), csFIFO< csRef< iJob > >::DeleteAll(), and csArray< csShaderVariable *, csRefArrayElementHandler< csShaderVariable * > >::TransferTo().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
bool csArray< T, ElementHandler, MemoryAllocator >::DeleteFast T const &  item  )  [inline]
 

Delete the given element from vector.

This is a special version of Delete() that doesn't preserve the order of the elements that remain. This is a lot faster for big arrays though.

Definition at line 951 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
bool csArray< T, ElementHandler, MemoryAllocator >::DeleteIndex size_t  n  )  [inline]
 

Delete element number 'n' from vector.

Definition at line 874 of file array.h.

Referenced by csTreeNode::BSF(), csBlockAllocator< csBSPTree >::Compact(), and csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::DeleteElement().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
bool csArray< T, ElementHandler, MemoryAllocator >::DeleteIndexFast size_t  n  )  [inline]
 

Delete element number 'n' from vector.

This is a special version of DeleteIndex() that doesn't preserve the order of the elements that remain. This is a lot faster for big arrays though.

Definition at line 896 of file array.h.

Referenced by csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::Delete(), and csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::DeleteAll().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::DeleteRange size_t  start,
size_t  end
[inline]
 

Delete a given range (inclusive).

This routine will clamp start and end to the size of the array.

Definition at line 916 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::Empty  )  [inline]
 

Remove all elements.

Similar to DeleteAll(), but does not release memory used by the array itself, thus making it more efficient for cases when the number of contained elements will fluctuate.

Definition at line 835 of file array.h.

Referenced by csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::DeleteAll(), and csFIFO< csRef< iJob > >::PopTop().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::Find T const &  which  )  const [inline]
 

Find a element in array and return its index (or csArrayItemNotFound if not found).

Definition at line 765 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
template<class K>
size_t csArray< T, ElementHandler, MemoryAllocator >::FindKey csArrayCmp< T, K >  comparekey  )  const [inline]
 

Find an element based on some key.

Definition at line 606 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
template<class K>
size_t csArray< T, ElementHandler, MemoryAllocator >::FindSortedKey csArrayCmp< T, K >  comparekey,
size_t *  candidate = 0
const [inline]
 

Find an element based on some key, using a comparison function.

The array must be sorted. Returns csArrayItemNotFound if element does not exist.

Definition at line 705 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T const& csArray< T, ElementHandler, MemoryAllocator >::Get size_t  n  )  const [inline]
 

Get an element (const).

Definition at line 564 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T& csArray< T, ElementHandler, MemoryAllocator >::Get size_t  n  )  [inline]
 

Get an element (non-const).

Definition at line 557 of file array.h.

Referenced by csAnimationTemplate::GetFrame(), and csArray< T, ElementHandler, MemoryAllocator >::Iterator::Next().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T& csArray< T, ElementHandler, MemoryAllocator >::GetExtend size_t  n  )  [inline]
 

Get an item from the array.

If the number of elements in this array is too small the array will be automatically extended.

Definition at line 574 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::GetIndex const T *  which  )  const [inline]
 

Given a pointer to an element in the array this function will return the index.

Note that this function doesn't check if the returned index is actually valid. The caller of this function is responsible for testing if the returned index is within the bounds of the array.

Definition at line 779 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
Iterator csArray< T, ElementHandler, MemoryAllocator >::GetIterator  )  const [inline]
 

Returns an Iterator which traverses the Array.

Definition at line 994 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::InitRegion size_t  start,
size_t  count
[inline, protected]
 

Initialize a region.

This is a dangerous function to use because it does not properly destruct the items in the array.

Definition at line 353 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
bool csArray< T, ElementHandler, MemoryAllocator >::Insert size_t  n,
T const &  item
[inline]
 

Insert element 'item' before element 'n'.

Definition at line 673 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::InsertSorted const T &  item,
int(*)(T const &, T const &)  compare = DefaultCompare,
size_t *  equal_index = 0
[inline]
 

Insert an element at a sorted position, using an element comparison function.

Assumes array is already sorted.

Definition at line 731 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::Length  )  const [inline]
 

Return the number of elements in the Array.

Definition at line 484 of file array.h.

Referenced by csPluginPaths::AddOnce(), csBlockAllocator< csBSPTree >::Alloc(), csTreeNode::BSF(), csPoly3D::Classify(), csBlockAllocator< csBSPTree >::Compact(), csPoly3D::ComputeNormal(), csPoly3D::ComputePlane(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::Delete(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::DeleteAll(), csBlockAllocator< csBSPTree >::Dump(), csObjectModel::FireListeners(), csPrintfFormatter< Twriter, Treader >::Format(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::Get(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::GetAll(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::GetElementPointer(), csPoly3D::GetFirst(), csAnimationTemplate::GetFrameCount(), csPoly3D::GetLast(), csTriangleMesh::GetTriangleCount(), csFrameDataHolder< csRenderMeshPtr >::GetUnusedData(), csPoly3D::GetVertex(), csPoly3D::GetVertexCount(), csHash< T, K, KeyHandler >::GlobalIterator::HasNext(), csArray< T, ElementHandler, MemoryAllocator >::Iterator::HasNext(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::In(), csFIFO< csRef< iJob > >::Length(), csFIFO< csRef< iJob > >::PopTop(), csTree< T >::PopulateWith(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::Put(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::PutUnique(), and csBlockAllocator< csBSPTree >::~csBlockAllocator().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
csArray<T,ElementHandler>& csArray< T, ElementHandler, MemoryAllocator >::operator= const csArray< T, ElementHandler, MemoryAllocator > &  other  )  [inline]
 

Assignment operator.

Definition at line 477 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T const& csArray< T, ElementHandler, MemoryAllocator >::operator[] size_t  n  )  const [inline]
 

Get a const reference.

Definition at line 588 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T& csArray< T, ElementHandler, MemoryAllocator >::operator[] size_t  n  )  [inline]
 

Get an element (non-const).

Definition at line 582 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T csArray< T, ElementHandler, MemoryAllocator >::Pop  )  [inline]
 

Pop an element from tail end of array.

Reimplemented in csPDelArray< T >, csRefArray< T >, csStringArray, csPDelArray< cspPageData >, csPDelArray< csPlugin >, csPDelArray< csMousePointer >, csPDelArray< ArchiveEntry >, csPDelArray< csSkinSliceNonAbstr >, csPDelArray< csWSTexture >, csPDelArray< renderMeshListInfo >, csPDelArray< csPixmap >, csPDelArray< csLayoutConstraint >, csPDelArray< csPluginLoadRec >, csPDelArray< csRect >, csPDelArray< csGridRowEntry >, csPDelArray< csAccElement >, csPDelArray< csCommandLineOption >, csPDelArray< csPluginOption >, csRefArray< iImage >, csRefArray< csShaderVariable >, csRefArray< iParticle >, csRefArray< csEventCord >, csRefArray< iSprite2DState >, csRefArray< iObjectModelListener >, csRefArray< iConfigFile >, and csRefArray< iObject >.

Definition at line 649 of file array.h.

Referenced by csFIFO< csRef< iJob > >::PopTop().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::Push T const &  what  )  [inline]
 

Push an element onto the tail end of the array. Returns index of element.

Definition at line 615 of file array.h.

Referenced by csAnimationTemplate::AddFrame(), csObjectModel::AddListener(), csPluginPaths::AddOnce(), csTreeNode::BSF(), csBlockAllocator< csBSPTree >::csBlockAllocator(), csTreeNode::csTreeNode(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::GetAll(), csFIFO< csRef< iJob > >::PopTop(), csFIFO< csRef< iJob > >::Push(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::Put(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::PutUnique(), and csArray< csShaderVariable *, csRefArrayElementHandler< csShaderVariable * > >::Section().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csArray< T, ElementHandler, MemoryAllocator >::PushSmart T const &  what  )  [inline]
 

Push a element onto the tail end of the array if not already present.

Returns index of newly pushed element or index of already present element.

Definition at line 642 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::Put size_t  n,
T const &  what
[inline]
 

Put an element at some position.

Definition at line 594 of file array.h.

Referenced by csPrintfFormatter< Twriter, Treader >::Format().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
csArray<T> csArray< T, ElementHandler, MemoryAllocator >::Section size_t  low,
size_t  high
const [inline]
 

Get the portion of the array between low and high inclusive.

Definition at line 691 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::SetCapacity size_t  n  )  [inline]
 

Set vector capacity to approximately 'n' elements.

Never sets the capacity to fewer than the current number of elements in the array. See Truncate() or SetLength() if you need to adjust the number of actual array elements.

Definition at line 846 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::SetLength size_t  n  )  [inline]
 

Set array length to n.

Reimplemented in csPDelArray< T >, csPDelArray< cspPageData >, csPDelArray< csPlugin >, csPDelArray< csMousePointer >, csPDelArray< ArchiveEntry >, csPDelArray< csSkinSliceNonAbstr >, csPDelArray< csWSTexture >, csPDelArray< renderMeshListInfo >, csPDelArray< csPixmap >, csPDelArray< csLayoutConstraint >, csPDelArray< csPluginLoadRec >, csPDelArray< csRect >, csPDelArray< csGridRowEntry >, csPDelArray< csAccElement >, csPDelArray< csCommandLineOption >, and csPDelArray< csPluginOption >.

Definition at line 542 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::SetLength size_t  n,
T const &  what
[inline]
 

Set the actual number of items in this array.

This can be used to shrink an array (works like Truncate() then in which case it will properly destroy all truncated objects) or to enlarge an array in which case it will properly set the new capacity and construct all new items based on the given item.

Reimplemented in csPDelArray< T >, csPDelArray< cspPageData >, csPDelArray< csPlugin >, csPDelArray< csMousePointer >, csPDelArray< ArchiveEntry >, csPDelArray< csSkinSliceNonAbstr >, csPDelArray< csWSTexture >, csPDelArray< renderMeshListInfo >, csPDelArray< csPixmap >, csPDelArray< csLayoutConstraint >, csPDelArray< csPluginLoadRec >, csPDelArray< csRect >, csPDelArray< csGridRowEntry >, csPDelArray< csAccElement >, csPDelArray< csCommandLineOption >, and csPDelArray< csPluginOption >.

Definition at line 526 of file array.h.

Referenced by csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::csHash(), csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::DeleteAll(), csFrameDataHolder< csRenderMeshPtr >::GetUnusedData(), and csPoly3D::SetVertexCount().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::ShrinkBestFit  )  [inline]
 

Make the array just as big as it needs to be.

This is useful in cases where you know the array isn't going to be modified anymore in order to preserve memory.

Definition at line 857 of file array.h.

Referenced by csFrameDataHolder< csRenderMeshPtr >::GetUnusedData().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::Sort int(*)(T const &, T const &)  compare = DefaultCompare  )  [inline]
 

Sort array.

Definition at line 789 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T& csArray< T, ElementHandler, MemoryAllocator >::Top  )  [inline]
 

Return the top element but do not remove it.

Definition at line 666 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T const& csArray< T, ElementHandler, MemoryAllocator >::Top  )  const [inline]
 

Return the top element but do not remove it.

Definition at line 659 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::TransferTo csArray< T, ElementHandler, MemoryAllocator > &  destination  )  [inline]
 

Transfer the entire contents of one array to the other.

The end result will be that this array will be completely empty and the other array will have all items that originally were in this array. This operation is very efficient.

Definition at line 501 of file array.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csArray< T, ElementHandler, MemoryAllocator >::Truncate size_t  n  )  [inline]
 

Truncate array to specified number of elements.

The new number of elements cannot exceed the current number of elements. Use SetLength() for a more general way to enlarge the array.

Definition at line 819 of file array.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1