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:27

Definition at line 27 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)
 
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)
 
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 53 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 52 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 54 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 61 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 65 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 74 of file tuple_map.h.

◆ begin() [2/2]

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

Definition at line 70 of file tuple_map.h.

◆ cbegin()

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

Definition at line 78 of file tuple_map.h.

◆ cend()

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

Definition at line 90 of file tuple_map.h.

◆ clear()

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

Definition at line 104 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 125 of file tuple_map.h.

◆ empty()

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

Definition at line 95 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 86 of file tuple_map.h.

◆ end() [2/2]

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

Definition at line 82 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 116 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 112 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 129 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 133 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 108 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 57 of file tuple_map.h.

◆ size()

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

Definition at line 99 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 120 of file tuple_map.h.


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