"L. Spiro Engine"
|
Classes | |
struct | LSTL_PAIR |
Public Types | |
typedef struct lstl::CMap::LSTL_PAIR * | LPLSTL_PAIR |
typedef struct lstl::CMap::LSTL_PAIR | LPCLSTL_PAIR |
Public Member Functions | |
LSE_CALL | CMap (const CMap< _tKeyType, _tMappedType > &_mSrc) |
LSE_CALL | CMap (CAllocator *_paAllocator) |
_tMappedType &LSE_CALL | operator[] (const _tKeyType &_tKey) |
const _tMappedType &LSE_CALL | operator[] (const _tKeyType &_tKey) const |
CMap< _tKeyType, _tMappedType > &LSE_CALL | operator= (const CMap< _tKeyType, _tMappedType > &_mSrc) |
LSBOOL LSE_CALL | Allocate (LSUINT32 _ui32Total) |
LSBOOL LSE_CALL | Insert (const LSTL_PAIR *_ppPairs, LSUINT32 _ui32Total) |
LSBOOL LSE_CALL | Insert (const LSTL_PAIR &_pPair, _tMappedType **_pptReturnValue=NULL) |
LSBOOL LSE_CALL | Insert (const _tKeyType &_tKey, const _tMappedType &_tValue, _tMappedType **_pptReturnValue=NULL) |
LSVOID LSE_CALL | RemoveNoDealloc (const _tKeyType *_ptKeys, LSUINT32 _ui32Total) |
LSVOID LSE_CALL | RemoveNoDealloc (const _tKeyType &_tKey) |
LSVOID LSE_CALL | Remove (const _tKeyType *_ptKeys, LSUINT32 _ui32Total) |
LSVOID LSE_CALL | Remove (const _tKeyType &_tKey) |
LSVOID LSE_CALL | RemoveByIndex (LSUINT32 _ui32Index) |
LSVOID LSE_CALL | RemoveByIndexNoDealloc (LSUINT32 _ui32Index) |
LSVOID LSE_CALL | ResetNoDealloc () |
LSVOID LSE_CALL | Reset () |
LSUINT32 LSE_CALL | Length () const |
_tMappedType &LSE_CALL | GetByIndex (LSUINT32 _ui32Index) |
const _tMappedType &LSE_CALL | GetByIndex (LSUINT32 _ui32Index) const |
_tKeyType &LSE_CALL | GetKeyByIndex (LSUINT32 _ui32Index) |
const _tKeyType &LSE_CALL | GetKeyByIndex (LSUINT32 _ui32Index) const |
LSBOOL LSE_CALL | GetItemIndex (const _tKeyType &_tKey, LSUINT32 &_ui32Index) const |
LSBOOL LSE_CALL | ItemExists (const _tKeyType &_tKey) const |
LSBOOL LSE_CALL | ItemExists (const _tKeyType &_tKey, LSUINT32 &_ui32Index) const |
LSVOID LSE_CALL | SetAllocator (CAllocator *_paAllocator) |
CAllocator *LSE_CALL | GetAllocator () |
Protected Attributes | |
CVector< LSTL_PAIR, LSUINT32, 1024UL > | m_vPairs |
typedef struct lstl::CMap::LSTL_PAIR * lstl::CMap::LPLSTL_PAIR |
Our internal representation of the mapped values. These are sorted by key.
LSBOOL LSE_CALL lstl::CMap::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. |
CAllocator* LSE_CALL lstl::CMap::GetAllocator | ( | ) | [inline] |
Get our allocator.
_tMappedType& LSE_CALL lstl::CMap::GetByIndex | ( | LSUINT32 | _ui32Index | ) | [inline] |
Get a mapped value by index. Values are always sorted by their respective keys.
_ui32Index | The index of the mapped value to get, which must be valid. |
const _tMappedType& LSE_CALL lstl::CMap::GetByIndex | ( | LSUINT32 | _ui32Index | ) | const [inline] |
Get a mapped value by index. Values are always sorted by their respective keys.
_ui32Index | The index of the mapped value to get, which must be valid. |
LSBOOL LSE_CALL lstl::CMap::GetItemIndex | ( | const _tKeyType & | _tKey, |
LSUINT32 & | _ui32Index | ||
) | const [inline] |
Get the index of an existing item. If the item does not exist, the index indicates where it should be if it did exist.
_tKey | Key of the item to find. |
_ui32Index | The returned index of the found item or the index where the item should be inserted. |
_tKeyType& LSE_CALL lstl::CMap::GetKeyByIndex | ( | LSUINT32 | _ui32Index | ) | [inline] |
Get a key value by index.
_ui32Index | The index of the key value to get, which must be valid. |
const _tKeyType& LSE_CALL lstl::CMap::GetKeyByIndex | ( | LSUINT32 | _ui32Index | ) | const [inline] |
Get a key value by index.
_ui32Index | The index of the key value to get, which must be valid. |
LSBOOL LSE_CALL lstl::CMap::Insert | ( | const LSTL_PAIR * | _ppPairs, |
LSUINT32 | _ui32Total | ||
) | [inline] |
Insert an array of pairs of keys and mapped values. Any keys that exist will not be modified.
_ppPairs | The pairs to insert. |
_ui32Total | The total number of pairs to insert. |
LSBOOL LSE_CALL lstl::CMap::Insert | ( | const LSTL_PAIR & | _pPair, |
_tMappedType ** | _pptReturnValue = NULL |
||
) | [inline] |
Insert a single pair of a key and its mapped value. If the key exists, it is not modified.
_pPair | The pair to insert. |
_pptReturnValue | The returned mapped value. |
LSBOOL LSE_CALL lstl::CMap::Insert | ( | const _tKeyType & | _tKey, |
const _tMappedType & | _tValue, | ||
_tMappedType ** | _pptReturnValue = NULL |
||
) | [inline] |
Insert a single pair of a key and its mapped value. If the key exists, it is not modified.
_tKey | The pair's key. |
_tValue | The pair's mapped value. |
_pptReturnValue | The returned mapped value. |
LSBOOL LSE_CALL lstl::CMap::ItemExists | ( | const _tKeyType & | _tKey, |
LSUINT32 & | _ui32Index | ||
) | const [inline] |
Determines whether the given key already exists in the map or not and, if so, returns the index of the item.
_tKey | The key to test for existance in the map. |
_ui32Index | The index of the item in the map, if it exists. |
LSBOOL LSE_CALL lstl::CMap::ItemExists | ( | const _tKeyType & | _tKey | ) | const [inline] |
Determines whether the given key already exists in the map or not.
_tKey | The key to test for existance in the map. |
LSUINT32 LSE_CALL lstl::CMap::Length | ( | ) | const [inline] |
Get the total number of items.
CMap<_tKeyType, _tMappedType>& LSE_CALL lstl::CMap::operator= | ( | const CMap< _tKeyType, _tMappedType > & | _mSrc | ) | [inline] |
Copy another map into this one. Each element in the source map is copied. The allocator is not copied, meaning the new CMap does not use the same allocator as the original.
_mSrc | The map of which to make a copy. |
const _tMappedType& LSE_CALL lstl::CMap::operator[] | ( | const _tKeyType & | _tKey | ) | const [inline] |
Access a mapped value by its key. If the given key does not exist, it is added and its default mapped value is returned. Throws an exception if a memory failure prevents the adding of a key.
_tKey | The key of the value to find. |
_tMappedType& LSE_CALL lstl::CMap::operator[] | ( | const _tKeyType & | _tKey | ) | [inline] |
Access a mapped value by its key. If the given key does not exist, it is added and its default mapped value is returned. Throws an exception if a memory failure prevents the adding of a key.
_tKey | The key of the value to find. |
LSVOID LSE_CALL lstl::CMap::Remove | ( | const _tKeyType & | _tKey | ) | [inline] |
Remove a pair.
_tKey | The key of the pair to remove. |
LSVOID LSE_CALL lstl::CMap::Remove | ( | const _tKeyType * | _ptKeys, |
LSUINT32 | _ui32Total | ||
) | [inline] |
Remove an array of items.
_ptKeys | The keys of the items to remove. |
_ui32Total | The total number of pairs to remove. |
LSVOID LSE_CALL lstl::CMap::RemoveByIndex | ( | LSUINT32 | _ui32Index | ) | [inline] |
Remove by index.
_ui32Index | Index of the pair to remove. |
LSVOID LSE_CALL lstl::CMap::RemoveByIndexNoDealloc | ( | LSUINT32 | _ui32Index | ) | [inline] |
Remove by index without deallocating.
_ui32Index | Index of the pair to remove. |
LSVOID LSE_CALL lstl::CMap::RemoveNoDealloc | ( | const _tKeyType * | _ptKeys, |
LSUINT32 | _ui32Total | ||
) | [inline] |
Remove an array of items without reallocating.
_ptKeys | The keys of the items to remove. |
_ui32Total | The total number of pairs to remove. |
LSVOID LSE_CALL lstl::CMap::RemoveNoDealloc | ( | const _tKeyType & | _tKey | ) | [inline] |
Remove a pair without reallocating.
_tKey | The key of the pair to remove. |
LSVOID LSE_CALL lstl::CMap::Reset | ( | ) | [inline] |
Reset all contents.
LSVOID LSE_CALL lstl::CMap::ResetNoDealloc | ( | ) | [inline] |
Reset without reallocating.
LSVOID LSE_CALL lstl::CMap::SetAllocator | ( | CAllocator * | _paAllocator | ) | [inline] |
Set the allocator. Causes the object to be fully reset. Should not be used on lists that have contents already.
_paAllocator | The new allocator to be used by this object or NULL to use the default allocator for map objects. |
Our internal array of paired items.