38 #include <OpenMS/config.h>
49 template <
class Key,
class T>
51 private std::map<Key, T>
67 IllegalKey(
const char* file,
int line,
const char*
function) :
76 typedef std::map<Key, T>
Base;
100 using typename Base::iterator;
101 using typename Base::const_iterator;
103 using typename Base::mapped_type;
104 using typename Base::value_type;
108 inline bool has(
const Key& key)
const
110 return Base::find(key) != Base::end();
137 template <
class Key,
class T>
141 if (it == Base::end())
143 throw IllegalKey(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION);
151 template <
class Key,
class T>
154 return this->try_emplace(key).first->second;
Exception base class.
Definition: Exception.h:91
BaseException() noexcept
Default constructor.
Map illegal key exception.
Definition: Map.h:65
IllegalKey(const char *file, int line, const char *function)
Definition: Map.h:67
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:52
bool has(const Key &key) const
Test whether the map contains the given key.
Definition: Map.h:108
Key KeyType
Definition: Map.h:78
std::map< Key, T > Base
Definition: Map.h:76
bool equals(const Map< Key, T > &other) const
Definition: Map.h:123
Base::const_reverse_iterator ConstReverseIterator
Definition: Map.h:83
Base::const_iterator ConstIterator
Definition: Map.h:81
Base::reverse_iterator ReverseIterator
Definition: Map.h:82
Base::iterator Iterator
Definition: Map.h:80
const T & operator[](const Key &key) const
Return a constant reference to the element whose key is key.
Definition: Map.h:138
Base::value_type * PointerType
Definition: Map.h:79
Base::value_type ValueType
Definition: Map.h:77
T & operator[](const Key &key)
Return a mutable reference to the element whose key is key. If an element with the key key does not e...
Definition: Map.h:152
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47