MVault 0.0.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType > Class Template Reference

Parent wrapper class for stl containers. More...

#include <Map.h>

Public Member Functions

Iterator begin ()
 Begin container method.
 
Iterator end ()
 End container method.
 
Iterator Begin ()
 Begin container method.
 
Iterator End ()
 End container method.
 
template<class EmplaceKeyType , class EmplaceValueType >
std::pair< Iterator, boolEmplace (EmplaceKeyType &&key, EmplaceValueType &&value)
 The method for inserting data into the Map.
 
std::pair< Iterator, IteratorEqualRange (const KeyType &data)
 The method for getting range of data.
 
Iterator Find (const KeyType &data)
 The method for getting iterator with key.
 
std::size_t Erase (const KeyType &data)
 The method for erase data from Map with key.
 
Iterator Erase (const Iterator &dataIt)
 The method for erase data from Map with iterator.
 
void Clear ()
 The method for clear Map.
 
std::size_t Size ()
 The method for get Map size.
 

Protected Attributes

bool IsMultiMap = false
 Is this multi map.
 
MultiContainer DataMultiMap
 
Container DataMap
 

Detailed Description

template<class MultiContainer, class Container, class Iterator, class KeyType, class ValueType>
class mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >

Parent wrapper class for stl containers.

This class is needed to provide the same interface to std::unordered_map and std::unordered_multimap, and for std::map and std::multimap. At one point in time, this class stores data either in a multi-container or in a regular one.

Template Parameters
<MultiContainer>- A class for a multi container
<Container>- A class for a container
<Iterator>- A class for a ParentMap iterator
<KeyType>- A class for a container and multi container key type
<ValueType>- A class for a container and multi container value type

Member Function Documentation

◆ begin()

Begin container method.

The need for the container to support foreach loops

Returns
Firtst map container iterator

◆ Begin()

Begin container method.

Returns
Firtst map container iterator

◆ Emplace()

std::pair< Iterator, bool > mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::Emplace ( EmplaceKeyType &&  key,
EmplaceValueType &&  value 
)
inline

The method for inserting data into the Map.

Template Parameters
<EmplaceKeyType>- Key type
<EmplaceValueType>- Value type
Parameters
[in]keyrvalue to key
[in]valuervlaue to value
Returns
A pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool value set to true if and only if the insertion took place.

◆ end()

End container method.

The need for the container to support foreach loops

Returns
Last map container iterator

◆ End()

End container method.

Returns
Last map container iterator

◆ EqualRange()

std::pair< Iterator, Iterator > mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::EqualRange ( const KeyType data)
inline

The method for getting range of data.

Parameters
[in]datakey to find
Returns
Pair with first and last iterator with key equals to data

◆ Erase() [1/2]

Iterator mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::Erase ( const Iterator dataIt)
inline

The method for erase data from Map with iterator.

Parameters
[in]dataItiterator to erase
Returns
Iterator following the last removed element.

◆ Erase() [2/2]

std::size_t mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::Erase ( const KeyType data)
inline

The method for erase data from Map with key.

Parameters
[in]datakey to erase
Returns
Number of deleted items

◆ Find()

The method for getting iterator with key.

Parameters
[in]datakey to find
Returns
Iterator with key equals to data

◆ Size()

std::size_t mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::Size ( )
inline

The method for get Map size.

Returns
Map size

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