BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
BPMNOS::tuple_map< Key, Value > Class Template Reference

Wrapper class around std::unordered_map for maps with tuple keys. More...

Detailed Description

template<typename Key, typename Value>
class BPMNOS::tuple_map< Key, Value >

Example usage:

my_map[std::make_tuple(1, "example")] = 42.0;
my_map[std::make_tuple(2, "test")] = 84.0;
for (const auto& [key, value] : my_map) {
std::cout << "(" << std::get<0>(key) << ", " << std::get<1>(key) << ") -> " << value << std::endl;
}
Wrapper class around std::unordered_map for maps with tuple keys.
Definition tuple_map.h:35

Definition at line 35 of file tuple_map.h.

#include <tuple_map.h>

Public Types

using iterator = typename std::unordered_map<Key, Value, tuple_hash>::iterator
 
using const_iterator = typename std::unordered_map<Key, Value, tuple_hash>::const_iterator
 
using size_type = typename std::unordered_map<Key, Value, tuple_hash>::size_type
 

Public Member Functions

Valueoperator[] (const Key &key)
 
bool contains (const Key &key) const
 
Valueat (const Key &key)
 
const Valueat (const Key &key) const
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
bool empty () const noexcept
 
size_type size () const noexcept
 
void clear () noexcept
 
std::pair< iterator, bool > insert (const std::pair< Key, Value > &value)
 
std::pair< iterator, bool > emplace (const Key &key, const Value &value)
 
std::pair< iterator, bool > try_emplace (const Key &key, const Value &value)
 
void erase (iterator pos)
 
size_type erase (const Key &key)
 
void swap (tuple_map &other) noexcept
 
size_type count (const Key &key) const
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 

Member Typedef Documentation

◆ const_iterator

template<typename Key , typename Value >
using BPMNOS::tuple_map< Key, Value >::const_iterator = typename std::unordered_map<Key, Value, tuple_hash>::const_iterator

Definition at line 81 of file tuple_map.h.

◆ iterator

template<typename Key , typename Value >
using BPMNOS::tuple_map< Key, Value >::iterator = typename std::unordered_map<Key, Value, tuple_hash>::iterator

Definition at line 80 of file tuple_map.h.

◆ size_type

template<typename Key , typename Value >
using BPMNOS::tuple_map< Key, Value >::size_type = typename std::unordered_map<Key, Value, tuple_hash>::size_type

Definition at line 82 of file tuple_map.h.

Member Function Documentation

◆ at() [1/2]

template<typename Key , typename Value >
Value & BPMNOS::tuple_map< Key, Value >::at ( const Key & key)
inline

Definition at line 93 of file tuple_map.h.

◆ at() [2/2]

template<typename Key , typename Value >
const Value & BPMNOS::tuple_map< Key, Value >::at ( const Key & key) const
inline

Definition at line 97 of file tuple_map.h.

◆ begin() [1/2]

template<typename Key , typename Value >
const_iterator BPMNOS::tuple_map< Key, Value >::begin ( ) const
inlinenoexcept

Definition at line 106 of file tuple_map.h.

◆ begin() [2/2]

template<typename Key , typename Value >
iterator BPMNOS::tuple_map< Key, Value >::begin ( )
inlinenoexcept

Definition at line 102 of file tuple_map.h.

◆ cbegin()

template<typename Key , typename Value >
const_iterator BPMNOS::tuple_map< Key, Value >::cbegin ( ) const
inlinenoexcept

Definition at line 110 of file tuple_map.h.

◆ cend()

template<typename Key , typename Value >
const_iterator BPMNOS::tuple_map< Key, Value >::cend ( ) const
inlinenoexcept

Definition at line 122 of file tuple_map.h.

◆ clear()

template<typename Key , typename Value >
void BPMNOS::tuple_map< Key, Value >::clear ( )
inlinenoexcept

Definition at line 136 of file tuple_map.h.

◆ contains()

template<typename Key , typename Value >
bool BPMNOS::tuple_map< Key, Value >::contains ( const Key & key) const
inline

Definition at line 89 of file tuple_map.h.

◆ count()

template<typename Key , typename Value >
size_type BPMNOS::tuple_map< Key, Value >::count ( const Key & key) const
inline

Definition at line 166 of file tuple_map.h.

◆ emplace()

template<typename Key , typename Value >
std::pair< iterator, bool > BPMNOS::tuple_map< Key, Value >::emplace ( const Key & key,
const Value & value )
inline

Definition at line 145 of file tuple_map.h.

◆ empty()

template<typename Key , typename Value >
bool BPMNOS::tuple_map< Key, Value >::empty ( ) const
inlinenoexcept

Definition at line 127 of file tuple_map.h.

◆ end() [1/2]

template<typename Key , typename Value >
const_iterator BPMNOS::tuple_map< Key, Value >::end ( ) const
inlinenoexcept

Definition at line 118 of file tuple_map.h.

◆ end() [2/2]

template<typename Key , typename Value >
iterator BPMNOS::tuple_map< Key, Value >::end ( )
inlinenoexcept

Definition at line 114 of file tuple_map.h.

◆ erase() [1/2]

template<typename Key , typename Value >
size_type BPMNOS::tuple_map< Key, Value >::erase ( const Key & key)
inline

Definition at line 157 of file tuple_map.h.

◆ erase() [2/2]

template<typename Key , typename Value >
void BPMNOS::tuple_map< Key, Value >::erase ( iterator pos)
inline

Definition at line 153 of file tuple_map.h.

◆ find() [1/2]

template<typename Key , typename Value >
iterator BPMNOS::tuple_map< Key, Value >::find ( const Key & key)
inline

Definition at line 170 of file tuple_map.h.

◆ find() [2/2]

template<typename Key , typename Value >
const_iterator BPMNOS::tuple_map< Key, Value >::find ( const Key & key) const
inline

Definition at line 174 of file tuple_map.h.

◆ insert()

template<typename Key , typename Value >
std::pair< iterator, bool > BPMNOS::tuple_map< Key, Value >::insert ( const std::pair< Key, Value > & value)
inline

Definition at line 140 of file tuple_map.h.

◆ operator[]()

template<typename Key , typename Value >
Value & BPMNOS::tuple_map< Key, Value >::operator[] ( const Key & key)
inline

Definition at line 85 of file tuple_map.h.

◆ size()

template<typename Key , typename Value >
size_type BPMNOS::tuple_map< Key, Value >::size ( ) const
inlinenoexcept

Definition at line 131 of file tuple_map.h.

◆ swap()

template<typename Key , typename Value >
void BPMNOS::tuple_map< Key, Value >::swap ( tuple_map< Key, Value > & other)
inlinenoexcept

Definition at line 161 of file tuple_map.h.

◆ try_emplace()

template<typename Key , typename Value >
std::pair< iterator, bool > BPMNOS::tuple_map< Key, Value >::try_emplace ( const Key & key,
const Value & value )
inline

Definition at line 149 of file tuple_map.h.


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