Vector< T > Class Template Reference#include <tVector.h>
Inheritance diagram for Vector< T >:
[legend]List of all members.
Detailed Description
template<class T> class Vector< T >
A dynamic array template class.
The vector grows as you insert or append elements. Insertion is fastest at the end of the array. Resizing of the array can be avoided by pre-allocating space using the reserve() method.
|
STL interface |
typedef T | value_type |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | iterator |
typedef const T * | const_iterator |
typedef S32 | difference_type |
typedef U32 | size_type |
typedef difference_type(QSORT_CALLBACK *) | compare_func (T *a, T *b) |
Vector< T > & | operator= (const Vector< T > &p) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
S32 | size () const |
bool | empty () const |
void | insert (iterator, const T &) |
void | erase (iterator) |
T & | front () |
const T & | front () const |
T & | back () |
const T & | back () const |
void | push_front (const T &) |
void | push_back (const T &) |
U32 | push_front_unique (const T &) |
U32 | push_back_unique (const T &) |
S32 | find_next (const T &, U32 start=0) |
void | pop_front () |
void | pop_back () |
T & | operator[] (U32) |
const T & | operator[] (U32) const |
T & | operator[] (S32 i) |
const T & | operator[] (S32 i) const |
void | reserve (U32) |
U32 | capacity () const |
Extended interface |
U32 | memSize () const |
T * | address () const |
U32 | setSize (U32) |
void | increment () |
void | decrement () |
void | increment (U32) |
void | decrement (U32) |
void | insert (U32) |
void | erase (U32) |
void | erase_fast (U32) |
void | erase_fast (iterator) |
void | clear () |
void | compact () |
void | sort (compare_func f) |
T & | first () |
T & | last () |
const T & | first () const |
const T & | last () const |
void | set (void *addr, U32 sz) |
void | merge (const Vector &p) |
Public Member Functions |
| Vector (const U32 initialSize=0) |
| Vector (const U32 initialSize, const char *fileName, const U32 lineNum) |
| Vector (const char *fileName, const U32 lineNum) |
| Vector (const Vector &) |
| ~Vector () |
Protected Member Functions |
bool | resize (U32) |
void | destroy (U32 start, U32 end) |
| Destructs elements from start to end-1.
|
void | construct (U32 start, U32 end) |
| Constructs elements from start to end-1.
|
void | construct (U32 start, U32 end, const T *array) |
Protected Attributes |
U32 | mElementCount |
| Number of elements currently in the Vector.
|
U32 | mArraySize |
| Number of elements allocated for the Vector.
|
T * | mArray |
| Pointer to the Vector elements.
|
Member Typedef Documentation
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Constructor & Destructor Documentation
template<class T>
Vector< T >::Vector |
( |
const U32 |
initialSize, |
|
|
const char * |
fileName, |
|
|
const U32 |
lineNum | |
|
) |
| | [inline] |
Member Function Documentation
Destructs elements from start to end-1.
Constructs elements from start to end-1.
template<class T>
void Vector< T >::construct |
( |
U32 |
start, |
|
|
U32 |
end, |
|
|
const T * |
array | |
|
) |
| | [inline, protected] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
T & Vector< T >::front |
( |
|
) |
[inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
const T & Vector< T >::front |
( |
|
) |
const [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
T & Vector< T >::back |
( |
|
) |
[inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
const T & Vector< T >::back |
( |
|
) |
const [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
void Vector< T >::push_front |
( |
const T & |
|
) |
[inline] |
template<class T>
void Vector< T >::push_back |
( |
const T & |
|
) |
[inline] |
template<class T>
U32 Vector< T >::push_front_unique |
( |
const T & |
|
) |
[inline] |
template<class T>
U32 Vector< T >::push_back_unique |
( |
const T & |
|
) |
[inline] |
template<class T>
S32 Vector< T >::find_next |
( |
const T & |
, |
|
|
U32 |
start = 0 | |
|
) |
| | [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
const T & Vector< T >::operator[] |
( |
U32 |
|
) |
const [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
T& Vector< T >::operator[] |
( |
S32 |
i |
) |
[inline] |
template<class T>
const T& Vector< T >::operator[] |
( |
S32 |
i |
) |
const [inline] |
template<class T>
T * Vector< T >::address |
( |
|
) |
const [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
T & Vector< T >::first |
( |
|
) |
[inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
T & Vector< T >::last |
( |
|
) |
[inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
const T & Vector< T >::first |
( |
|
) |
const [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
template<class T>
const T & Vector< T >::last |
( |
|
) |
const [inline] |
Reimplemented in VectorPtr< T >, VectorPtr< TerrainBlock * >, VectorPtr< SimComponent * >, VectorPtr< StreamObject * >, VectorPtr< GuiListBoxCtrl::LBItem * >, VectorPtr< IClipMapImageSource * >, VectorPtr< SceneObject * >, VectorPtr< XBGamerProfile * >, VectorPtr< Heightfield * >, VectorPtr< Dispatcher::IMessageListener * >, VectorPtr< SimObject * >, VectorPtr< InteriorSimpleMesh * >, VectorPtr< GuiFrameSetCtrl::FrameDetail * >, VectorPtr< Zip::ZipTempStream * >, VectorPtr< Zip::ZipArchive::ZipEntry * >, VectorPtr< TerrClipMapImageSource * >, and VectorPtr< GBitmap * >.
Member Data Documentation
Number of elements currently in the Vector.
Number of elements allocated for the Vector.
Pointer to the Vector elements.
|