Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::NaryQuickMap< KeyType, ValueType, MaxMapType > Class Template Reference

Simple map used to add, remove, iterate, clear elements efficiently (all O(1)). More...

#include <NaryQuickMap.hpp>

Inheritance diagram for vl::NaryQuickMap< KeyType, ValueType, MaxMapType >:
vl::Object

List of all members.

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]

Detailed Description

template<typename KeyType, typename ValueType, int MaxMapType>
class vl::NaryQuickMap< KeyType, ValueType, 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.


Constructor & Destructor Documentation

template<typename KeyType, typename ValueType, int MaxMapType>
vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::NaryQuickMap (  ) [inline]

Definition at line 46 of file NaryQuickMap.hpp.


Member Function Documentation

template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::reset (  ) [inline]
template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::clear (  ) [inline]

Definition at line 58 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::size (  ) const [inline]

Definition at line 64 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::begin (  ) [inline]

Definition at line 66 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::end (  ) [inline]

Definition at line 67 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
const ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::begin (  ) const [inline]

Definition at line 68 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
const ValueType* vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::end (  ) const [inline]

Definition at line 69 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::append ( KeyType  key ) [inline]
template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::append ( KeyType  key,
ValueType  value 
) [inline]

Definition at line 77 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::insert ( KeyType  key ) [inline]
template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::insert ( KeyType  key,
const ValueType &  value 
) [inline]

Definition at line 91 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
void vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::erase ( KeyType  key ) [inline]

Definition at line 105 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::find ( KeyType  key ) const [inline]
template<typename KeyType, typename ValueType, int MaxMapType>
bool vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::hasKey ( KeyType  key ) const [inline]

Definition at line 144 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
const ValueType& vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::valueFromKey ( KeyType  key ) const [inline]

Definition at line 149 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
const ValueType& vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::valueFromIndex ( int  i ) const [inline]

Definition at line 158 of file NaryQuickMap.hpp.

template<typename KeyType, typename ValueType, int MaxMapType>
KeyType vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::key ( int  i ) const [inline]

Member Data Documentation

template<typename KeyType, typename ValueType, int MaxMapType>
ValueType vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mValues[MaxMapType] [protected]
template<typename KeyType, typename ValueType, int MaxMapType>
KeyType vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mValueToKey[MaxMapType] [protected]
template<typename KeyType, typename ValueType, int MaxMapType>
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mMapSize [protected]
template<typename KeyType, typename ValueType, int MaxMapType>
int vl::NaryQuickMap< KeyType, ValueType, MaxMapType >::mKeyToValue[MaxMapType] [protected]

The documentation for this class was generated from the following file:

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.