Definition at line 30 of file fbxhashmap.h.
#include <fbxhashmap.h>
Classes |
|
| class | Iterator |
| class | ListItem |
Public Types |
|
| typedef KEY | KeyType |
| typedef VALUE | ValueType |
| typedef HASH | HashFunctorType |
Public Member Functions |
|
| FbxHashMap (int pBucketSize) | |
| FbxHashMap () | |
| ~FbxHashMap () | |
| void | Clear () |
| const Iterator | Find (const KeyType &pKey) const |
| VALUE | Remove (const KEY &pKey) |
| ValueType & | operator[] (const KeyType &pKey) |
| Iterator | Start () const |
| Iterator | End () const |
Friends |
|
| class | Iterator |
| typedef KEY KeyType |
Definition at line 33 of file fbxhashmap.h.
| typedef VALUE ValueType |
Definition at line 34 of file fbxhashmap.h.
| typedef HASH HashFunctorType |
Definition at line 35 of file fbxhashmap.h.
| FbxHashMap | ( | int | pBucketSize | ) | [inline] |
Definition at line 164 of file fbxhashmap.h.
{
mBuckets.Resize( pBucketSize );
}
| FbxHashMap | ( | ) | [inline] |
Definition at line 169 of file fbxhashmap.h.
{
mBuckets.Resize(30);
}
| ~FbxHashMap | ( | ) | [inline] |
Definition at line 174 of file fbxhashmap.h.
| void Clear | ( | ) | [inline] |
Definition at line 180 of file fbxhashmap.h.
Definition at line 200 of file fbxhashmap.h.
| VALUE Remove | ( | const KEY & | pKey | ) | [inline] |
Definition at line 218 of file fbxhashmap.h.
{
unsigned int lIndex = mHashFunctor(pKey);
lIndex = lIndex % mBuckets.GetCount();
ListItem* lItem = mBuckets.GetAt(lIndex);
ListItem* lLastItem = NULL;
while( lItem )
{
if( lItem->mKey == pKey )
{
if( lLastItem )
lLastItem->mNext = lItem->mNext;
if( mBuckets.GetAt(lIndex) == lItem )
mBuckets.SetAt(lIndex, lItem->mNext );
VALUE lValue = lItem->mValue;
FbxDelete(lItem);
return lValue;
}
lLastItem = lItem;
lItem = lItem->mNext;
}
return VALUE();
}
Definition at line 248 of file fbxhashmap.h.
{
Iterator lIt = Find( pKey );
if( lIt != End() )
{
return lIt.mCurrentItem->mValue;
}
unsigned int lIndex = mHashFunctor(pKey);
lIndex = lIndex % mBuckets.GetCount();
ListItem* lItem = FbxNew< ListItem >();
lItem->mNext = NULL;
lItem->mKey = pKey;
if( !mBuckets.GetAt(lIndex) )
{
mBuckets.SetAt(lIndex, lItem);
}
else
{
lItem->mNext = mBuckets.GetAt(lIndex);
mBuckets.SetAt(lIndex, lItem);
}
return lItem->mValue;
}
| Iterator Start | ( | ) | const [inline] |
Definition at line 275 of file fbxhashmap.h.
| Iterator End | ( | ) | const [inline] |
Definition at line 289 of file fbxhashmap.h.
friend class Iterator
[friend] |
Definition at line 303 of file fbxhashmap.h.