GaudiUtils::Map< K, T, M > Class Template Reference

Extension of the STL map. More...

#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/825/GAUDI/GAUDI_v26r3/InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/Map.h>

Inherits Gaudi::Utils::MapBase, and Gaudi::Utils::MapBase.

Inherited by GaudiUtils::HashMap< K, T, H, M >, GaudiUtils::HashMap< K, T, H, M >, GaudiUtils::HashMap< const void *, EntryType >, GaudiUtils::HashMap< const void *, EntryType >, GaudiUtils::HashMap< Gaudi::StringKey, Leaf >, GaudiUtils::HashMap< Gaudi::StringKey, Leaf >, GaudiUtils::HashMap< Gaudi::StringKey, ListenerList * >, GaudiUtils::HashMap< Gaudi::StringKey, ListenerList * >, GaudiUtils::HashMap< Gaudi::StringKey, Node >, GaudiUtils::HashMap< Gaudi::StringKey, Node >, GaudiUtils::HashMap< long, void * >, GaudiUtils::HashMap< long, void * >, GaudiUtils::HashMap< std::string, Address * >, GaudiUtils::HashMap< std::string, Address * >, GaudiUtils::HashMap< std::string, Bool * >, GaudiUtils::HashMap< std::string, Bool * >, GaudiUtils::HashMap< std::string, Char * >, GaudiUtils::HashMap< std::string, Char * >, GaudiUtils::HashMap< std::string, Double * >, GaudiUtils::HashMap< std::string, Double * >, GaudiUtils::HashMap< std::string, FArray * >, GaudiUtils::HashMap< std::string, FArray * >, GaudiUtils::HashMap< std::string, Float * >, GaudiUtils::HashMap< std::string, Float * >, GaudiUtils::HashMap< std::string, FMatrix * >, GaudiUtils::HashMap< std::string, FMatrix * >, GaudiUtils::HashMap< std::string, Gaudi::Utils::TypeNameString >, GaudiUtils::HashMap< std::string, Gaudi::Utils::TypeNameString >, GaudiUtils::HashMap< std::string, IFileAccess * >, GaudiUtils::HashMap< std::string, IFileAccess * >, GaudiUtils::HashMap< std::string, Int * >, GaudiUtils::HashMap< std::string, Int * >, GaudiUtils::HashMap< std::string, int >, GaudiUtils::HashMap< std::string, int >, GaudiUtils::HashMap< std::string, LongLong * >, GaudiUtils::HashMap< std::string, LongLong * >, GaudiUtils::HashMap< std::string, NameMap >, GaudiUtils::HashMap< std::string, NameMap >, GaudiUtils::HashMap< std::string, NTuple::Item< VALUE > * >, GaudiUtils::HashMap< std::string, NTuple::Item< VALUE > * >, GaudiUtils::HashMap< std::string, Short * >, GaudiUtils::HashMap< std::string, Short * >, GaudiUtils::HashMap< std::string, SmartIF< IAlgorithm > >, GaudiUtils::HashMap< std::string, SmartIF< IAlgorithm > >, GaudiUtils::HashMap< std::string, SmartIF< IService > >, GaudiUtils::HashMap< std::string, SmartIF< IService > >, GaudiUtils::HashMap< std::string, std::string >, GaudiUtils::HashMap< std::string, std::string >, GaudiUtils::HashMap< std::string, UChar * >, GaudiUtils::HashMap< std::string, UChar * >, GaudiUtils::HashMap< std::string, UInt * >, GaudiUtils::HashMap< std::string, UInt * >, GaudiUtils::HashMap< std::string, ULongLong * >, GaudiUtils::HashMap< std::string, ULongLong * >, GaudiUtils::HashMap< std::string, UShort * >, and GaudiUtils::HashMap< std::string, UShort * >.

Collaboration diagram for GaudiUtils::Map< K, T, M >:

Public Types

typedef M map_type
 
typedef K key_type
 
typedef T mapped_type
 
typedef K argument_type
 
typedef T result_type
 
typedef std::pair< const K, T > value_type
 
typedef map_type::size_type size_type
 
