82 template <
typename K,
typename T,
typename M = std::map<K, T>>
112 template <
typename In>
113 Map( In&& first, In&& last ) :
m_map(
std::forward<In>( first ),
std::forward<In>( last ) ) {}
146 return m_map.equal_range( key );
150 template <
class... Args>
151 std::pair<iterator, bool>
emplace( Args&&... args ) {
152 return m_map.emplace( std::forward<Args>( args )... );
154 template <
typename ValueType>
155 inline std::pair<iterator, bool>
insert( ValueType&& val ) {
156 return m_map.insert( std::forward<ValueType>( val ) );
159 return m_map.insert( std::forward<value_type>( val ) );
161 template <
typename In>
162 inline void insert( In&& first, In&& last ) {
163 m_map.insert( std::forward<In>( first ), std::forward<In>( last ) );
165 template <
typename ValueType>
167 return m_map.insert( std::forward<ValueType>( val ) ).first;
207 auto it =
m_map.find( key );
242 m_map.insert( std::begin( other ), std::end( other ) );
247 m_map.insert( std::begin( other ), std::end( other ) );
251 template <
class K1,
class K2,
class K3>
253 m_map.insert( std::begin( other ), std::end( other ) );
270 return std::next( this->
begin(), index )->first;
279 return std::next( this->
begin(), index )->second;
284 return s << static_cast<const M&>( m );
287 template <
typename K,
typename T,
typename M>
Provide serialization function (output only) for some common STL classes (vectors,...
Helper base-class to allow the generic Python-decoration for all "map-like" classes in Gaudi.
void throw_out_of_range_exception() const
throw std::out_of_range exception
Extension of the STL map.
std::pair< iterator, bool > insert(value_type &&val)
const result_type & at(const argument_type &key) const
checked access to the map
map_type::const_iterator const_iterator
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
iterator insert(iterator, ValueType &&val)
Map(In &&first, In &&last)
Construct from a subset.
Map & merge(const Map &other)
Merge two maps.
const value_type & const_reference
void update(const key_type &key, const mapped_type &mapped)
std::pair< const K, T > value_type
const_iterator begin() const
std::pair< iterator, iterator > equal_range(const key_type &key)
void swap(map_type &other)
std::pair< iterator, bool > insert(ValueType &&val)
iterator lower_bound(const key_type &key)
std::pair< iterator, bool > emplace(Args &&... args)
iterator find(const key_type &key)
static const result_type s_null_value
virtual ~Map()=default
Virtual destructor. You can inherit from this map type.
size_type count(const key_type &key) const
const mapped_type & value_at(const size_type index) const
useful method for python decoration:
Map(const map_type &other)
Constructor from a standard map.
size_type erase(const key_type &key)
iterator erase(const_iterator pos)
Map & merge(const Map< K1, K2, K3 > &other)
Merge two maps.
friend std::ostream & operator<<(std::ostream &s, const GaudiUtils::Map< K, T, M > &m)
Serialize a GaudiUtils::Map in a python like format. E.g. "{a: 1, b: 2}".
const mapped_type & operator[](const key_type &key) const
Access elements of a const Map.
iterator upper_bound(const key_type &key)
void insert(In &&first, In &&last)
map_type::size_type size_type
const_iterator lower_bound(const key_type &key) const
map_type::iterator iterator
const_iterator upper_bound(const key_type &key) const
mapped_type & operator[](const key_type &key)
const result_type & operator()(const argument_type &key) const
Allow to use Map as an unary function.
const key_type & key_at(const size_type index) const
useful method for python decoration:
size_type max_size() const
const_iterator end() const
const_iterator find(const key_type &key) const
Map & merge(const map_type &other)
Merge two maps.
iterator erase(const_iterator first, const_iterator last)