This is the documentation for Enlighten.
class Geo GeoKeyValueArray
template<typename, typename>
class Geo::GeoKeyValueArray
A fast implementation of a set associative container, this one using a sorted array of key values to lookup a similar array of value pointers.
Requires that the key type support both operator< and operator<=. This could be removed by a small refactor of the binary search loop.
Requires that the value type be stored on the heap, as this class only stores pointers. Fixing this would require changing the class to work with iterators (to allow a sentinel value such as end() to represent a missing value).
Functions
Name | Description |
|---|---|
Removes all entries from the collection. Remember, this object did not take ownership. | |
Find a value in the collection with TKey key. | |
Find the index of a given key. | |
Get the key at index i. | |
Returns the number of entries in the collection. | |
Get the value at index i. | |
Get the value at index i. | |
Insert an pointer to a TValue item into the container. | |
Get the value at index i. | |
Get the value at index i. | |
Remove the entry referenced to by key. | |
Remove the entry referenced to by key. |
void Geo::GeoKeyValueArray< TKey, TValue >::Clear
public: void Clear()
Removes all entries from the collection. Remember, this object did not take ownership.
TValue * Geo::GeoKeyValueArray< TKey, TValue >::Find
public: TValue * Find
(
const TKey & key
) const
Find a value in the collection with TKey key.
O(logN) operation.
Returns
NULL on failure.
s32 Geo::GeoKeyValueArray< TKey, TValue >::FindIndex
public: s32 FindIndex
(
const TKey & key
) const