typedef map_type::iterator iterator
 
typedef map_type::const_iterator const_iterator
 
typedef M map_type
 
typedef K key_type
 
typedef T mapped_type
 
typedef K argument_type
 
typedef T result_type
 
typedef std::pair< const K, T > value_type
 
typedef map_type::size_type size_type
 
typedef map_type::iterator iterator
 
typedef map_type::const_iterator const_iterator
 

Public Member Functions

 Map ()
 Standard constructor. More...
 
 Map (const map_type &other)
 Constructor from a standard map. More...
 
template<typename In >
 Map (In first, In last)
 Construct from a subset. More...
 
virtual ~Map ()
 Virtual destructor. You can inherit from this map type. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
mapped_typeoperator[] (const key_type &key)
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
size_type count (const key_type &key) const
 
iterator lower_bound (const key_type &key)
 
const_iterator lower_bound (const key_type &key) const
 
iterator upper_bound (const key_type &key)
 
const_iterator upper_bound (const key_type &key) const
 
std::pair< iterator, iteratorequal_range (const key_type &key)
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
std::pair< iterator, bool > insert (const value_type &val)
 
std::pair< iterator, bool > insert (const key_type &key, const mapped_type &val)
 
template<typename In >
void insert (In first, In last)
 
iterator insert (iterator, const value_type &val)
 
void erase (iterator pos)
 
size_type erase (const key_type &key)
 
void erase (iterator first, iterator last)
 
void clear ()
 
size_type size () const
 
size_type max_size () const
 
bool empty () const
 
void swap (map_type &other)
 
const result_typeoperator() (const argument_type &key) const
 Allow to use Map as an unary function. More...
 
const mapped_typeoperator[] (const key_type &key) const
 Access elements of a const Map. More...
 
const result_typeat (const argument_type &key) const
 checked access to the map

Exceptions
std::out_of_rangefor missing keys
More...
 
Mapmerge (const map_type &other)
 Merge two maps. More...
 
Mapmerge (const Map &other)
 Merge two maps. More...
 
template<class K1 , class K2 , class K3 >
Mapmerge (const Map< K1, K2, K3 > &other)
 Merge two maps. More...
 
void update (const key_type &key, const mapped_type &mapped)
 
 operator map_type & ()
 Allows to use the Map wherever an std::map is explicitly requested. More...
 
 operator const map_type & () const
 
const key_typekey_at (const size_type index) const
 useful method for python decoration: More...
 
const mapped_typevalue_at (const size_type index) const
 useful method for python decoration: More...
 
 Map ()
 Standard constructor. More...
 
 Map (const map_type &other)
 Constructor from a standard map. More...
 
template<typename In >
 Map (In first, In last)
 Construct from a subset. More...
 
virtual ~Map ()
 Virtual destructor. You can inherit from this map type. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
mapped_typeoperator[] (const key_type &key)
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
size_type count (const key_type &key) const
 
iterator lower_bound (const key_type &key)
 
const_iterator lower_bound (const key_type &key) const
 
iterator upper_bound (const key_type &key)
 
const_iterator upper_bound (const key_type &key) const
 
std::pair< iterator, iteratorequal_range (const key_type &key)
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
std::pair< iterator, bool > insert (const value_type &val)
 
std::pair< iterator, bool > insert (const key_type &key, const mapped_type &val)
 
template<typename In >
void insert (In first, In last)
 
iterator insert (iterator, const value_type &val)
 
void erase (iterator pos)
 
size_type erase (const key_type &key)
 
void erase (iterator first, iterator last)
 
void clear ()
 
size_type size () const
 
size_type max_size () const
 
bool empty () const
 
void swap (map_type &other)
 
const result_typeoperator() (const argument_type &key) const
 Allow to use Map as an unary function. More...
 
const mapped_typeoperator[] (const key_type &key) const
 Access elements of a const Map. More...
 
const result_typeat (const argument_type &key) const
 checked access to the map

Exceptions
std::out_of_rangefor missing keys
More...
 
Mapmerge (const map_type &other)
 Merge two maps. More...
 
Mapmerge (const Map &other)
 Merge two maps. More...
 
