The Gaudi Framework  master (37c0b60a)
VectorMap.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // ============================================================================
12 #ifndef GAUDIKERNEL_VECTORMAP_H
13 #define GAUDIKERNEL_VECTORMAP_H 1
14 // ============================================================================
15 // Include files
16 // ============================================================================
17 // STD & STL
18 // ============================================================================
19 #include <algorithm>
20 #include <functional>
21 #include <initializer_list>
22 #include <ostream>
23 #include <utility>
24 #include <vector>
25 // ============================================================================
26 // GaudiKernel
27 // ============================================================================
28 #include <GaudiKernel/MapBase.h>
29 
30 // For parsers
31 #include <GaudiKernel/StatusCode.h>
32 #include <GaudiKernel/StringKey.h>
33 // ============================================================================
34 namespace GaudiUtils {
35  // ==========================================================================
110  template <class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>,
111  class ALLOCATOR = std::allocator<std::pair<KEY, VALUE>>>
113  public:
114  // ========================================================================
116  typedef KEY key_type;
118  typedef VALUE mapped_type;
120  typedef KEYCOMPARE key_compare;
123  // ========================================================================
124  public:
125  // ========================================================================
127  typedef ALLOCATOR allocator_type;
129  typedef typename ALLOCATOR::value_type const& reference;
131  typedef typename ALLOCATOR::value_type const& const_reference;
133  typedef typename ALLOCATOR::size_type size_type;
135  typedef typename ALLOCATOR::difference_type difference_type;
136  // ========================================================================
137  public:
138  // ========================================================================
141  // ========================================================================
142  protected:
143  // ========================================================================
145  typedef typename _vector::iterator _iterator;
146  // ========================================================================
147  public:
148  // ========================================================================
150  typedef typename _vector::const_iterator iterator;
152  typedef typename _vector::const_iterator const_iterator;
161  // ========================================================================
162  public:
163  // ========================================================================
168  struct _compare_type : public key_compare {
169  public:
170  // ======================================================================
172  _compare_type( const key_compare& cmp ) : key_compare( cmp ) {}
176  bool operator()( const key_type& k1, const key_type& k2 ) const {
177  return this->key_compare::operator()( k1, k2 );
178  }
180  bool operator()( const value_type& v1, const value_type& v2 ) const { return operator()( v1.first, v2.first ); }
182  bool operator()( const key_type& k, const value_type& v ) const { return operator()( k, v.first ); }
184  bool operator()( const value_type& v, const key_type& k ) const { return operator()( v.first, k ); }
185  // ======================================================================
186  };
187  // ========================================================================
189  typedef _compare_type compare_type;
190  // ========================================================================
191  public:
192  // ========================================================================
193  // sequential access (only const-versions!)
194  // ========================================================================
196  iterator begin() const { return m_vct.begin(); }
198  iterator end() const { return m_vct.end(); }
200  reverse_iterator rbegin() const { return m_vct.rbegin(); }
202  reverse_iterator rend() const { return m_vct.rend(); }
203  // ========================================================================
204  // list operations : erase & insert
205  // ========================================================================
209  void erase( iterator pos ) { m_vct.erase( iter( pos ) ); }
210  // ========================================================================
228  iterator pos = find( key );
229  if ( end() == pos ) { return 0; }
230  erase( pos );
231  return 1;
232  }
233  // ========================================================================
239  size_type erase( iterator first, iterator last ) {
240  m_vct.erase( iter( first ), iter( last ) );
241  return last - first;
242  }
243  // ========================================================================
264  template <class TYPE>
265  size_type erase( TYPE first, TYPE last ) {
266  size_type res = 0;
267  for ( ; first != last; ++first ) { res += erase( *first ); }
268  return res;
269  }
270  // ========================================================================
312  result_type insert( const key_type& key, const mapped_type& mapped ) { return insert( value_type( key, mapped ) ); }
313  // ========================================================================
354  result_type insert( const value_type& value ) {
355  bool found = true;
356  _iterator result = lower_bound( value.first );
357  if ( end() == result || compare( value.first, result->first ) ) {
358  result = m_vct.insert( result, value );
359  found = false;
360  }
361  return result_type( iter( result ), !found );
362  }
363  // ========================================================================
372  result_type insert( iterator pos, const value_type& value ) {
373  if ( pos != end() && compare( *pos, value ) &&
374  ( pos == end() - 1 || ( !compare( value, *( pos + 1 ) ) && compare( *( pos + 1 ), value ) ) ) ) {
375  return result_type( m_vct.insert( iter( pos ), value ), true );
376  }
377  return insert( value );
378  }
379  // ========================================================================
389  result_type insert( iterator pos, const key_type& key, const mapped_type& mapped ) {
390  return insert( pos, value_type( key, mapped ) );
391  }
392  // ========================================================================
398  template <class PAIRS>
399  void insert( PAIRS first, PAIRS last ) {
400  for ( ; first != last; ++first ) { insert( *first ); }
401  }
402  // ========================================================================
410  template <class KEYS, class VALUES>
411  void insert( KEYS kf, KEYS kl, VALUES vf ) {
412  for ( ; kf != kl; ++kf, ++vf ) { insert( *kf, *vf ); }
413  }
414  // ========================================================================
415  // map operations: lookup, count, ...
416  // ========================================================================
440  iterator find( const key_type& key ) const {
441  iterator res = lower_bound( key );
442  if ( end() != res && compare( key, res->first ) ) { res = end(); }
443  return res;
444  }
445  // ========================================================================
461  size_type count( const key_type& key ) const { return end() == find( key ) ? 0 : 1; }
462  // ========================================================================
463  iterator lower_bound( const key_type& key ) const { return std::lower_bound( begin(), end(), key, compare() ); }
464  iterator upper_bound( const key_type& key ) const { return std::upper_bound( begin(), end(), key, compare() ); }
465  iterators equal_range( const key_type& key ) const { return std::equal_range( begin(), end(), key, compare() ); }
466  // ========================================================================
467  // general container operations :
468  // ========================================================================
470  bool empty() const { return m_vct.empty(); }
472  size_type size() const { return m_vct.size(); }
474  size_type max_size() const { return m_vct.max_size(); }
476  void clear() { m_vct.clear(); }
478  void reserve( size_type num ) { m_vct.reserve( num ); }
479  // ========================================================================
481  void swap( VectorMap& other ) { std::swap( m_vct, other.m_vct ); }
482  // ========================================================================
483  // The basic comparison operators for container
484  // ========================================================================
486  bool operator==( const VectorMap& other ) const { return m_vct == other.m_vct; }
488  bool operator<( const VectorMap& other ) const { return m_vct < other.m_vct; }
489  // ========================================================================
490  // The derived comparison operators for container
491  // ========================================================================
492  friend bool operator>( const VectorMap& left, const VectorMap& right ) { return right < left; }
493  friend bool operator!=( const VectorMap& left, const VectorMap& right ) { return !( left == right ); }
494  friend bool operator>=( const VectorMap& left, const VectorMap& right ) { return !( left < right ); }
495  friend bool operator<=( const VectorMap& left, const VectorMap& right ) { return !( right < left ); }
496  // ========================================================================
526  bool update( const key_type& key, const mapped_type& mapped ) {
527  _iterator result = lower_bound( key );
528  if ( end() == result || compare( key, result->first ) ) {
529  result = m_vct.insert( result, value_type( key, mapped ) );
530  return false;
531  } else {
532  result->second = mapped;
533  }
534  //
535  return true;
536  }
537  // ========================================================================
566  bool update( const value_type& val ) { return update( val.first, val.second ); }
567  // ========================================================================
599  const mapped_type& operator()( const key_type& key ) const {
600  static const mapped_type s_default = mapped_type();
601  iterator res = find( key );
602  if ( end() == res ) { return s_default; }
603  return res->second;
604  }
605  // ========================================================================
636  const mapped_type& operator[]( const key_type& key ) const { return ( *this )( key ); }
637  // ========================================================================
655  const mapped_type& at( const key_type& key ) const {
656  iterator res = find( key );
657  if ( end() == res ) this->throw_out_of_range_exception();
658  return res->second; // cppcheck-suppress derefInvalidIteratorRedundantCheck; the above throws
659  }
660  // ========================================================================
661  public:
662  // ========================================================================
663  // Constructors, destructors, etc.
664  // ========================================================================
669  VectorMap( const allocator_type& alloc = allocator_type() ) : m_vct( alloc ) {}
670  // ========================================================================
677  template <class INPUT>
678  VectorMap( INPUT first, INPUT last, const allocator_type& alloc = allocator_type() ) : m_vct( first, last, alloc ) {
679  std::sort( m_vct.begin(), m_vct.end(), compare() );
680  }
681  // ========================================================================
688  : m_vct( first, alloc ) {
689  std::sort( m_vct.begin(), m_vct.end(), compare() );
690  }
691  // ========================================================================
692  public:
693  // ========================================================================
694  // The specific public accessors
695  // ========================================================================
697  const compare_type& compare() const {
698  static const compare_type s_cmp = compare_type();
699  return s_cmp;
700  }
702  const key_compare& compare_key() const { return compare(); }
704  friend std::ostream& operator<<( std::ostream& str, const VectorMap& /* obj */ ) { return str; }
705  // ========================================================================
706  public:
707  // ========================================================================
709  inline VectorMap& merge( const VectorMap& right ) {
710  for ( const auto& i : right ) { update( i.first, i.second ); }
711  return *this;
712  }
714  template <class K1, class K2, class K3, class K4>
715  inline VectorMap& merge( const VectorMap<K1, K2, K3, K4>& right ) {
716  for ( const auto& i : right ) { update( i.first, i.second ); }
717  return *this;
718  }
719  // ========================================================================
720  public:
721  // ========================================================================
727  const key_type& key_at( const size_t index ) const {
728  if ( index >= size() ) { this->throw_out_of_range_exception(); }
729  auto it = this->begin();
730  std::advance( it, index );
731  return it->first;
732  }
738  const mapped_type& value_at( const size_t index ) const {
739  if ( index >= size() ) { this->throw_out_of_range_exception(); }
740  auto it = this->begin();
741  std::advance( it, index );
742  return it->second;
743  }
744  // ========================================================================
745  protected:
746  // ========================================================================
747  // Pure technical helper functions
748  // ========================================================================
754  template <class TYPE1, class TYPE2>
755  bool compare( const TYPE1& obj1, const TYPE2& obj2 ) const {
756  return compare()( obj1, obj2 );
757  }
758  // ========================================================================
761  return std::lower_bound( m_vct.begin(), m_vct.end(), key, compare() );
762  }
763  // ========================================================================
766  auto result = m_vct.begin();
767  std::advance( result, std::distance( begin(), p ) );
768  return result;
769  }
770  // ========================================================================
773  auto result = begin();
774  std::advance( result, std::distance( m_vct.begin(), p ) );
775  return result;
776  }
777  // ========================================================================
778  private:
779  // ========================================================================
781  _vector m_vct; // the underlying sorted vector of (key,mapped) pairs
782  // ========================================================================
783  };
784  // ==========================================================================
785 } // end of namespace GaudiUtils
786 // ============================================================================
787 namespace std {
788  // ==========================================================================
793  template <class KEY, class VALUE, class KEYCOMPARE, class ALLOCATOR>
796  left.swap( right );
797  }
798  // ===========================================================================
799 } // end of namespace std
800 // ============================================================================
801 // ============================================================================
802 namespace Gaudi {
803  // ==========================================================================
804  namespace Parsers {
805  // ========================================================================
815  GAUDI_API StatusCode parse( GaudiUtils::VectorMap<std::string, double>& result, std::string_view input );
816  // ========================================================================
828  // ========================================================================
829  } // namespace Parsers
830  // ==========================================================================
831 } // end of namespace Gaudi
832 
833 // ============================================================================
834 // The END
835 // ============================================================================
836 #endif // GAUDIKERNEL_MAPS_H
GaudiUtils::VectorMap::_vector
std::vector< value_type, allocator_type > _vector
the actual storage container (no export)
Definition: VectorMap.h:140
GaudiUtils::VectorMap::value_at
const mapped_type & value_at(const size_t index) const
useful method for python decoration:
Definition: VectorMap.h:738
GaudiUtils::VectorMap::size_type
ALLOCATOR::size_type size_type
the types to conform STL
Definition: VectorMap.h:133
GaudiUtils::VectorMap::erase
size_type erase(iterator first, iterator last)
erase the sequence of elements using the iterators
Definition: VectorMap.h:239
GaudiUtils::VectorMap::result_type
std::pair< iterator, bool > result_type
visible iterator pait
Definition: VectorMap.h:160
GaudiUtils::VectorMap::compare_key
const key_compare & compare_key() const
get the comparison criteria for keys
Definition: VectorMap.h:702
GaudiUtils::VectorMap::allocator_type
ALLOCATOR allocator_type
allocator (could be useful for optimizations)
Definition: VectorMap.h:127
GaudiUtils::VectorMap::count
size_type count(const key_type &key) const
count number of elements with the certain key
Definition: VectorMap.h:461
GaudiUtils::VectorMap::at
const mapped_type & at(const key_type &key) const
checked access to elements by key throw std::out_of_range exception for non-existing keys
Definition: VectorMap.h:655
GaudiPartProp.tests.v1
v1
Definition: tests.py:39
GaudiUtils::VectorMap::merge
VectorMap & merge(const VectorMap &right)
merge two maps
Definition: VectorMap.h:709
GaudiUtils::VectorMap::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
visible reverse const_iterator (exported)
Definition: VectorMap.h:154
std::pair
std::vector::reserve
T reserve(T... args)
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:21
std::vector< value_type, allocator_type >
GaudiUtils::VectorMap::difference_type
ALLOCATOR::difference_type difference_type
the types to conform STL
Definition: VectorMap.h:135
std::vector::size
T size(T... args)
GaudiUtils::VectorMap::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
visible reverse const_iterator (exported)
Definition: VectorMap.h:156
GaudiUtils::VectorMap::m_vct
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:781
GaudiUtils::VectorMap
Definition: VectorMap.h:112
GaudiUtils::VectorMap::equal_range
iterators equal_range(const key_type &key) const
Definition: VectorMap.h:465
GaudiUtils::VectorMap::erase
size_type erase(TYPE first, TYPE last)
erase the sequence of elements using the sequence of keys
Definition: VectorMap.h:265
GaudiUtils::VectorMap::_compare_type::operator()
bool operator()(const key_type &k1, const key_type &k2) const
compare keys: use key_compare
Definition: VectorMap.h:176
GaudiUtils::VectorMap::operator!=
friend bool operator!=(const VectorMap &left, const VectorMap &right)
Definition: VectorMap.h:493
StringKey.h
GaudiUtils::VectorMap::rbegin
reverse_iterator rbegin() const
"rbegin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:200
std::distance
T distance(T... args)
GaudiUtils::VectorMap::update
bool update(const key_type &key, const mapped_type &mapped)
forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the exist...
Definition: VectorMap.h:526
GaudiUtils::VectorMap::max_size
size_type max_size() const
maximal allowed size
Definition: VectorMap.h:474
std::less
StatusCode.h
std::sort
T sort(T... args)
GaudiUtils::VectorMap::begin
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:196
GaudiUtils::VectorMap::iter
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:765
std::vector::clear
T clear(T... args)
GaudiUtils::VectorMap::const_iterator
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:152
GaudiUtils::VectorMap::clear
void clear()
clear the container
Definition: VectorMap.h:476
GaudiUtils::VectorMap::merge
VectorMap & merge(const VectorMap< K1, K2, K3, K4 > &right)
merge two maps
Definition: VectorMap.h:715
GaudiUtils::VectorMap::key_type
KEY key_type
the actual type of key
Definition: VectorMap.h:116
GaudiUtils::VectorMap::_compare_type::operator()
bool operator()(const key_type &k, const value_type &v) const
compare key and pair (key,mapped): use compare by keys
Definition: VectorMap.h:182
GaudiUtils::VectorMap::operator<=
friend bool operator<=(const VectorMap &left, const VectorMap &right)
Definition: VectorMap.h:495
GaudiUtils::VectorMap::compare
bool compare(const TYPE1 &obj1, const TYPE2 &obj2) const
compare the objects using the comaprison criteria
Definition: VectorMap.h:755
GaudiUtils::VectorMap::lower_bound
_iterator lower_bound(const key_type &key)
'lower-bound' - non-const version
Definition: VectorMap.h:760
GaudiUtils::VectorMap::_compare_type::operator()
bool operator()(const value_type &v1, const value_type &v2) const
compare pairs (key,mapped): use compare by keys
Definition: VectorMap.h:180
GaudiUtils::VectorMap::compare_type
_compare_type compare_type
the actual comparison criteria for valye_type objects
Definition: VectorMap.h:189
GaudiUtils::VectorMap::insert
void insert(KEYS kf, KEYS kl, VALUES vf)
insert into the container the elements from 2 "parallel" sequences
Definition: VectorMap.h:411
GaudiUtils::VectorMap::mapped_type
VALUE mapped_type
the actual type of value
Definition: VectorMap.h:118
GaudiUtils::VectorMap::lower_bound
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:463
StatusCode
Definition: StatusCode.h:65
std::ostream
STL class.
GaudiUtils::VectorMap::key_at
const key_type & key_at(const size_t index) const
useful method for python decoration:
Definition: VectorMap.h:727
GaudiUtils::VectorMap::operator<
bool operator<(const VectorMap &other) const
comparison criteria for containers
Definition: VectorMap.h:488
GaudiPartProp.tests.v2
v2
Definition: tests.py:59
GaudiUtils::VectorMap::value_type
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:122
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:198
GaudiUtils::VectorMap::upper_bound
iterator upper_bound(const key_type &key) const
Definition: VectorMap.h:464
std::vector::erase
T erase(T... args)
GaudiUtils::VectorMap::iterators
std::pair< iterator, iterator > iterators
visible iterator pait
Definition: VectorMap.h:158
GaudiUtils::VectorMap::_compare_type::_compare_type
_compare_type()
default constructor
Definition: VectorMap.h:174
GaudiUtils::VectorMap::insert
void insert(PAIRS first, PAIRS last)
insert the sequence of elements into the container
Definition: VectorMap.h:399
GaudiUtils::VectorMap::operator<<
friend std::ostream & operator<<(std::ostream &str, const VectorMap &)
printout to ostream - not implemented
Definition: VectorMap.h:704
GaudiUtils::VectorMap::size
size_type size() const
number of elements
Definition: VectorMap.h:472
GaudiUtils::VectorMap::insert
result_type insert(iterator pos, const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container With the right guess the method could be more efficien...
Definition: VectorMap.h:389
GaudiUtils::VectorMap::insert
result_type insert(const value_type &value)
insert the (key,value) pair into the container
Definition: VectorMap.h:354
std::vector::max_size
T max_size(T... args)
std::upper_bound
T upper_bound(T... args)
GaudiUtils::VectorMap::operator>=
friend bool operator>=(const VectorMap &left, const VectorMap &right)
Definition: VectorMap.h:494
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
GaudiUtils::VectorMap::key_compare
KEYCOMPARE key_compare
comparison of keys
Definition: VectorMap.h:120
std::advance
T advance(T... args)
std::vector::rend
T rend(T... args)
std::swap
T swap(T... args)
GaudiUtils::VectorMap::iter
iterator iter(_iterator p)
the conversion from 'non-const' to 'const' iterator
Definition: VectorMap.h:772
GaudiUtils::VectorMap::empty
bool empty() const
empty container ?
Definition: VectorMap.h:470
std::equal_range
T equal_range(T... args)
GaudiUtils::VectorMap::operator()
const mapped_type & operator()(const key_type &key) const
access to element by key (const version) there is no container increment for missing keys
Definition: VectorMap.h:599
GaudiUtils::VectorMap::_compare_type::_compare_type
_compare_type(const key_compare &cmp)
constructor from the key-comparison criteria
Definition: VectorMap.h:172
GaudiUtils::VectorMap::reserve
void reserve(size_type num)
reserve the space in the container for at least 'num' elements
Definition: VectorMap.h:478
std::lower_bound
T lower_bound(T... args)
GaudiUtils::VectorMap::compare
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:697
GaudiUtils::VectorMap::operator>
friend bool operator>(const VectorMap &left, const VectorMap &right)
Definition: VectorMap.h:492
GaudiUtils::VectorMap::_compare_type
Definition: VectorMap.h:168
std::left
T left(T... args)
GaudiUtils::VectorMap::_iterator
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:145
GaudiUtils::VectorMap::VectorMap
VectorMap(std::initializer_list< value_type > first, const allocator_type &alloc=allocator_type())
tconstructor from initializer list
Definition: VectorMap.h:687
std::vector::begin
T begin(T... args)
std
STL namespace.
std::vector::insert
T insert(T... args)
Gaudi::Utils::MapBase
Definition: MapBase.h:52
GaudiUtils::VectorMap::swap
void swap(VectorMap &other)
swap function, which 'swaps' the content of two containers
Definition: VectorMap.h:481
GaudiUtils::VectorMap::insert
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:312
GaudiUtils::VectorMap::operator==
bool operator==(const VectorMap &other) const
comparison criteria for containers
Definition: VectorMap.h:486
GaudiUtils::VectorMap::_compare_type::operator()
bool operator()(const value_type &v, const key_type &k) const
compare pair (key,mapped) and the key: use compare by keys
Definition: VectorMap.h:184
std::vector::empty
T empty(T... args)
Properties.v
v
Definition: Properties.py:122
std::allocator
STL class.
GaudiUtils::VectorMap::insert
result_type insert(iterator pos, const value_type &value)
insert the element with some guess about its new position With the right guess the method could be mo...
Definition: VectorMap.h:372
MapBase.h
Gaudi::Utils::MapBase::throw_out_of_range_exception
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:38
GaudiUtils::VectorMap::const_reference
ALLOCATOR::value_type const & const_reference
the types to conform STL
Definition: VectorMap.h:131
std::vector::end
T end(T... args)
std::reverse_iterator
GaudiUtils::VectorMap::reference
ALLOCATOR::value_type const & reference
the types to conform STL
Definition: VectorMap.h:129
GaudiUtils
Definition: Allocator.h:72
GaudiUtils::VectorMap::VectorMap
VectorMap(const allocator_type &alloc=allocator_type())
default constructor from the the allocator
Definition: VectorMap.h:669
GaudiUtils::VectorMap::iterator
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:150
GaudiUtils::VectorMap::rend
reverse_iterator rend() const
"rend" iterator for sequential access (const-only version!)
Definition: VectorMap.h:202
ProduceConsume.key
key
Definition: ProduceConsume.py:84
GaudiUtils::VectorMap::erase
size_type erase(const key_type &key)
erase the element using the key
Definition: VectorMap.h:227
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:440
GaudiUtils::VectorMap::update
bool update(const value_type &val)
forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the mappe...
Definition: VectorMap.h:566
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
std::vector::rbegin
T rbegin(T... args)
GaudiUtils::VectorMap::operator[]
const mapped_type & operator[](const key_type &key) const
access to element by key (const version) there is no container increment for missing keys
Definition: VectorMap.h:636
GaudiUtils::VectorMap::VectorMap
VectorMap(INPUT first, INPUT last, const allocator_type &alloc=allocator_type())
templated constructor from "convertible" sequence
Definition: VectorMap.h:678
Gaudi::ParticleProperties::index
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
Definition: IParticlePropertySvc.cpp:39
GaudiUtils::VectorMap::erase
void erase(iterator pos)
erase the element using the iterator
Definition: VectorMap.h:209
std::initializer_list