1 #ifndef GAUDIKERNEL_MAP_H
2 #define GAUDIKERNEL_MAP_H 1
81 template <
typename K,
typename T,
typename M = std::map<K,T> >
120 template <
typename In>
159 {
return m_map.equal_range(key); }
161 {
return m_map.equal_range(key); }
166 inline std::pair<iterator,bool>
insert
169 template <
typename In>
170 inline void insert(In first, In last) {
m_map.insert(first,last); }
172 {
return m_map.insert( val ).first ; }
213 if ( it !=
m_map.end() ) {
return it->second ; }
241 {
return (*
this)(key); }
258 for (
typename map_type::const_iterator it = other.begin() ;
259 other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
266 other.
end() != it ; ++it ) { (*this)[it->first] = it->second ; }
270 template <
class K1,
class K2,
class K3>
274 other.
end() != it ; ++it ) { (*this)[it->first] = it->second ; }
280 const mapped_type& mapped ) { (*this)[ key ] = mapped ; }
297 if ( index >=
size() )
300 std::advance ( it , index ) ;
310 if ( index >=
size() )
313 std::advance ( it , index ) ;
314 return it -> second ;
319 template <
typename K,
typename T,
typename M>
328 #endif // GAUDIKERNEL_MAP_H
Map()
Standard constructor.
Extension of the STL map.
std::pair< const_iterator, const_iterator > equal_range(const key_type &key) const
const_iterator end() const
void erase(iterator first, iterator last)
static const result_type s_null_value
virtual ~Map()
Virtual destructor. You can inherit from this map type.
size_type count(const key_type &key) const
const result_type & at(const argument_type &key) const
checked access to the map for missing keys
map_type::size_type size_type
size_type erase(const key_type &key)
void insert(In first, In last)
void update(const key_type &key, const mapped_type &mapped)
std::pair< iterator, iterator > equal_range(const key_type &key)
const_iterator find(const key_type &key) const
std::pair< iterator, bool > insert(const value_type &val)
const_iterator lower_bound(const key_type &key) const
mapped_type & operator[](const key_type &key)
iterator upper_bound(const key_type &key)
const result_type & operator()(const argument_type &key) const
Allow to use Map as an unary function.
std::pair< const K, T > value_type
iterator lower_bound(const key_type &key)
iterator find(const key_type &key)
const mapped_type & value_at(const size_type index) const
useful method for python decoration:
map_type::const_iterator const_iterator
Map & merge(const Map &other)
Merge two maps.
Map(In first, In last)
Construct from a subset.
map_type::iterator iterator
iterator insert(iterator, const value_type &val)
void swap(map_type &other)
const key_type & key_at(const size_type index) const
useful method for python decoration:
const_iterator begin() const
Map(const map_type &other)
Constructor from a standard map.
const_iterator upper_bound(const key_type &key) const
Map & merge(const Map< K1, K2, K3 > &other)
Merge two maps.
void throw_out_of_range_exception() const
throw std::out_of_range exception
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.
size_type max_size() const