PixelLightAPI
.
|
Hash map template. More...
#include <HashMap.h>
Public Member Functions | |
HashMap (uint32 nNumOfSlots=199) | |
Constructor. | |
HashMap (const HashMap< KeyType, ValueType, Hasher, Comparer, Grower > &cSource) | |
Copy constructor. | |
virtual | ~HashMap () |
Destructor. | |
Map< KeyType, ValueType > & | operator= (const HashMap< KeyType, ValueType, Hasher, Comparer, Grower > &cSource) |
Copy operator. | |
uint32 | GetNumOfSlots () const |
Returns the current number of slots. | |
void | GetStatistics (uint32 &nNumOfCollisions, uint32 &nNumOfFreeSlotsLists) const |
Returns some statistics. | |
virtual Iterator< ValueType > | GetIterator (uint32 nIndex=0) const override |
Returns an iterator operating on the derived data structure. | |
virtual ConstIterator< ValueType > | GetConstIterator (uint32 nIndex=0) const override |
Returns a constant iterator operating on the derived data structure. | |
virtual Iterator< ValueType > | GetEndIterator () const override |
Returns an iterator operating on the derived data structure and starting at the end. | |
virtual ConstIterator< ValueType > | GetConstEndIterator () const override |
Returns a constant iterator operating on the derived data structure and starting at the end. | |
virtual void | Clear () override |
Clears the map. | |
virtual bool | IsEmpty () const override |
Checks whether the map is complete empty. | |
virtual uint32 | GetNumOfElements () const override |
Returns the number of elements/entries. | |
virtual bool | Add (const KeyType &Key, const ValueType &Value) override |
Adds/puts a new element to the map. | |
virtual bool | Replace (const KeyType &Key, const ValueType &NewValue) override |
Replaces the value of a map element. | |
virtual bool | Set (const KeyType &Key, const ValueType &Value) override |
Sets (adds or replaces) the value of a map element. | |
virtual bool | Remove (const KeyType &Key) override |
Removes an element from the map. | |
virtual uint32 | RemoveValue (const ValueType &Value) override |
Removes all elements with a certain value from the map. | |
virtual const ValueType & | Get (const KeyType &Key) const override |
Returns the value of a given key. | |
virtual ValueType & | Get (const KeyType &Key) override |
Returns the value of a given key. | |
virtual Iterator< KeyType > | GetKeyIterator (uint32 nIndex=0) const override |
Returns a key iterator operating on the derived data structure. | |
virtual ConstIterator< KeyType > | GetConstKeyIterator (uint32 nIndex=0) const override |
Returns a constant key iterator operating on the derived data structure. | |
virtual Iterator< KeyType > | GetEndKeyIterator () const override |
Returns a key iterator operating on the derived data structure and starting at the end. | |
virtual ConstIterator< KeyType > | GetConstEndKeyIterator () const override |
Returns a constant key iterator operating on the derived data structure and starting at the end. |
Hash map template.
PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::HashMap | ( | uint32 | nNumOfSlots = 199 | ) |
[in] | nNumOfSlots | Initial number of slots (must be >= 1, should be a prime number) |
PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::HashMap | ( | const HashMap< KeyType, ValueType, Hasher, Comparer, Grower > & | cSource | ) |
Copy constructor.
[in] | cSource | Source to copy from |
PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::~HashMap | ( | ) | [virtual] |
Destructor.
Map< KeyType, ValueType > & PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::operator= | ( | const HashMap< KeyType, ValueType, Hasher, Comparer, Grower > & | cSource | ) |
uint32 PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetNumOfSlots | ( | ) | const |
Returns the current number of slots.
void PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetStatistics | ( | uint32 & | nNumOfCollisions, |
uint32 & | nNumOfFreeSlotsLists | ||
) | const |
Returns some statistics.
[out] | nNumOfCollisions | Will receive the number of collisions |
[out] | nNumOfFreeSlotsLists | Will receive the number of free slots lists |
Iterator< ValueType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns an iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Iterable< ValueType >.
ConstIterator< ValueType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetConstIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns a constant iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Iterable< ValueType >.
Iterator< ValueType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetEndIterator | ( | ) | const [override, virtual] |
Returns an iterator operating on the derived data structure and starting at the end.
Implements PLCore::Iterable< ValueType >.
ConstIterator< ValueType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetConstEndIterator | ( | ) | const [override, virtual] |
Returns a constant iterator operating on the derived data structure and starting at the end.
Implements PLCore::Iterable< ValueType >.
void PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Clear | ( | ) | [override, virtual] |
Clears the map.
Implements PLCore::Map< KeyType, ValueType >.
bool PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::IsEmpty | ( | ) | const [override, virtual] |
Checks whether the map is complete empty.
Implements PLCore::Map< KeyType, ValueType >.
uint32 PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetNumOfElements | ( | ) | const [override, virtual] |
Returns the number of elements/entries.
Implements PLCore::Map< KeyType, ValueType >.
bool PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Add | ( | const KeyType & | Key, |
const ValueType & | Value | ||
) | [override, virtual] |
Adds/puts a new element to the map.
[in] | Key | The key of the new element |
[in] | Value | The value of the new element |
Implements PLCore::Map< KeyType, ValueType >.
bool PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Replace | ( | const KeyType & | Key, |
const ValueType & | NewValue | ||
) | [override, virtual] |
Replaces the value of a map element.
[in] | Key | The key of the element |
[in] | NewValue | The new value of the element |
Implements PLCore::Map< KeyType, ValueType >.
bool PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Set | ( | const KeyType & | Key, |
const ValueType & | Value | ||
) | [override, virtual] |
Sets (adds or replaces) the value of a map element.
[in] | Key | The key of the element |
[in] | Value | The set value of the element |
Implements PLCore::Map< KeyType, ValueType >.
bool PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Remove | ( | const KeyType & | Key | ) | [override, virtual] |
Removes an element from the map.
[in] | Key | Key of the element which should be removed |
Implements PLCore::Map< KeyType, ValueType >.
uint32 PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::RemoveValue | ( | const ValueType & | Value | ) | [override, virtual] |
Removes all elements with a certain value from the map.
[in] | Value | Value to look for |
Implements PLCore::Map< KeyType, ValueType >.
const ValueType & PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Get | ( | const KeyType & | Key | ) | const [override, virtual] |
Returns the value of a given key.
[in] | Key | Key to use |
Implements PLCore::Map< KeyType, ValueType >.
ValueType & PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::Get | ( | const KeyType & | Key | ) | [override, virtual] |
Returns the value of a given key.
[in] | Key | Key to use |
Implements PLCore::Map< KeyType, ValueType >.
Iterator< KeyType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetKeyIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns a key iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Map< KeyType, ValueType >.
ConstIterator< KeyType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetConstKeyIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns a constant key iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Map< KeyType, ValueType >.
Iterator< KeyType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetEndKeyIterator | ( | ) | const [override, virtual] |
Returns a key iterator operating on the derived data structure and starting at the end.
Implements PLCore::Map< KeyType, ValueType >.
ConstIterator< KeyType > PLCore::HashMap< KeyType, ValueType, Hasher, Comparer, Grower >::GetConstEndKeyIterator | ( | ) | const [override, virtual] |
Returns a constant key iterator operating on the derived data structure and starting at the end.
Implements PLCore::Map< KeyType, ValueType >.
|