|
using | key_type = KEY_TYPE |
| The type used for the key of the map.
|
|
using | mapped_type = T_PTR |
| pointer to the value type
|
|
using | LookupMapType = std::unordered_map< KEY_TYPE, INDEX_TYPE > |
| the type of the lookup map
|
|
using | value_type = typename std::pair< KEY_TYPE, T_PTR > |
| the type of the values held in the vector
|
|
using | const_key_value_type = typename std::pair< KEY_TYPE const, T * > |
| the type of the values with const keys held in the vector
|
|
using | const_value_type = typename std::pair< KEY_TYPE const, T const * > |
| a const type of the values held in the vector
|
|
using | valueContainer = std::vector< value_type > |
| the type of the vector container
|
|
using | constKeyValueContainer = std::vector< const_key_value_type > |
| a const type of the vector container
|
|
using | constValueContainer = std::vector< const_value_type > |
| a const type of the vector container
|
|
using | pointer = typename valueContainer::pointer |
| the pointer type of the value container
|
|
using | const_pointer = typename valueContainer::const_pointer |
| the pointer to const type of the value container
|
|
using | reference = typename valueContainer::reference |
| reference type of the value container
|
|
using | const_reference = typename valueContainer::const_reference |
| reference to const type of the value container
|
|
using | size_type = typename valueContainer::size_type |
| the size_type of the value container
|
|
using | iterator = typename constKeyValueContainer::iterator |
| the iterator type of the value container
|
|
using | const_iterator = typename constValueContainer::const_iterator |
| the iterator to const type of the value container
|
|
using | reverse_iterator = typename constKeyValueContainer::reverse_iterator |
| the reverse iterator type of the value container
|
|
using | const_reverse_iterator = typename constValueContainer::const_reverse_iterator |
| the reverse iterator to const type of the value container
|
|
using | KeyIndex = KeyIndexT< KEY_TYPE const, INDEX_TYPE > |
| alias for the KeyIndex itself
|
|
template<typename T, typename T_PTR = T *, typename KEY_TYPE = string, typename INDEX_TYPE = int>
class geos::MappedVector< T, T_PTR, KEY_TYPE, INDEX_TYPE >
This class defines a stl-like container that stores values in an stl vector, and has a map lookup table to access the values by a key. It combines the random access performance of a vector when the index is known, the flexibility of a mapped key lookup O(n) if only the key is known.
In addition, a keyIndex can be used for lookup, which will give similar performance to an index lookup after the first use of a keyIndex.
Definition at line 49 of file MappedVector.hpp.
template<typename T , typename T_PTR = T *, typename KEY_TYPE = string, typename INDEX_TYPE = int>
Remove element at given index.
- Parameters
-
index | index of element to remove. |
Completely remove element at given index and corresponding key lookup. If pointed-to object is owned, it is deleted.
Definition at line 315 of file MappedVector.hpp.
template<typename T , typename T_PTR = T *, typename KEY_TYPE = string, typename INDEX_TYPE = int>
Remove element at given key.
- Parameters
-
key | key of element to remove. |
This function will set the element at the given key to nullptr.
Definition at line 349 of file MappedVector.hpp.
template<typename T , typename T_PTR = T *, typename KEY_TYPE = string, typename INDEX_TYPE = int>
Remove element at given key.
- Parameters
-
keyIndex | key of element to remove. |
This function will set the element at the given key to nullptr.
Definition at line 364 of file MappedVector.hpp.