template<class K1 , class K2 , class K3 >
Mapmerge (const Map< K1, K2, K3 > &other)
 Merge two maps. More...
 
void update (const key_type &key, const mapped_type &mapped)
 
 operator map_type & ()
 Allows to use the Map wherever an std::map is explicitly requested. More...
 
 operator const map_type & () const
 
const key_typekey_at (const size_type index) const
 useful method for python decoration: More...
 
const mapped_typevalue_at (const size_type index) const
 useful method for python decoration: More...
 
- Public Member Functions inherited from Gaudi::Utils::MapBase
virtual ~MapBase ()
 virtual destructor More...
 
virtual ~MapBase ()
 virtual destructor More...
 

Protected Attributes

map_type m_map
 

Static Protected Attributes

static const result_type s_null_value = typename Map<K,T,M>::result_type()
 

Additional Inherited Members

- Protected Member Functions inherited from Gaudi::Utils::MapBase
void throw_out_of_range_exception () const
 throw std::out_of_range exception More...
 
void throw_out_of_range_exception () const
 throw std::out_of_range exception More...
 

Detailed Description

template<typename K, typename T, typename M = std::map<K,T>>
class GaudiUtils::Map< K, T, M >

Extension of the STL map.

Provides const accessors and can be extended by inheritance.

See also
std::map Note: in order to make it possible to use either a map or a hash_map, reverse iterators are not defined.

Due to helper base class Gaudi::Utils::MapBase, this class is "python-friendly", and one can perform all python manipulaitons in intuitive way:

