"L. Spiro Engine"
Public Member Functions | Protected Attributes

lstl::CVectorPoD< _tType, _tDataType, _uAllocSize > Class Template Reference

Adds the ability to supply a specific allocator to a simple vector. More...

#include <LSTLVectorPoD.h>

Inheritance diagram for lstl::CVectorPoD< _tType, _tDataType, _uAllocSize >:
lstl::CSVectorCrtp< CVectorPoD< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize > lstl::CVectorBase

List of all members.

Public Member Functions

LSE_CALL CVectorPoD (LSUINT32 _tTotal)
LSE_CALL CVectorPoD (CAllocator *_paAllocator)
LSE_CALL CVectorPoD (LSUINT32 _tTotal, CAllocator *_paAllocator)
LSE_CALL CVectorPoD (const CVectorPoD< _tType, _tDataType, _uAllocSize > &_vOther, CAllocator *_paAllocator=NULL)
LSBOOL LSE_CALL Allocate (LSUINT32 _ui32Total)
LSVOID LSE_CALL Reset ()
LSVOID LSE_CALL SetAllocator (CAllocator *_paAllocator)
CAllocator *LSE_CALL GetAllocator ()

Protected Attributes

CAllocatorm_paOurAllocator

Detailed Description

template<typename _tType, typename _tDataType = LSUINT16, unsigned _uAllocSize = 512UL>
class lstl::CVectorPoD< _tType, _tDataType, _uAllocSize >

Adds the ability to supply a specific allocator to a simple vector.

Class CVectorPoD Description: Inherits from a simple vector and adds a member that allows defining an allocator. In order to use the allocator the Allocate() and Reset() functions are replaced. This vector should be used only for plain data types.


Member Function Documentation

template<typename _tType, typename _tDataType = LSUINT16, unsigned _uAllocSize = 512UL>
LSBOOL LSE_CALL lstl::CVectorPoD< _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.

Parameters:
_ui32TotalThe new total number of values to allocate.
Returns:
Returns false if there is not enough memory to allocate the requested amount.

Reimplemented from lstl::CSVectorCrtp< CVectorPoD< _tType, _tDataType, _uAllocSize >, _tType, _tDataType, _uAllocSize >.

template<typename _tType, typename _tDataType = LSUINT16, unsigned _uAllocSize = 512UL>
CAllocator* LSE_CALL lstl::CVectorPoD< _tType, _tDataType, _uAllocSize >::GetAllocator ( ) [inline]

Get our allocator.

Returns:
Returns a pointer to the allocator used by this object.

Reimplemented in lstl::CStringBase< _tDerived, _tDataType, _uAllocSize >, and lstl::CStringBase< CWString, wchar_t >.

template<typename _tType, typename _tDataType = LSUINT16, unsigned _uAllocSize = 512UL>
LSVOID LSE_CALL lstl::CVectorPoD< _tType, _tDataType, _uAllocSize >::Reset ( ) [inline]
template<typename _tType, typename _tDataType = LSUINT16, unsigned _uAllocSize = 512UL>
LSVOID LSE_CALL lstl::CVectorPoD< _tType, _tDataType, _uAllocSize >::SetAllocator ( CAllocator _paAllocator) [inline]

Set the allocator. Causes the object to be fully reset. Should not be used on lists that have contents already.

Parameters:
_paAllocatorThe new allocator to be used by this object or NULL to use the default allocator for vector objects.

Reimplemented in lstl::CStringBase< _tDerived, _tDataType, _uAllocSize >, and lstl::CStringBase< CWString, wchar_t >.


Member Data Documentation

template<typename _tType, typename _tDataType = LSUINT16, unsigned _uAllocSize = 512UL>
CAllocator* lstl::CVectorPoD< _tType, _tDataType, _uAllocSize >::m_paOurAllocator [protected]

The allocator we should use.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator