i6engine  1.0
i6e::utils::sequence_map< KeyType, ValueType, Hash > Class Template Reference

A map with linear access time and an iterator iterating through the elements in creation time. This map is intended for fast accessing complexity with preserving insertion order

Operation Time Desc.
Insert O(1)
Access O(1)
erase(key) O(n) maybe improvable when storing iterators not pointers
erase(iterator) O(n) O(1) as soon as stdlib++ allows const_iterator in erase (bug)
More...

#include <D:/Projekte/i6engine/libs/i6engine-utils/include/i6engine/utils/sequence_map.h>

Public Types

typedef std::list< std::pair< KeyType, ValueType > >::const_iterator const_iterator
 
typedef std::list< std::pair< KeyType, ValueType > >::iterator iterator
 

Public Member Functions

 sequence_map ()
 constructor More...
 
ValueType & operator[] (const KeyType &key)
 acess operator with [] using key, returns More...
 
std::size_t size () const
 returns size of the map More...
 
std::size_t erase (const KeyType &key)
 removes value for given key, returns 1 if successful, otherwise 0 More...
 
const_iterator erase (const_iterator position)
 remove value contained by iterator More...
 
std::list< std::pair< KeyType, ValueType > >::iterator find (const KeyType &key)
 returns iterator to found entry for key, otherwise end() More...
 
std::list< std::pair< KeyType, ValueType > >::const_iterator find (const KeyType &key) const
 
std::list< std::pair< KeyType, ValueType > >::iterator begin ()
 returns iterator to the begin of the list More...
 
std::list< std::pair< KeyType, ValueType > >::const_iterator begin () const
 returns const_iterator to the begin of the list More...
 
std::list< std::pair< KeyType, ValueType > >::iterator end ()
 returns iterator to the end of the list More...
 
std::list< std::pair< KeyType, ValueType > >::const_iterator end () const
 returns const_iterator to the end of the list More...
 
std::list< std::pair< KeyType, ValueType > >::const_iterator cbegin () const
 returns const_iterator to the begin of the list More...
 
std::list< std::pair< KeyType, ValueType > >::const_iterator cend () const
 returns const_iterator to the end of the list More...
 
void clear ()
 clears map More...
 

Detailed Description

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
class i6e::utils::sequence_map< KeyType, ValueType, Hash >

A map with linear access time and an iterator iterating through the elements in creation time. This map is intended for fast accessing complexity with preserving insertion order

Operation Time Desc.
Insert O(1)
Access O(1)
erase(key) O(n) maybe improvable when storing iterators not pointers
erase(iterator) O(n) O(1) as soon as stdlib++ allows const_iterator in erase (bug)

Definition at line 47 of file sequence_map.h.

Member Typedef Documentation

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
typedef std::list<std::pair<KeyType, ValueType> >::const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::const_iterator

Definition at line 49 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
typedef std::list<std::pair<KeyType, ValueType> >::iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::iterator

Definition at line 50 of file sequence_map.h.

Constructor & Destructor Documentation

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
i6e::utils::sequence_map< KeyType, ValueType, Hash >::sequence_map ( )
inline

constructor

Definition at line 55 of file sequence_map.h.

Member Function Documentation

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::begin ( )
inline

returns iterator to the begin of the list

Definition at line 141 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::begin ( ) const
inline

returns const_iterator to the begin of the list

Definition at line 148 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::cbegin ( ) const
inline

returns const_iterator to the begin of the list

Definition at line 169 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::cend ( ) const
inline

returns const_iterator to the end of the list

Definition at line 176 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
void i6e::utils::sequence_map< KeyType, ValueType, Hash >::clear ( )
inline

clears map

Definition at line 183 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::end ( )
inline

returns iterator to the end of the list

Definition at line 155 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::end ( ) const
inline

returns const_iterator to the end of the list

Definition at line 162 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::size_t i6e::utils::sequence_map< KeyType, ValueType, Hash >::erase ( const KeyType &  key)
inline

removes value for given key, returns 1 if successful, otherwise 0

Definition at line 79 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::erase ( const_iterator  position)
inline

remove value contained by iterator

Definition at line 93 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::find ( const KeyType &  key)
inline

returns iterator to found entry for key, otherwise end()

Definition at line 112 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::list<std::pair<KeyType, ValueType> >::const_iterator i6e::utils::sequence_map< KeyType, ValueType, Hash >::find ( const KeyType &  key) const
inline

Definition at line 125 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
ValueType& i6e::utils::sequence_map< KeyType, ValueType, Hash >::operator[] ( const KeyType &  key)
inline

acess operator with [] using key, returns

Definition at line 61 of file sequence_map.h.

template<typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>>
std::size_t i6e::utils::sequence_map< KeyType, ValueType, Hash >::size ( ) const
inline

returns size of the map

Definition at line 72 of file sequence_map.h.


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