MVault 1.0.0
Simple c++ database
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 () noexcept
 Begin container method.
 
Iterator end () noexcept
 End container method.
 
Iterator Begin () noexcept
 Begin container method.
 
Iterator End () noexcept
 End container method.
 
bool IsMultiContainer () const noexcept
 The method to check if it is multi container.
 
template<class EmplaceKeyType , class EmplaceValueType >
std::pair< Iterator, boolEmplace (EmplaceKeyType &&key, EmplaceValueType &&value) noexcept
 The method for inserting data into the Map.
 
std::pair< Iterator, IteratorEqualRange (const KeyType &data) noexcept
 The method for getting range of data.
 
Iterator Find (const KeyType &data) noexcept
 The method for getting iterator with key.
 
std::size_t Erase (const KeyType &data) noexcept
 The method for erase data from Map with key.
 
Iterator Erase (const Iterator &dataIt) noexcept
 The method for erase data from Map with iterator.
 
void Clear () noexcept
 The method for clear Map.
 
std::size_t Size () noexcept
 The method for get Map size.
 

Protected Attributes

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

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()

Iterator mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::begin ( )
inlinenoexcept

Begin container method.

The need for the container to support foreach loops

Returns
Firtst map container iterator

◆ Begin()

Iterator mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::Begin ( )
inlinenoexcept

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 
)
inlinenoexcept

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()

Iterator mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::end ( )
inlinenoexcept

End container method.

The need for the container to support foreach loops

Returns
Last map container iterator

◆ End()

Iterator mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::End ( )
inlinenoexcept

End container method.

Returns
Last map container iterator

◆ EqualRange()

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

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)
inlinenoexcept

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)
inlinenoexcept

The method for erase data from Map with key.

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

◆ Find()

Iterator mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::Find ( const KeyType data)
inlinenoexcept

The method for getting iterator with key.

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

◆ IsMultiContainer()

bool mvlt::ParentMap< MultiContainer, Container, Iterator, KeyType, ValueType >::IsMultiContainer ( ) const
inlinenoexcept

The method to check if it is multi container.

Returns
true if it is multicontiner, otherwise return false

◆ Size()

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

The method for get Map size.

Returns
Map size

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