1 #ifndef GAUDIKERNEL_MAP_H
2 #define GAUDIKERNEL_MAP_H 1
12 #include "GaudiKernel/MapBase.h"
81 template <
typename K,
typename T,
typename M = std::map<K,T> >
82 class Map :
public Gaudi::Utils::MapBase
96 typedef typename map_type::size_type
size_type;
98 typedef typename map_type::iterator
iterator;
120 template <
typename In>
121 Map(In first, In last):
m_map(first,last) {}
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 ; }
182 inline bool empty()
const {
return size() == 0; }
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>
271 inline Map&
merge (
const Map<K1,K2,K3>& other )
273 for (
typename Map<K1,K2,K3>::const_iterator it = other.begin() ;
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 ) ;
319 template <
typename K,
typename T,
typename M>
328 #endif // GAUDIKERNEL_MAP_H