4#include <unordered_map>
16 template <
class MultiContainerIterator,
class ContainerIterator,
class KeyType,
class ValueType>
24 MultiContainerIterator DataMultiMapIt;
27 ContainerIterator DataMapIt;
41 ContainerIterator dataMapIt,
bool isMultiMap)
43 IsMultiMap = isMultiMap;
44 DataMultiMapIt = dataMultiMapIt;
45 DataMapIt = dataMapIt;
55 IsMultiMap = other.IsMultiMap;
56 DataMultiMapIt = other.DataMultiMapIt;
57 DataMapIt = other.DataMapIt;
71 IsMultiMap = other.IsMultiMap;
72 DataMultiMapIt = other.DataMultiMapIt;
73 DataMapIt = other.DataMapIt;
89 return DataMultiMapIt != other.DataMultiMapIt;
91 return DataMapIt != other.DataMapIt;
104 return DataMultiMapIt == other.DataMultiMapIt;
106 return DataMapIt == other.DataMapIt;
145 return *DataMultiMapIt;
167 return DataMultiMapIt;
174 template <
class KeyType,
class ValueType>
175 using UnorderedMapIterator = AllMapIterator<typename std::unordered_multimap<KeyType, ValueType>::iterator,
176 typename std::unordered_map<KeyType, ValueType>::iterator, KeyType, ValueType>;
181 template <
class KeyType,
class ValueType>
182 using MapIterator = AllMapIterator<typename std::multimap<KeyType, ValueType>::iterator,
183 typename std::map<KeyType, ValueType>::iterator, KeyType, ValueType>;
188 template <
class KeyType,
class ValueType>
189 using ReverseMapIterator = AllMapIterator<typename std::multimap<KeyType, ValueType>::reverse_iterator,
190 typename std::map<KeyType, ValueType>::reverse_iterator, KeyType, ValueType>;
205 template <
class MultiContainer,
class Container,
class Iterator,
class KeyType,
class ValueType>
275 template <
class EmplaceKeyType,
class EmplaceValueType>
397 template <
class KeyType,
class ValueType>
398 class Map :
public ParentMap<std::multimap<KeyType, ValueType>, std::map<KeyType, ValueType>,
399 MapIterator<KeyType, ValueType>, KeyType, ValueType>
470 template <
class KeyType,
class ValueType>
471 class UnorderedMap :
public ParentMap<std::unordered_multimap<KeyType, ValueType>, std::unordered_map<KeyType, ValueType>,
472 UnorderedMapIterator<KeyType, ValueType>, KeyType, ValueType>
Iterator class for all library maps.
Definition Map.h:18
AllMapIterator & operator++()
Pre increment operator.
Definition Map.h:114
AllMapIterator()
Default constructor.
Definition Map.h:31
bool operator==(AllMapIterator const &other) const
Compare operator.
Definition Map.h:101
AllMapIterator(MultiContainerIterator dataMultiMapIt, ContainerIterator dataMapIt, bool isMultiMap)
Constructor.
Definition Map.h:40
ContainerIterator GetContainerIterator() const
Method for get container iterator.
Definition Map.h:155
AllMapIterator & operator=(const AllMapIterator &other)
Assignment operator.
Definition Map.h:67
bool operator!=(AllMapIterator const &other) const
Not equal operator.
Definition Map.h:86
MultiContainerIterator GetMultiContainerIterator() const
Method for get multi container iterator.
Definition Map.h:165
std::pair< KeyType, ValueType > operator*() const
Operator*.
Definition Map.h:142
AllMapIterator & operator--()
Pre decrement operator.
Definition Map.h:128
AllMapIterator(const AllMapIterator &other)
Copy constructor.
Definition Map.h:53
iterator begin() noexcept
Begin provides access to the Data iterator.
Definition DataContainer.h:42
iterator end() noexcept
End provides access to the Data iterator.
Definition DataContainer.h:47
Specialization of class DataContainer, used as a type std::map<std::string, DataSaver>
Definition DataContainer.h:309
Specialization of class DataContainer, used as a type std::multimap<std::string, DataSaver>
Definition DataContainer.h:313
The descendant of the ParentMap class, which stores the map, i.e. the binary tree.
Definition Map.h:400
ReverseMapIterator< KeyType, ValueType > Rbegin()
Reverse begin container method.
Definition Map.h:447
Map(bool isMultiMap)
Class constructor.
Definition Map.h:407
MapIterator< KeyType, ValueType > LowerBound(const KeyType &data)
Returns an iterator pointing to the first element that is not less than (i.e. greater or equal to) da...
Definition Map.h:420
ReverseMapIterator< KeyType, ValueType > Rend()
Reverse end container method.
Definition Map.h:459
MapIterator< KeyType, ValueType > UpperBound(const KeyType &data)
Returns an iterator pointing to the first element that is greater than key.
Definition Map.h:435
Parent wrapper class for stl containers.
Definition Map.h:207
Iterator End()
End container method.
Definition Map.h:258
Iterator begin()
Begin container method.
Definition Map.h:226
std::size_t Size()
The method for get Map size.
Definition Map.h:385
Iterator Find(const KeyType &data)
The method for getting iterator with key.
Definition Map.h:318
Iterator Begin()
Begin container method.
Definition Map.h:248
std::size_t Erase(const KeyType &data)
The method for erase data from Map with key.
Definition Map.h:339
Iterator Erase(const Iterator &dataIt)
The method for erase data from Map with iterator.
Definition Map.h:357
std::pair< Iterator, Iterator > EqualRange(const KeyType &data)
The method for getting range of data.
Definition Map.h:297
bool IsMultiMap
Is this multi map.
Definition Map.h:210
std::pair< Iterator, bool > Emplace(EmplaceKeyType &&key, EmplaceValueType &&value)
The method for inserting data into the Map.
Definition Map.h:276
void Clear()
The method for clear Map.
Definition Map.h:372
Iterator end()
End container method.
Definition Map.h:238
The descendant of the ParentMap class, which stores the unordered_map, i.e. the hash table.
Definition Map.h:473
UnorderedMap(bool isMultiMap)
Class constructor.
Definition Map.h:480