>>> m = ... ## get the map
>>> print m ## print the map a'la python class dict
...
>>> for key in m : print key, m[key] ## iteration over the map
...
>>> for key,value in m.iteritems() : print key, value
...
>>> keys = m.keys() ## get the list of keys
>>> values = m.values () ## get the list of values
>> items = m.items () ## get the list of items
>>> if 'one' in m ## check the presence of the key in map
>>> v = m.get(key', None) ## return m[key] for existing key, else None
>>> del m[key] ## erase the key form the map
>>> value m[key] ## unchecked access through the key
...
>>> m.update( key, value ) ## update/insert key/value pair
Attention
The syntax can be drastically simplified, if one redefines the setitem attribute:
>>> type(m).__setitem__ = Gaudi.Utils.MapBase.__setitem__
>>> m[key] = value ## much more intuitive semantics for key insertion

In a similar way __getitem__ and __delitem__ methods can be redefined.

Attention
To avoid the unnesessary expansion of dictionaries it is recommended to exclude from dictionary the following methods:
  • lower_bound
  • upper_bound
  • equal_range
  • insert
Warning
This action is required for HashMap to avodi the compilation problems
See also
Gaudi::Utils::MapBase
Author
Marco Clemencic
Date
2005-10-06

Definition at line 82 of file Map.h.

Member Typedef Documentation

template<typename K, typename T, typename M = std::map<K,T>>
typedef K GaudiUtils::Map< K, T, M >::argument_type

Definition at line 92 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef K GaudiUtils::Map< K, T, M >::argument_type

Definition at line 92 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef map_type::const_iterator GaudiUtils::Map< K, T, M >::const_iterator

Definition at line 99 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef map_type::const_iterator GaudiUtils::Map< K, T, M >::const_iterator

Definition at line 99 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef map_type::iterator GaudiUtils::Map< K, T, M >::iterator

Definition at line 98 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef map_type::iterator GaudiUtils::Map< K, T, M >::iterator

Definition at line 98 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef K GaudiUtils::Map< K, T, M >::key_type

Definition at line 88 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef K GaudiUtils::Map< K, T, M >::key_type

Definition at line 88 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef M GaudiUtils::Map< K, T, M >::map_type

Definition at line 87 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef M GaudiUtils::Map< K, T, M >::map_type

Definition at line 87 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef T GaudiUtils::Map< K, T, M >::mapped_type

Definition at line 89 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef T GaudiUtils::Map< K, T, M >::mapped_type

Definition at line 89 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef T GaudiUtils::Map< K, T, M >::result_type

Definition at line 93 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef T GaudiUtils::Map< K, T, M >::result_type

Definition at line 93 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef map_type::size_type GaudiUtils::Map< K, T, M >::size_type

Definition at line 96 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef map_type::size_type GaudiUtils::Map< K, T, M >::size_type

Definition at line 96 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef std::pair<const K,T> GaudiUtils::Map< K, T, M >::value_type

Definition at line 94 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
typedef std::pair<const K,T> GaudiUtils::Map< K, T, M >::value_type

Definition at line 94 of file Map.h.

Constructor & Destructor Documentation

template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::Map ( )
inline

Standard constructor.

Definition at line 112 of file Map.h.

112 : m_map() {}
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::Map ( const map_type other)
inline

Constructor from a standard map.

Definition at line 115 of file Map.h.

115 : m_map(other) {}
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
template<typename In >
GaudiUtils::Map< K, T, M >::Map ( In  first,
In  last 
)
inline

Construct from a subset.

Definition at line 121 of file Map.h.

121 : m_map(first,last) {}
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
virtual GaudiUtils::Map< K, T, M >::~Map ( )
inlinevirtual

Virtual destructor. You can inherit from this map type.

Definition at line 124 of file Map.h.

124 {}
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::Map ( )
inline

Standard constructor.

Definition at line 112 of file Map.h.

112 : m_map() {}
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::Map ( const map_type other)
inline

Constructor from a standard map.

Definition at line 115 of file Map.h.

115 : m_map(other) {}
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
template<typename In >
GaudiUtils::Map< K, T, M >::Map ( In  first,
In  last 
)
inline

Construct from a subset.

Definition at line 121 of file Map.h.

121 : m_map(first,last) {}
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
virtual GaudiUtils::Map< K, T, M >::~Map ( )
inlinevirtual

Virtual destructor. You can inherit from this map type.

Definition at line 124 of file Map.h.

124 {}

Member Function Documentation

template<typename K, typename T, typename M = std::map<K,T>>
const result_type& GaudiUtils::Map< K, T, M >::at ( const argument_type key) const
inline

checked access to the map

Exceptions
std::out_of_rangefor missing keys

Parameters
key(INPUT) the key
Returns
the value for the existing key

Definition at line 248 of file Map.h.

249  {
250  const_iterator it = m_map.find ( key ) ;
251  if ( it == m_map.end() ) { this->throw_out_of_range_exception () ; }
252  return it->second ;
253  }
map_type m_map
Definition: Map.h:105
map_type::const_iterator const_iterator
Definition: Map.h:99
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:29
template<typename K, typename T, typename M = std::map<K,T>>
const result_type& GaudiUtils::Map< K, T, M >::at ( const argument_type key) const
inline

checked access to the map

Exceptions
std::out_of_rangefor missing keys

Parameters
key(INPUT) the key
Returns
the value for the existing key

Definition at line 248 of file Map.h.

249  {
250  const_iterator it = m_map.find ( key ) ;
251  if ( it == m_map.end() ) { this->throw_out_of_range_exception () ; }
252  return it->second ;
253  }
map_type m_map
Definition: Map.h:105
map_type::const_iterator const_iterator
Definition: Map.h:99
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:29
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::begin ( )
inline

Definition at line 130 of file Map.h.

130 { return m_map.begin(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::begin ( )
inline

Definition at line 130 of file Map.h.

130 { return m_map.begin(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::begin ( ) const
inline

Definition at line 133 of file Map.h.

133 { return m_map.begin(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::begin ( ) const
inline

Definition at line 133 of file Map.h.

133 { return m_map.begin(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::clear ( )
inline

Definition at line 176 of file Map.h.

176 { m_map.clear(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::clear ( )
inline

Definition at line 176 of file Map.h.

176 { m_map.clear(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::count ( const key_type key) const
inline

Definition at line 151 of file Map.h.

151 { return m_map.count(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::count ( const key_type key) const
inline

Definition at line 151 of file Map.h.

151 { return m_map.count(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
bool GaudiUtils::Map< K, T, M >::empty ( ) const
inline

Definition at line 182 of file Map.h.

182 { return size() == 0; }
size_type size() const
Definition: Map.h:180
template<typename K, typename T, typename M = std::map<K,T>>
bool GaudiUtils::Map< K, T, M >::empty ( ) const
inline

Definition at line 182 of file Map.h.

182 { return size() == 0; }
size_type size() const
Definition: Map.h:180
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::end ( )
inline

Definition at line 131 of file Map.h.

131 { return m_map.end(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::end ( )
inline

Definition at line 131 of file Map.h.

131 { return m_map.end(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::end ( ) const
inline

Definition at line 134 of file Map.h.

134 { return m_map.end(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::end ( ) const
inline

Definition at line 134 of file Map.h.

134 { return m_map.end(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<iterator,iterator> GaudiUtils::Map< K, T, M >::equal_range ( const key_type key)
inline

Definition at line 158 of file Map.h.

159  { return m_map.equal_range(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<iterator,iterator> GaudiUtils::Map< K, T, M >::equal_range ( const key_type key)
inline

Definition at line 158 of file Map.h.

159  { return m_map.equal_range(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<const_iterator,const_iterator> GaudiUtils::Map< K, T, M >::equal_range ( const key_type key) const
inline

Definition at line 160 of file Map.h.

161  { return m_map.equal_range(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<const_iterator,const_iterator> GaudiUtils::Map< K, T, M >::equal_range ( const key_type key) const
inline

Definition at line 160 of file Map.h.

161  { return m_map.equal_range(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::erase ( iterator  pos)
inline

Definition at line 173 of file Map.h.

173 { m_map.erase(pos); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::erase ( iterator  pos)
inline

Definition at line 173 of file Map.h.

173 { m_map.erase(pos); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::erase ( const key_type key)
inline

Definition at line 174 of file Map.h.

174 { return m_map.erase(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::erase ( const key_type key)
inline

Definition at line 174 of file Map.h.

174 { return m_map.erase(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 175 of file Map.h.

175 { m_map.erase(first,last); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 175 of file Map.h.

175 { m_map.erase(first,last); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::find ( const key_type key)
inline

Definition at line 148 of file Map.h.

148 { return m_map.find(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::find ( const key_type key)
inline

Definition at line 148 of file Map.h.

148 { return m_map.find(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::find ( const key_type key) const
inline

Definition at line 149 of file Map.h.

149 { return m_map.find(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::find ( const key_type key) const
inline

Definition at line 149 of file Map.h.

149 { return m_map.find(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<iterator,bool> GaudiUtils::Map< K, T, M >::insert ( const value_type val)
inline

Definition at line 165 of file Map.h.

165 { return m_map.insert(val); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<iterator,bool> GaudiUtils::Map< K, T, M >::insert ( const value_type val)
inline

Definition at line 165 of file Map.h.

165 { return m_map.insert(val); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<iterator,bool> GaudiUtils::Map< K, T, M >::insert ( const key_type key,
const mapped_type val 
)
inline

Definition at line 167 of file Map.h.

168  { return insert ( value_type ( key , val ) ) ; }
std::pair< iterator, bool > insert(const value_type &val)
Definition: Map.h:165
std::pair< const K, T > value_type
Definition: Map.h:94
template<typename K, typename T, typename M = std::map<K,T>>
std::pair<iterator,bool> GaudiUtils::Map< K, T, M >::insert ( const key_type key,
const mapped_type val 
)
inline

Definition at line 167 of file Map.h.

168  { return insert ( value_type ( key , val ) ) ; }
std::pair< iterator, bool > insert(const value_type &val)
Definition: Map.h:165
std::pair< const K, T > value_type
Definition: Map.h:94
template<typename K, typename T, typename M = std::map<K,T>>
template<typename In >
void GaudiUtils::Map< K, T, M >::insert ( In  first,
In  last 
)
inline

Definition at line 170 of file Map.h.

170 { m_map.insert(first,last); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
template<typename In >
void GaudiUtils::Map< K, T, M >::insert ( In  first,
In  last 
)
inline

Definition at line 170 of file Map.h.

170 { m_map.insert(first,last); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::insert ( iterator  ,
const value_type val 
)
inline

Definition at line 171 of file Map.h.

172  { return m_map.insert( /* pos, */ val ).first ; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::insert ( iterator  ,
const value_type val 
)
inline

Definition at line 171 of file Map.h.

172  { return m_map.insert( /* pos, */ val ).first ; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const key_type& GaudiUtils::Map< K, T, M >::key_at ( const size_type  index) const
inline

useful method for python decoration:

Parameters
index(INPUT) the index
Returns
the key at given index
Exceptions
std::out_of_rangefor invalid index

Definition at line 295 of file Map.h.

296  {
297  if ( index >= size() )
298  { this->throw_out_of_range_exception () ; }
299  const_iterator it = this->begin() ;
300  std::advance ( it , index ) ;
301  return it -> first ;
302  }
size_type size() const
Definition: Map.h:180
map_type::const_iterator const_iterator
Definition: Map.h:99
iterator begin()
Definition: Map.h:130
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:29
template<typename K, typename T, typename M = std::map<K,T>>
const key_type& GaudiUtils::Map< K, T, M >::key_at ( const size_type  index) const
inline

useful method for python decoration:

Parameters
index(INPUT) the index
Returns
the key at given index
Exceptions
std::out_of_rangefor invalid index

Definition at line 295 of file Map.h.

296  {
297  if ( index >= size() )
298  { this->throw_out_of_range_exception () ; }
299  const_iterator it = this->begin() ;
300  std::advance ( it , index ) ;
301  return it -> first ;
302  }
size_type size() const
Definition: Map.h:180
map_type::const_iterator const_iterator
Definition: Map.h:99
iterator begin()
Definition: Map.h:130
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:29
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::lower_bound ( const key_type key)
inline

Definition at line 153 of file Map.h.

153 { return m_map.lower_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::lower_bound ( const key_type key)
inline

Definition at line 153 of file Map.h.

153 { return m_map.lower_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::lower_bound ( const key_type key) const
inline

Definition at line 154 of file Map.h.

154 { return m_map.lower_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::lower_bound ( const key_type key) const
inline

Definition at line 154 of file Map.h.

154 { return m_map.lower_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::max_size ( ) const
inline

Definition at line 181 of file Map.h.

181 { return m_map.max_size(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::max_size ( ) const
inline

Definition at line 181 of file Map.h.

181 { return m_map.max_size(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
Map& GaudiUtils::Map< K, T, M >::merge ( const map_type other)
inline

Merge two maps.

Definition at line 256 of file Map.h.

257  {
258  for ( typename map_type::const_iterator it = other.begin() ;
259  other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
260  return *this;
261  }
template<typename K, typename T, typename M = std::map<K,T>>
Map& GaudiUtils::Map< K, T, M >::merge ( const map_type other)
inline

Merge two maps.

Definition at line 256 of file Map.h.

257  {
258  for ( typename map_type::const_iterator it = other.begin() ;
259  other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
260  return *this;
261  }
template<typename K, typename T, typename M = std::map<K,T>>
Map& GaudiUtils::Map< K, T, M >::merge ( const Map< K, T, M > &  other)
inline

Merge two maps.

Definition at line 263 of file Map.h.

264  {
265  for ( const_iterator it = other.begin() ;
266  other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
267  return *this;
268  }
map_type::const_iterator const_iterator
Definition: Map.h:99
template<typename K, typename T, typename M = std::map<K,T>>
Map& GaudiUtils::Map< K, T, M >::merge ( const Map< K, T, M > &  other)
inline

Merge two maps.

Definition at line 263 of file Map.h.

264  {
265  for ( const_iterator it = other.begin() ;
266  other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
267  return *this;
268  }
map_type::const_iterator const_iterator
Definition: Map.h:99
template<typename K, typename T, typename M = std::map<K,T>>
template<class K1 , class K2 , class K3 >
Map& GaudiUtils::Map< K, T, M >::merge ( const Map< K1, K2, K3 > &  other)
inline

Merge two maps.

Definition at line 271 of file Map.h.

272  {
273  for ( typename Map<K1,K2,K3>::const_iterator it = other.begin() ;
274  other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
275  return *this;
276  }
template<typename K, typename T, typename M = std::map<K,T>>
template<class K1 , class K2 , class K3 >
Map& GaudiUtils::Map< K, T, M >::merge ( const Map< K1, K2, K3 > &  other)
inline

Merge two maps.

Definition at line 271 of file Map.h.

272  {
273  for ( typename Map<K1,K2,K3>::const_iterator it = other.begin() ;
274  other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
275  return *this;
276  }
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::operator const map_type & ( ) const
inline

Definition at line 286 of file Map.h.

286 { return m_map ; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::operator const map_type & ( ) const
inline

Definition at line 286 of file Map.h.

286 { return m_map ; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::operator map_type & ( )
inline

Allows to use the Map wherever an std::map is explicitly requested.

Definition at line 285 of file Map.h.

285 { return m_map ; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
GaudiUtils::Map< K, T, M >::operator map_type & ( )
inline

Allows to use the Map wherever an std::map is explicitly requested.

Definition at line 285 of file Map.h.

285 { return m_map ; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const result_type& GaudiUtils::Map< K, T, M >::operator() ( const argument_type key) const
inline

Allow to use Map as an unary function.

There is no automatic extension of the map for missing keys!

Attention
The behaviour is different from std::map
// OK:
KEY key = ... ;
std::cout << " Value: " << m(key) << std::end ; // it is OK!
// ERROR:
VALUE value = ... ;
m(key) = value ; // ERROR!
Parameters
keythe key
Returns
the mapped value(const reference!) for the existing key, and the default value overwise

return the default value

Definition at line 209 of file Map.h.

210  {
211  // static const result_type s_null_value;
212  const_iterator it = m_map.find(key);
213  if ( it != m_map.end() ) { return it->second ; }
215  return s_null_value; // return the default value
216  }
static const result_type s_null_value
Definition: Map.h:106
map_type m_map
Definition: Map.h:105
map_type::const_iterator const_iterator
Definition: Map.h:99
template<typename K, typename T, typename M = std::map<K,T>>
const result_type& GaudiUtils::Map< K, T, M >::operator() ( const argument_type key) const
inline

Allow to use Map as an unary function.

There is no automatic extension of the map for missing keys!

Attention
The behaviour is different from std::map
// OK:
KEY key = ... ;
std::cout << " Value: " << m(key) << std::end ; // it is OK!
// ERROR:
VALUE value = ... ;
m(key) = value ; // ERROR!
Parameters
keythe key
Returns
the mapped value(const reference!) for the existing key, and the default value overwise

return the default value

Definition at line 209 of file Map.h.

210  {
211  // static const result_type s_null_value;
212  const_iterator it = m_map.find(key);
213  if ( it != m_map.end() ) { return it->second ; }
215  return s_null_value; // return the default value
216  }
static const result_type s_null_value
Definition: Map.h:106
map_type m_map
Definition: Map.h:105
map_type::const_iterator const_iterator
Definition: Map.h:99
template<typename K, typename T, typename M = std::map<K,T>>
mapped_type& GaudiUtils::Map< K, T, M >::operator[] ( const key_type key)
inline

Definition at line 144 of file Map.h.

144 { return m_map[key]; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
mapped_type& GaudiUtils::Map< K, T, M >::operator[] ( const key_type key)
inline

Definition at line 144 of file Map.h.

144 { return m_map[key]; }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const mapped_type& GaudiUtils::Map< K, T, M >::operator[] ( const key_type key) const
inline

Access elements of a const Map.

There is no automatic extension of the map for missing keys!

Attention
The behaviour is different from std::map
// OK:
KEY key = ... ;
std::cout << " Value: " << m[key] << std::end ; // it is OK!
// ERROR:
VALUE value = ... ;
m[key] = value ; // ERROR!
Parameters
keythe key
Returns
the mapped value(const reference!) for the existing key, and the default value overwise

Definition at line 240 of file Map.h.

241  { return (*this)(key); }
template<typename K, typename T, typename M = std::map<K,T>>
const mapped_type& GaudiUtils::Map< K, T, M >::operator[] ( const key_type key) const
inline

Access elements of a const Map.

There is no automatic extension of the map for missing keys!

Attention
The behaviour is different from std::map
// OK:
KEY key = ... ;
std::cout << " Value: " << m[key] << std::end ; // it is OK!
// ERROR:
VALUE value = ... ;
m[key] = value ; // ERROR!
Parameters
keythe key
Returns
the mapped value(const reference!) for the existing key, and the default value overwise

Definition at line 240 of file Map.h.

241  { return (*this)(key); }
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::size ( ) const
inline

Definition at line 180 of file Map.h.

180 { return m_map.size(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
size_type GaudiUtils::Map< K, T, M >::size ( ) const
inline

Definition at line 180 of file Map.h.

180 { return m_map.size(); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::swap ( map_type other)
inline

Definition at line 183 of file Map.h.

183 { m_map.swap(other); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::swap ( map_type other)
inline

Definition at line 183 of file Map.h.

183 { m_map.swap(other); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::update ( const key_type key,
const mapped_type mapped 
)
inline

Definition at line 279 of file Map.h.

280  { (*this)[ key ] = mapped ; }
template<typename K, typename T, typename M = std::map<K,T>>
void GaudiUtils::Map< K, T, M >::update ( const key_type key,
const mapped_type mapped 
)
inline

Definition at line 279 of file Map.h.

280  { (*this)[ key ] = mapped ; }
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::upper_bound ( const key_type key)
inline

Definition at line 155 of file Map.h.

155 { return m_map.upper_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
iterator GaudiUtils::Map< K, T, M >::upper_bound ( const key_type key)
inline

Definition at line 155 of file Map.h.

155 { return m_map.upper_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::upper_bound ( const key_type key) const
inline

Definition at line 156 of file Map.h.

156 { return m_map.upper_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const_iterator GaudiUtils::Map< K, T, M >::upper_bound ( const key_type key) const
inline

Definition at line 156 of file Map.h.

156 { return m_map.upper_bound(key); }
map_type m_map
Definition: Map.h:105
template<typename K, typename T, typename M = std::map<K,T>>
const mapped_type& GaudiUtils::Map< K, T, M >::value_at ( const size_type  index) const
inline

useful method for python decoration:

Parameters
index(INPUT) the index
Returns
the value at given index
Exceptions
std::out_of_rangefor invalid index

Definition at line 308 of file Map.h.

309  {
310  if ( index >= size() )
311  { this->throw_out_of_range_exception () ; }
312  const_iterator it = this->begin() ;
313  std::advance ( it , index ) ;
314  return it -> second ;
315  }
size_type size() const
Definition: Map.h:180
constexpr double second
map_type::const_iterator const_iterator
Definition: Map.h:99
iterator begin()
Definition: Map.h:130
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:29
template<typename K, typename T, typename M = std::map<K,T>>
const mapped_type& GaudiUtils::Map< K, T, M >::value_at ( const size_type  index) const
inline

useful method for python decoration:

Parameters
index(INPUT) the index
Returns
the value at given index
Exceptions
std::out_of_rangefor invalid index

Definition at line 308 of file Map.h.

309  {
310  if ( index >= size() )
311  { this->throw_out_of_range_exception () ; }
312  const_iterator it = this->begin() ;
313  std::advance ( it , index ) ;
314  return it -> second ;
315  }
size_type size() const
Definition: Map.h:180
constexpr double second
map_type::const_iterator const_iterator
Definition: Map.h:99
iterator begin()
Definition: Map.h:130
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:29

Member Data Documentation

template<typename K, typename T, typename M = std::map<K,T>>
map_type GaudiUtils::Map< K, T, M >::m_map
protected

Definition at line 105 of file Map.h.

template<typename K, typename T, typename M = std::map<K,T>>
const Map< K, T, M >::result_type GaudiUtils::Map< K, T, M >::s_null_value = typename Map<K,T,M>::result_type()
staticprotected

Definition at line 106 of file Map.h.


The documentation for this class was generated from the following file: