Classes | |
class | const_iterator |
class | const_reverse_iterator |
class | CPair |
class | iterator |
class | reverse_iterator |
class | value_type |
Public Types | |
typedef KTraits::INARGTYPE | KINARGTYPE |
typedef KTraits::OUTARGTYPE | KOUTARGTYPE |
typedef VTraits::INARGTYPE | VINARGTYPE |
typedef VTraits::OUTARGTYPE | VOUTARGTYPE |
typedef CFastMap< K, V > ::const_iterator | ConstIterType |
Public Member Functions | |
CFastMap (uint32_t nBins=17, float fOptimalLoad=0.75f, float fLoThreshold=0.25f, float fHiThreshold=2.25f) | |
intptr_t | GetCount () const throw () |
intptr_t | size () const |
bool | IsEmpty () const throw () |
bool | Lookup (KINARGTYPE key, VOUTARGTYPE value) const |
const CPair * | Lookup (KINARGTYPE key) const throw () |
CPair * | Lookup (KINARGTYPE key) throw () |
V & | operator[] (KINARGTYPE key) throw () |
CNode * | SetAt (KINARGTYPE key, VINARGTYPE value) |
void | SetValueAt (Proud::Position pos, VINARGTYPE value) |
bool | RemoveKey (KINARGTYPE key, bool rehashOnNeed=false) throw () |
| |
void | Clear () |
bool | Remove (KINARGTYPE key, bool rehashOnNeed=false) |
void | RemoveAll () |
| |
void | RemoveAtPos (Proud::Position pos, bool rehashOnNeed=false) throw () |
Proud::Position | GetStartPosition () const throw () |
Proud::Position | GetEndPosition () const throw () |
void | GetNextAssoc (Proud::Position &pos, KOUTARGTYPE key, VOUTARGTYPE value) const |
const CPair * | GetNext (Proud::Position &pos) const throw () |
CPair * | GetNext (Proud::Position &pos) throw () |
CPair * | GetPrev (Proud::Position &pos) throw () |
const K & | GetNextKey (Proud::Position &pos) const |
const V & | GetNextValue (Proud::Position &pos) const |
V & | GetNextValue (Proud::Position &pos) |
void | GetAt (Proud::Position pos, KOUTARGTYPE key, VOUTARGTYPE value) const |
CPair * | GetPairByIndex (int index) throw () |
const CPair * | GetPairByIndex (int index) const throw () |
CPair * | GetAt (Proud::Position pos) throw () |
const CPair * | GetAt (Proud::Position pos) const throw () |
const K & | GetKeyAt (Proud::Position pos) const |
const V & | GetValueAt (Proud::Position pos) const |
V & | GetValueAt (Proud::Position pos) |
uint32_t | GetHashTableSize () const throw () |
bool | InitHashTable (uint32_t nBins, bool bAllocNow=true) |
void | EnableAutoRehash () throw () |
void | DisableAutoRehash () throw () |
void | Rehash (uint32_t nBins=0) |
void | SetOptimalLoad (float fOptimalLoad, float fLoThreshold, float fHiThreshold, bool bRehashNow=false) |
void | SetOptimalLoad_BestLookup (bool rehashNow=false) |
intptr_t | GetWorstBinItemCount () |
void | EnableSlowConsistCheck () |
void | KeysToArray (CFastArray< K > &output) const |
void | KeysToArray (K *outputArray, intptr_t arraySize) const |
void | ValuesToArray (CFastArray< V > &output) const |
void | AssertConsist () const |
CFastMap (const CFastMap &a) | |
CFastMap & | operator= (const CFastMap &a) |
bool | Equals (const CFastMap &a) const |
void | CopyKeysTo (CFastArray< K > &dest) |
bool | ContainsKey (const K &key) const |
bool | ContainsValue (const V &val) |
bool | TryGetValue (KINARGTYPE key, VOUTARGTYPE value) const |
template<typename RAWPTR > | |
bool | TryGetRawPtrValue (KINARGTYPE key, RAWPTR &rawPtrOfValue) const |
bool | Add (KINARGTYPE key, VINARGTYPE value) |
iterator | begin () |
iterator | end () |
value_type | front () |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
const_iterator | begin () const |
const_iterator | end () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
reverse_iterator | erase (reverse_iterator iter) |
iterator | erase (iterator iter) |
iterator | find (const K &key) |
const_iterator | find (const K &key) const |
void | UseFastHeap (CFastHeap *heap) |
CFastHeap * | GetRefFastHeap () |
Friends | |
class | const_iterator |
class | iterator |
class | reverse_iterator |
class | const_reverse_iterator |
An hash algorithm base map class of (Key,Value) pair. Please refer Map class for further detail.
K | key type of collection |
V | value tpe of collection |
KTraits | class that defines the characteristics that handle key type of collection |
VTraits | class that defines the characteristics that handle value type of collection |
example code of traits class
|
inline |
This is constructor
nBins | The size of base hash table. Performs ok when set with prime number. Please refer Map class for further detail. |
fOptimalLoad | Optimized load proportion. Please refer Load of map class for further detail. |
fLoThreshold | Minimum load proportion. Please refer Load of map class for further detail. |
fHiThreshold | Maximum load proportion. Please refer Load of map class for further detail. |
|
inline |
CFastMap is an object can be copied.
|
inline |
Adds a new clause
key | key of the clause to be added |
value | value of the clause to be added |
|
inline |
Must check if there exitst any cracked internal status
|
inline |
Performs a role as same name method of STL
|
inline |
Performs a role as same name method of STL
|
inline |
Completely empty it
|
inline |
Checks if there is key
|
inline |
Checks if there is value
|
inline |
Collects and gives key
|
inline |
Do not rehash automatically
|
inline |
Rehash automatically
|
inline |
Performs a role as same name method of STL
|
inline |
Performs a role as same name method of STL
|
inline |
CFastMap is non-array container so it shows slower comparison operation than std.map
|
inline |
Performs a role as same name method of STL
|
inline |
Performs a role as same name method of STL
|
inline |
Performs a role as same name method of STL
|
inline |
Performs a role as same name method of STL
|
inline |
Obtain the key and value of the place where the position is pointing at.
pos | Position pointing the node |
key | Obtain the key of the node |
value | Obtain the data of the node |
|
inline |
Obtain the key and value of the place where the position is pointing at
pos | Position information |
|
inline |
Obtain the key and value of the place where the position is pointing at
pos | Position information |
|
inline |
Gets the very last thing among possessed clauses. Mainly used for reverse_iteration. It is possible to perform iteration to next clause by using GetPrev or others.
|
inline |
Get the size of the hash table
|
inline |
Obtain the key and value of the place where the position is pointing at
pos | Position pointing at the node |
|
inline |
Obtain the following:
pos | Obtain the next position of the node being pointed at. |
|
inline |
Obtain the next item.
pos | Obtain the next position of the node being pointed at. |
|
inline |
Obtain the following
[in,out] | Position | value of the next item. |
[out] | Key | of the next item. |
[out] | Value | of the next item. |
|
inline |
Obtain the next item
pos | Obtain the next position of the node being pointed at by this pos. |
|
inline |
Obtain the next item
pos | Obtain the next position of the node being pointed at by this pos. |
|
inline |
Obtain the next item
pos | Obtain the next position of the node being pointed at by this pos. |
|
inline |
Obtain the key and value of the place located in the index
index | Move to the next node as much as this index from the first information. |
|
inline |
Obtain the key and value of the place located in the index
index | Move to the next node as much as this index from the first information. |
|
inline |
Obtain the previous item.
pos | Obtain the next position of the node being pointed at by this pos. |
|
inline |
Gets the foremost thing among possessed clauses. Mainly used for iteration. It is possible to perform iteration to next clause by using GetNext or others.
|
inline |
Obtain the key and value of the place where the position is pointing at
Position | pointing at the node |
|
inline |
Obtain the key and value of the place where the position is pointing at
pos | Position pointing at the node |
|
inline |
Search each bin and return the worst bin, in other words, the number of items of the bin with the most items.
|
inline |
Initialize the hash table.
nBins | Hash size |
bAllocNow | Configure whether to generate hash memory |
|
inline |
Is it empty?
|
inline |
Provide array that contain key of map objects
|
inline |
Provide array that contain key of map objects
|
inline |
Gets value correspnds to key
[in] | key | key to find |
[out] | value | a space where the value corresponds to the key found to be stored |
|
inline |
Finds value corrsponds to key but returns CPair object
|
inline |
Finds value corrsponds to key but returns CPair object.
|
inline |
CFastMap is an object can be copied.
|
inline |
Finds value corrsponds to key. If not existed then internally creates a new entry.
|
inline |
Performs a role as same name method of STL
|
inline |
Generate a hash table again
Size | of the hash table |
|
inline |
Finds the clause pointed by key then removes it.
key | key to be removed |
rehashOnNeed | if ture then hash table is re-modified when hash table became small enough Must pay attention to the fact that if there exists either iterator and/or Position during the process, it/they will be nullified. |
|
inline |
Completely empty it
|
inline |
Removes key-value pair of where pointed by Position
pos | Position value acquired before. This value must be valid! |
rehashOnNeed | if ture then hash table is re-modified when hash table became small enough Must pay attention to the fact that if there exists either iterator and/or Position during the process, it/they will be nullified. |
|
inline |
Finds the clause pointed by key then removes it.
key | key to be removed |
rehashOnNeed | if ture then hash table is re-modified when hash table became small enough Must pay attention to the fact that if there exists either iterator and/or Position during the process, it/they will be nullified. |
|
inline |
Performs a role as same name method of STL
|
inline |
Newly addes key and value pair. If already exist then overwrites.
key | key value to be added |
value | value object to be added |
|
inline |
Re-sets the optimal load to map. Please refer Load of map class for further detail.
fOptimalLoad | Optimal load proportion |
fLoThreshold | Minimum limit of load proportion |
fHiThreshold | Maximum limit of load proportion |
bRehashNow | hash table re-setting proccess runs immediately if true. |
|
inline |
Lookup optimum performance. Configuration to avoid rehash as much as possible but instead use a lot of memory.
Select | whether to rehash when configuring. If true, rehash. |
|
inline |
Insert a new value of the place where the previously obtained position object points at.
pos | Position of the node to insert the value |
value | Data to be inserted into the node |
|
inline |
Gets number of item that already owned
|
inline |
If there exist a smart pointer value corresponds to key, returns true and pass its raw pointer through an out parameter.
|
inline |
Returns true if there exist value corresponds to key
|
inline |
|
inline |
Provide array that contain value of map objects