Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Simple map used to add, remove, iterate, clear elements efficiently (all O(1)). More...
#include <NaryQuickMap.hpp>
Public Member Functions | |
NaryQuickMap () | |
void | reset () |
void | clear () |
int | size () const |
ValueType * | begin () |
ValueType * | end () |
const ValueType * | begin () const |
const ValueType * | end () const |
void | append (KeyType key) |
void | append (KeyType key, ValueType value) |
void | insert (KeyType key) |
void | insert (KeyType key, const ValueType &value) |
void | erase (KeyType key) |
int | find (KeyType key) const |
bool | hasKey (KeyType key) const |
const ValueType & | valueFromKey (KeyType key) const |
const ValueType & | valueFromIndex (int i) const |
KeyType | key (int i) const |
Protected Attributes | |
ValueType | mValues [MaxMapType] |
KeyType | mValueToKey [MaxMapType] |
int | mMapSize |
int | mKeyToValue [MaxMapType] |
Simple map used to add, remove, iterate, clear elements efficiently (all O(1)).
To be used only when the number of keys is well defined and not too big. Internally used by VL to deal with enables and render states.
Definition at line 43 of file NaryQuickMap.hpp.
vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::NaryQuickMap | ( | ) | [inline] |
Definition at line 46 of file NaryQuickMap.hpp.
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::reset | ( | ) | [inline] |
Definition at line 51 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::NaryQuickMap().
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::clear | ( | ) | [inline] |
Definition at line 58 of file NaryQuickMap.hpp.
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::size | ( | ) | const [inline] |
Definition at line 64 of file NaryQuickMap.hpp.
ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::begin | ( | ) | [inline] |
Definition at line 66 of file NaryQuickMap.hpp.
ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::end | ( | ) | [inline] |
Definition at line 67 of file NaryQuickMap.hpp.
const ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::begin | ( | ) | const [inline] |
Definition at line 68 of file NaryQuickMap.hpp.
const ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::end | ( | ) | const [inline] |
Definition at line 69 of file NaryQuickMap.hpp.
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::append | ( | KeyType | key ) | [inline] |
Definition at line 71 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::append().
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::append | ( | KeyType | key, |
ValueType | value | ||
) | [inline] |
Definition at line 77 of file NaryQuickMap.hpp.
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::insert | ( | KeyType | key ) | [inline] |
Definition at line 86 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert().
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::insert | ( | KeyType | key, |
const ValueType & | value | ||
) | [inline] |
Definition at line 91 of file NaryQuickMap.hpp.
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::erase | ( | KeyType | key ) | [inline] |
Definition at line 105 of file NaryQuickMap.hpp.
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::find | ( | KeyType | key ) | const [inline] |
Definition at line 125 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::erase(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::hasKey(), and vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert().
bool vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::hasKey | ( | KeyType | key ) | const [inline] |
Definition at line 144 of file NaryQuickMap.hpp.
const ValueType& vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::valueFromKey | ( | KeyType | key ) | const [inline] |
Definition at line 149 of file NaryQuickMap.hpp.
const ValueType& vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::valueFromIndex | ( | int | i ) | const [inline] |
Definition at line 158 of file NaryQuickMap.hpp.
KeyType vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::key | ( | int | i ) | const [inline] |
Definition at line 163 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::append(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::find(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert(), and vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::valueFromKey().
ValueType vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mValues[MaxMapType] [protected] |
Definition at line 173 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::append(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::begin(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::end(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::erase(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::valueFromIndex(), and vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::valueFromKey().
KeyType vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mValueToKey[MaxMapType] [protected] |
Definition at line 175 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::append(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::erase(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::find(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::key(), and vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::reset().
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mMapSize [protected] |
Definition at line 177 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::append(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::clear(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::end(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::erase(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::find(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::reset(), and vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::size().
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mKeyToValue[MaxMapType] [protected] |
Definition at line 179 of file NaryQuickMap.hpp.
Referenced by vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::append(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::erase(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::find(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::insert(), vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::reset(), and vl::NaryQuickMap< EEnable, EEnable, EN_EnableCount >::valueFromKey().