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

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

Detailed Description

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

Example usage:

my_map[{1, 2, 3}] = 42.0;
my_map[{4, 5, 6}] = 84.0;
for (const auto& [key, value] : my_map) {
std::cout << "[";
for (const auto& elem : key) {
std::cout << elem << ", ";
}
std::cout << "] -> " << value << std::endl;
}
Wrapper class around std::unordered_map for maps with vector keys.
Definition vector_map.h:31

Definition at line 31 of file vector_map.h.

#include <vector_map.h>

Public Types

using iterator = typename std::unordered_map<Key, Value, vector_hash>::iterator
 
using const_iterator = typename std::unordered_map<Key, Value, vector_hash>::const_iterator
 
using size_type = typename std::unordered_map<Key, Value, vector_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)
 
std::pair< iterator, bool > emplace (const Key &key, const Value &value)
 
void erase (iterator pos)
 
size_type erase (const Key &key)
 
void swap (vector_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::vector_map< Key, Value >::const_iterator = typename std::unordered_map<Key, Value, vector_hash>::const_iterator

Definition at line 50 of file vector_map.h.

◆ iterator

template<typename Key , typename Value >
using BPMNOS::vector_map< Key, Value >::iterator = typename std::unordered_map<Key, Value, vector_hash>::iterator

Definition at line 49 of file vector_map.h.

◆ size_type

template<typename Key , typename Value >
using BPMNOS::vector_map< Key, Value >::size_type = typename std::unordered_map<Key, Value, vector_hash>::size_type

Definition at line 51 of file vector_map.h.

Member Function Documentation

◆ at() [1/2]

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

Definition at line 58 of file vector_map.h.

◆ at() [2/2]

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

Definition at line 62 of file vector_map.h.

◆ begin() [1/2]

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

Definition at line 71 of file vector_map.h.

◆ begin() [2/2]

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

Definition at line 67 of file vector_map.h.

◆ cbegin()

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

Definition at line 75 of file vector_map.h.

◆ cend()

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

Definition at line 87 of file vector_map.h.

◆ clear()

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

Definition at line 101 of file vector_map.h.

◆ count()

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

Definition at line 126 of file vector_map.h.

◆ emplace()

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

Definition at line 109 of file vector_map.h.

◆ empty()

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

Definition at line 92 of file vector_map.h.

◆ end() [1/2]

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

Definition at line 83 of file vector_map.h.

◆ end() [2/2]

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

Definition at line 79 of file vector_map.h.

◆ erase() [1/2]

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

Definition at line 117 of file vector_map.h.

◆ erase() [2/2]

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

Definition at line 113 of file vector_map.h.

◆ find() [1/2]

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

Definition at line 130 of file vector_map.h.

◆ find() [2/2]

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

Definition at line 134 of file vector_map.h.

◆ insert()

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

Definition at line 105 of file vector_map.h.

◆ operator[]()

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

Definition at line 54 of file vector_map.h.

◆ size()

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

Definition at line 96 of file vector_map.h.

◆ swap()

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

Definition at line 121 of file vector_map.h.


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