11 #ifndef GAUDIKERNEL_MAP_H 12 #define GAUDIKERNEL_MAP_H 1 90 template <
typename K,
typename T,
typename M = std::map<K, T>>
129 template <
typename In>
130 Map( In&& first, In&& last ) :
m_map(
std::forward<In>( first ),
std::forward<In>( last ) ) {}
133 virtual ~Map() =
default;
169 return m_map.equal_range( key );
173 template <
class... Args>
175 return m_map.emplace( std::forward<Args>(
args )... );
177 template <
typename ValueType>
179 return m_map.insert( std::forward<ValueType>( val ) );
182 return m_map.insert( std::forward<value_type>( val ) );
184 template <
typename In>
185 inline void insert( In&& first, In&& last ) {
186 m_map.insert( std::forward<In>( first ), std::forward<In>( last ) );
188 template <
typename ValueType>
190 return m_map.insert( std::forward<ValueType>( val ) ).first;
230 auto it =
m_map.find( key );
277 template <
class K1,
class K2,
class K3>
314 template <
typename K,
typename T,
typename M>
323 #endif // GAUDIKERNEL_MAP_H std::pair< iterator, bool > insert(value_type &&val)
const result_type & at(const argument_type &key) const
checked access to the map
Extension of the STL map.
const_iterator end() const
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
static const result_type s_null_value
Map(In &&first, In &&last)
Construct from a subset.
map_type::size_type size_type
size_type erase(const key_type &key)
iterator insert(iterator, ValueType &&val)
const_iterator upper_bound(const key_type &key) const
const mapped_type & operator[](const key_type &key) const
Access elements of a const Map.
void update(const key_type &key, const mapped_type &mapped)
const_iterator lower_bound(const key_type &key) const
std::pair< iterator, bool > insert(ValueType &&val)
mapped_type & operator[](const key_type &key)
iterator erase(const_iterator first, const_iterator last)
const key_type & key_at(const size_type index) const
useful method for python decoration:
iterator upper_bound(const key_type &key)
iterator lower_bound(const key_type &key)
size_type count(const key_type &key) const
iterator find(const key_type &key)
void throw_out_of_range_exception() const
throw std::out_of_range exception
virtual ~Map()=default
Virtual destructor. You can inherit from this map type.
map_type::const_iterator const_iterator
const_iterator find(const key_type &key) const
Map & merge(const Map &other)
Merge two maps.
void insert(In &&first, In &&last)
map_type::iterator iterator
iterator erase(const_iterator pos)
void swap(map_type &other)
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.
std::pair< const K, T > value_type
Map & merge(const Map< K1, K2, K3 > &other)
Merge two maps.
size_type max_size() const
Forward declarations for the functions in SerializeSTL.h.
const_iterator begin() const
Helper base-class to allow the generic Python-decoration for all "map-like" classes in Gaudi.
Map & merge(const map_type &other)
Merge two maps.
const value_type & const_reference
Map()=default
Standard constructor.
std::pair< iterator, bool > emplace(Args &&... args)
std::pair< iterator, iterator > equal_range(const key_type &key)
const result_type & operator()(const argument_type &key) const
Allow to use Map as an unary function.