"L. Spiro Engine"
|
A vector class that works on all types that follow the rule of 3. More...
#include <LSTLVector.h>
Public Member Functions | |
LSE_CALL | CVector (LSUINT32 _tTotal) |
LSE_CALL | CVector (CAllocator *_paAllocator) |
LSE_CALL | CVector (LSUINT32 _tTotal, CAllocator *_paAllocator) |
LSE_CALL | CVector (const CVector< _tType, _tDataType, _uAllocSize > &_vOther, CAllocator *_paAllocator=NULL) |
LSBOOL LSE_CALL | Allocate (LSUINT32 _ui32Total) |
LSVOID LSE_CALL | Reset () |
LSBOOL LSE_CALL | Insert (const _tType &_tVal, LSUINT32 _ui32Index) |
LSVOID LSE_CALL | RemoveRangeNoDealloc (LSUINT32 _ui32Index, LSUINT32 _ui32Total) |
LSVOID LSE_CALL | SetAllocator (CAllocator *_paAllocator) |
CAllocator *LSE_CALL | GetAllocator () |
LSVOID LSE_CALL | Trash () |
Protected Attributes | |
CAllocator * | m_paOurAllocator |
A vector class that works on all types that follow the rule of 3.
Class CVector Description: Extends the CSVectorCrtp class to mke it work properly with types that are not plain data. Use this for types that have a complicated destructor, copy constructor, and copy assignment operator.
LSBOOL LSE_CALL lstl::CVector< _tType, _tDataType, _uAllocSize >::Allocate | ( | LSUINT32 | _ui32Total | ) | [inline] |
Allocate a given number of elements. If the allocation is less than what there already is, items are removed.
_ui32Total | Number of elements to allocate. |
Reimplemented from lstl::CSVectorCrtp< CVector< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize >.
LSBOOL LSE_CALL lstl::CVector< _tType, _tDataType, _uAllocSize >::Insert | ( | const _tType & | _tVal, |
LSUINT32 | _ui32Index | ||
) | [inline] |
Insert an element.
_tVal | The item to insert. |
_ui32Index | The index where the item is to be inserted. |
Reimplemented from lstl::CSVectorCrtp< CVector< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize >.
LSVOID LSE_CALL lstl::CVector< _tType, _tDataType, _uAllocSize >::RemoveRangeNoDealloc | ( | LSUINT32 | _ui32Index, |
LSUINT32 | _ui32Total | ||
) | [inline] |
Remove elements without reallocating.
_ui32Index | The start index of the items to be removed. |
_ui32Total | The number of items to remove. |
Reimplemented from lstl::CSVectorCrtp< CVector< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize >.
LSVOID LSE_CALL lstl::CVector< _tType, _tDataType, _uAllocSize >::Reset | ( | ) | [inline] |
Reset the list completely.
Reimplemented from lstl::CSVectorCrtp< CVector< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize >.
LSVOID LSE_CALL lstl::CVector< _tType, _tDataType, _uAllocSize >::Trash | ( | ) | [inline] |
Trash the list without freeing the memory. Calls .Trash() on objects and resets without freeing any memory. The memory is assumed to be free by another part of the application. For example, if the memory was allocated to a heap and the heap is to be freed at all once. After calling Trash(), the whole heap could be removed in full without creating a memory leak. After calling .Trash() on each object, the object's destructor is called. This can only be called if the objects in the list have a .Trash() method.
Reimplemented from lstl::CSVectorCrtp< CVector< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize >.