i6engine
1.0
|
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) |
#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... | |
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.
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.
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.
|
inline |
constructor
Definition at line 55 of file sequence_map.h.
|
inline |
returns iterator to the begin of the list
Definition at line 141 of file sequence_map.h.
|
inline |
returns const_iterator to the begin of the list
Definition at line 148 of file sequence_map.h.
|
inline |
returns const_iterator to the begin of the list
Definition at line 169 of file sequence_map.h.
|
inline |
returns const_iterator to the end of the list
Definition at line 176 of file sequence_map.h.
|
inline |
clears map
Definition at line 183 of file sequence_map.h.
|
inline |
returns iterator to the end of the list
Definition at line 155 of file sequence_map.h.
|
inline |
returns const_iterator to the end of the list
Definition at line 162 of file sequence_map.h.
|
inline |
removes value for given key, returns 1 if successful, otherwise 0
Definition at line 79 of file sequence_map.h.
|
inline |
remove value contained by iterator
Definition at line 93 of file sequence_map.h.
|
inline |
returns iterator to found entry for key, otherwise end()
Definition at line 112 of file sequence_map.h.
|
inline |
Definition at line 125 of file sequence_map.h.
|
inline |
acess operator with [] using key, returns
Definition at line 61 of file sequence_map.h.
|
inline |
returns size of the map
Definition at line 72 of file sequence_map.h.