Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

template<typename, typename, typename, typename>
class Geo::GeoHashMap

The hash table.

It's a straight forward key/value hash table where every key has one associated value (so it's a hash map, rather than a hash multi map).

Typedefs

NameDescription
GeoHashConstHandle< GeoHashMap > ConstHandle

A const handle to an entry in the container.

const DataType & DataParamType

The Data type stored internally when passed as a parameter.

GeoPair< KeyType, ValueType > DataType

The Data type stored internally.

GeoHashHandle< GeoHashMap > Handle

A handle to an entry in the container.

tHashFunctor HashFunctor

The specified Hash Functor type.

tKeyCmp KeyCompareFunctor

The specified Key Compare type.

const KeyType & KeyParamType

The Key type when passed as a parameter.

tKey KeyType

The specified Key type.

const ValueType & ValueParamType

The Value type when passed as a parameter.

tValue ValueType

The specified Value type.

Variables

NameDescription
const u32 MemoryAlignment = GEO_ALIGN_OF(DataType) > GEO_ALIGN_OF(u32) ? GEO_ALIGN_OF(DataType) : GEO_ALIGN_OF(u32)

The required alignment of the memory block passed to the appropriate GeoHashMap constructor.

Functions

NameDescription
~GeoHashMap()

Delete.

CalcMemoryUsage(s32)

Gets the amount of memory (in bytes) required by a GeoHashMap with the given capacity.

Clear()

Clears the table.

Exists(KeyParamType)

This returns true if the key exists.

GeoHashMap(s32, float, HashFunctor, KeyCompareFunctor)

Construct a hash table.

GeoHashMap(void *, s32, HashFunctor, KeyCompareFunctor)

Construct a hash table using the given block of memory for storage. The given block must be at least the size returned by CalcMemoryUsage() and be 4-byte aligned.

GeoHashMap(const GeoHashMap &)

Copy-constructor.

GeoHashMap(GeoHashMap &&)

Move constructor.

operator=(const GeoHashMap &)

Assignment operator.

operator=(GeoHashMap &&)

Move assignment operator.

Remove(KeyParamType)

Removes the key/value pair indexed by this key.

Remove(Handle)

Removes the key/value pair reference by the handle.

Swap(GeoHashMap &)

Swap places with another table.


Anchor
a70435e9a9b1c4db5de49f95a16b8ab23
a70435e9a9b1c4db5de49f95a16b8ab23

Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::~GeoHashMap

...

public: ~GeoHashMap()

...

Delete.

This will erase everything from the table.

Warning
titleWarning

Invalidates all existing handles.


Anchor
a803f46176e82866cc833dd4339c8015d
a803f46176e82866cc833dd4339c8015d

static s32 Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::CalcMemoryUsage

...

public: s32 CalcMemoryUsage
(
    s32 capacity
)

...

Gets the amount of memory (in bytes) required by a GeoHashMap with the given capacity.

This is the size of the memory block which must be passed to the appropriate GeoHashMap constructor.


Anchor
ae3081af54a6108552fce9cc47634f006
ae3081af54a6108552fce9cc47634f006

void Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::Clear

...

public: void Clear()

...

Clears the table.

Warning
titleWarning

Invalidates all existing handles.


Anchor
ad35f27c21f7f6285ad284d545b94f535
ad35f27c21f7f6285ad284d545b94f535

bool Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::Exists

...

public: bool Exists
(
    KeyParamType key
) const

...

This returns true if the key exists.

Note
titleNote

If you intend to access the value if it does exist it's more efficient to use Find().


Anchor
ad5ca1b70c67491a476c4b7d40017bac1
ad5ca1b70c67491a476c4b7d40017bac1

Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::GeoHashMap

...

public: GeoHashMap
(
    s32 capacity,
    float loadLimit,
    HashFunctor h,
    KeyCompareFunctor cmp
)

...

Construct a hash table.

The last two parameters are optional and you won't need to specify them unless you are using a non-default hash or key compare functor that needs to be constructed with something other than the default constructor.

Parameters
[in]capacity

This is the minimum size of the table.

[in]loadLimit

The load factor at which the table will grow (recommended value: 0.5. Specifying zero disables growth)

[in]h

The hashing function (can be ignored)

[in]cmp

The key comparison function (can be ignored)


Anchor
a0f65e0b024e9fe70699da84160266a03
a0f65e0b024e9fe70699da84160266a03

Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::GeoHashMap

...

public: GeoHashMap
(
    void * memory,
    s32 capacity,
    HashFunctor h,
    KeyCompareFunctor cmp
)

...

Construct a hash table using the given block of memory for storage. The given block must be at least the size returned by CalcMemoryUsage() and be 4-byte aligned.


Anchor
ac4d865b9042c9a234be0252472a106e8
ac4d865b9042c9a234be0252472a106e8

Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::GeoHashMap

...

public: GeoHashMap
(
    const GeoHashMap & rhs
)

...

Copy-constructor.


Anchor
a58caa6ce11f7640e9e94295358c43569
a58caa6ce11f7640e9e94295358c43569

Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::GeoHashMap

...

public: GeoHashMap
(
    GeoHashMap && rhs
)

...

Move constructor.


Anchor
ad3d7c7026b4d6658b663ad10340d45e8
ad3d7c7026b4d6658b663ad10340d45e8

GeoHashMap& Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::operator=

...

public: GeoHashMap & operator=
(
    const GeoHashMap & rhs
)

...

Assignment operator.

Warning
titleWarning

Invalidates all existing handles.


Anchor
a6b91550754fd59d38ff4d45929b1d46d
a6b91550754fd59d38ff4d45929b1d46d

GeoHashMap& Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::operator=

...

public: GeoHashMap & operator=
(
    GeoHashMap && rhs
)

...

Move assignment operator.

Warning
titleWarning

Invalidates all existing handles.


Anchor
a62a1bd69d5ed3abd67d497f1beca6bbc
a62a1bd69d5ed3abd67d497f1beca6bbc

bool Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::Remove

...

public: bool Remove
(
    KeyParamType key
)

...

Removes the key/value pair indexed by this key.

Returns

Returns true if the key was found and removed, otherwise false if the key doesn't exist.

Warning
titleWarning

Invalidates all existing handles.


Anchor
abf3fe71b7211bc4c8457b71dcb009c6a
abf3fe71b7211bc4c8457b71dcb009c6a

void Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::Remove

...

public: void Remove
(
    Handle h
)

...

Removes the key/value pair reference by the handle.

Warning
titleWarning

Invalidates all existing handles.


Anchor
a452e80f10be4bd4305142389e626d1d6
a452e80f10be4bd4305142389e626d1d6

void Geo::GeoHashMap< tKey, tValue, tHashFunctor, tKeyCmp >::Swap

...

public: void Swap
(
    GeoHashMap & other
)

...

Swap places with another table.

Warning
titleWarning

Invalidates all existing handles.