reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::LinkedHashMap< Key, T, Hash, KeyEqual > Class Template Reference

A hash map that iterates in insertion order, so a container filled while parsing (eg. More...

#include <LinkedHashMap.hxx>

Public Types

typedef Key key_type
 
typedef T mapped_type
 
typedef std::pair< const Key, T > value_type
 
typedef List::size_type size_type
 
typedef List::iterator iterator
 
typedef List::const_iterator const_iterator
 

Public Member Functions

 LinkedHashMap ()
 
 LinkedHashMap (const LinkedHashMap &rhs)
 
 LinkedHashMap (LinkedHashMap &&rhs) noexcept
 
LinkedHashMap & operator= (LinkedHashMap rhs) noexcept
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
bool empty () const
 
size_type size () const
 
void clear ()
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
size_type count (const Key &key) const
 
T & operator[] (const Key &key)
 Appends a default-constructed value if key is not present.
 
std::pair< iterator, bool > insert (const value_type &value)
 Appends value if its key is not present; otherwise leaves the existing element.
 
iterator erase (const_iterator pos)
 
size_type erase (const Key &key)
 
void swap (LinkedHashMap &rhs) noexcept
 

Detailed Description

template<class Key, class T, class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
class resip::LinkedHashMap< Key, T, Hash, KeyEqual >

A hash map that iterates in insertion order, so a container filled while parsing (eg.

XML attributes) encodes back out in the order it was read, whatever hasher it uses. Offers the commonly used subset of the std::unordered_map interface; elements are std::pair<const Key, T>.

Iterators and references stay valid until their element is erased, as with std::list.

Definition at line 25 of file LinkedHashMap.hxx.

Member Typedef Documentation

◆ const_iterator

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef List::const_iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::const_iterator

Definition at line 38 of file LinkedHashMap.hxx.

◆ iterator

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef List::iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::iterator

Definition at line 37 of file LinkedHashMap.hxx.

◆ key_type

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef Key resip::LinkedHashMap< Key, T, Hash, KeyEqual >::key_type

Definition at line 28 of file LinkedHashMap.hxx.

◆ mapped_type

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef T resip::LinkedHashMap< Key, T, Hash, KeyEqual >::mapped_type

Definition at line 29 of file LinkedHashMap.hxx.

◆ size_type

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef List::size_type resip::LinkedHashMap< Key, T, Hash, KeyEqual >::size_type

Definition at line 36 of file LinkedHashMap.hxx.

◆ value_type

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef std::pair<const Key, T> resip::LinkedHashMap< Key, T, Hash, KeyEqual >::value_type

Definition at line 30 of file LinkedHashMap.hxx.

Constructor & Destructor Documentation

◆ LinkedHashMap() [1/3]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
resip::LinkedHashMap< Key, T, Hash, KeyEqual >::LinkedHashMap ( )
inline

Definition at line 40 of file LinkedHashMap.hxx.

◆ LinkedHashMap() [2/3]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
resip::LinkedHashMap< Key, T, Hash, KeyEqual >::LinkedHashMap ( const LinkedHashMap< Key, T, Hash, KeyEqual > &  rhs)
inline

Definition at line 41 of file LinkedHashMap.hxx.

◆ LinkedHashMap() [3/3]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
resip::LinkedHashMap< Key, T, Hash, KeyEqual >::LinkedHashMap ( LinkedHashMap< Key, T, Hash, KeyEqual > &&  rhs)
inlinenoexcept

Definition at line 42 of file LinkedHashMap.hxx.

Member Function Documentation

◆ begin() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::begin ( )
inline

Definition at line 45 of file LinkedHashMap.hxx.

◆ begin() [2/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
const_iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::begin ( ) const
inline

Definition at line 47 of file LinkedHashMap.hxx.

◆ cbegin()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
const_iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::cbegin ( ) const
inline

Definition at line 49 of file LinkedHashMap.hxx.

◆ cend()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
const_iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::cend ( ) const
inline

Definition at line 50 of file LinkedHashMap.hxx.

◆ clear()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
void resip::LinkedHashMap< Key, T, Hash, KeyEqual >::clear ( )
inline

Definition at line 55 of file LinkedHashMap.hxx.

◆ count()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
size_type resip::LinkedHashMap< Key, T, Hash, KeyEqual >::count ( const Key &  key) const
inline

Definition at line 73 of file LinkedHashMap.hxx.

◆ empty()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
bool resip::LinkedHashMap< Key, T, Hash, KeyEqual >::empty ( ) const
inline

Definition at line 52 of file LinkedHashMap.hxx.

◆ end() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::end ( )
inline

Definition at line 46 of file LinkedHashMap.hxx.

◆ end() [2/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
const_iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::end ( ) const
inline

Definition at line 48 of file LinkedHashMap.hxx.

◆ erase() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
size_type resip::LinkedHashMap< Key, T, Hash, KeyEqual >::erase ( const Key &  key)
inline

Definition at line 104 of file LinkedHashMap.hxx.

◆ erase() [2/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::erase ( const_iterator  pos)
inline
Returns
the iterator following the erased element

Definition at line 98 of file LinkedHashMap.hxx.

◆ find() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::find ( const Key &  key)
inline

Definition at line 61 of file LinkedHashMap.hxx.

◆ find() [2/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
const_iterator resip::LinkedHashMap< Key, T, Hash, KeyEqual >::find ( const Key &  key) const
inline

Definition at line 67 of file LinkedHashMap.hxx.

◆ insert()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
std::pair< iterator, bool > resip::LinkedHashMap< Key, T, Hash, KeyEqual >::insert ( const value_type &  value)
inline

Appends value if its key is not present; otherwise leaves the existing element.

Definition at line 87 of file LinkedHashMap.hxx.

◆ operator=()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
LinkedHashMap & resip::LinkedHashMap< Key, T, Hash, KeyEqual >::operator= ( LinkedHashMap< Key, T, Hash, KeyEqual >  rhs)
inlinenoexcept

Definition at line 43 of file LinkedHashMap.hxx.

◆ operator[]()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
T & resip::LinkedHashMap< Key, T, Hash, KeyEqual >::operator[] ( const Key &  key)
inline

Appends a default-constructed value if key is not present.

Definition at line 76 of file LinkedHashMap.hxx.

◆ size()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
size_type resip::LinkedHashMap< Key, T, Hash, KeyEqual >::size ( ) const
inline

Definition at line 53 of file LinkedHashMap.hxx.

◆ swap()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
void resip::LinkedHashMap< Key, T, Hash, KeyEqual >::swap ( LinkedHashMap< Key, T, Hash, KeyEqual > &  rhs)
inlinenoexcept

Definition at line 116 of file LinkedHashMap.hxx.


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