GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > Class Template Reference

A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandrescu. More...

#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/996/GAUDI/GAUDI_v26r4/InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/VectorMap.h>

Inheritance diagram for GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >:
Collaboration diagram for GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >:

Classes

struct  _compare_type
 The actual structure used to compare the elements Only "key" is important for comparison. More...
 

Public Types

typedef KEY key_type
 the actual type of key More...
 
typedef VALUE mapped_type
 the actual type of value More...
 
typedef KEYCOMPARE key_compare
 comparison of keys More...
 
typedef std::pair< key_type, mapped_typevalue_type
 the actual storage item More...
 
typedef ALLOCATOR allocator_type
 allocator (could be useful for optimizations) More...
 
typedef ALLOCATOR::const_reference reference
 the types to conform STL More...
 
typedef ALLOCATOR::const_reference const_reference
 the types to conform STL More...
 
typedef ALLOCATOR::size_type size_type
 the types to conform STL More...
 
typedef ALLOCATOR::difference_type difference_type
 the types to conform STL More...
 
typedef std::vector< value_type, allocator_type_vector
 the actual storage container (no export) More...
 
typedef _vector::const_iterator iterator
 visible const_iterator (exported) More...
 
typedef _vector::const_iterator const_iterator
 visible const_iterator (exported) More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 visible reverse const_iterator (exported) More...
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 visible reverse const_iterator (exported) More...
 
typedef std::pair< iterator, iteratoriterators
 visible iterator pait More...
 
typedef std::pair< iterator, bool > result_type
 visible iterator pait More...
 
typedef _compare_type compare_type
 the actual comparison criteria for valye_type objects More...
 
typedef KEY key_type
 the actual type of key More...
 
typedef VALUE mapped_type
 the actual type of value More...
 
typedef KEYCOMPARE key_compare
 comparison of keys More...
 
typedef std::pair< key_type, mapped_typevalue_type
 the actual storage item More...
 
typedef ALLOCATOR allocator_type
 allocator (could be useful for optimizations) More...
 
typedef ALLOCATOR::const_reference reference
 the types to conform STL More...
 
typedef ALLOCATOR::const_reference const_reference
 the types to conform STL More...
 
typedef ALLOCATOR::size_type size_type
 the types to conform STL More...
 
typedef ALLOCATOR::difference_type difference_type
 the types to conform STL More...
 
typedef std::vector< value_type, allocator_type_vector
 the actual storage container (no export) More...
 
typedef _vector::const_iterator iterator
 visible const_iterator (exported) More...
 
typedef _vector::const_iterator const_iterator
 visible const_iterator (exported) More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 visible reverse const_iterator (exported) More...
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 visible reverse const_iterator (exported) More...
 
typedef std::pair< iterator, iteratoriterators
 visible iterator pait More...
 
typedef std::pair< iterator, bool > result_type
 visible iterator pait More...
 
typedef _compare_type compare_type
 the actual comparison criteria for valye_type objects More...
 

Public Member Functions

iterator begin () const
 "begin" iterator for sequential access (const-only version!) More...
 
iterator end () const
 "end" iterator for sequential access (const-only version!) More...
 
reverse_iterator rbegin () const
 "rbegin" iterator for sequential access (const-only version!) More...
 
reverse_iterator rend () const
 "rend" iterator for sequential access (const-only version!) More...
 
void erase (iterator pos)
 erase the element using the iterator More...
 
size_type erase (const key_type &key)
 erase the element using the key More...
 
size_type erase (iterator first, iterator last)
 erase the sequence of elements using the iterators More...
 
template<class TYPE >
size_type erase (TYPE first, TYPE last)
 erase the sequence of elements using the sequence of keys More...
 
result_type insert (const key_type &key, const mapped_type &mapped)
 insert the (key,value) pair into the container More...
 
result_type insert (const value_type &value)
 insert the (key,value) pair into the container More...
 
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 more efficient More...
 
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 efficient More...
 
template<class PAIRS >
void insert (PAIRS first, PAIRS last)
 insert the sequence of elements into the container More...
 
template<class KEYS , class VALUES >
void insert (KEYS kf, KEYS kl, VALUES vf)
 insert into the container the elements from 2 "parallel" sequences More...
 
iterator find (const key_type &key) const
 find the element by key More...
 
size_type count (const key_type &key) const
 count number of elements with the certain key More...
 
iterator lower_bound (const key_type &key) const
 
iterator upper_bound (const key_type &key) const
 
iterators equal_range (const key_type &key) const
 
bool empty () const
 empty container ? More...
 
size_type size () const
 number of elements More...
 
size_type max_size () const
 maximal allowed size More...
 
void clear ()
 clear the container More...
 
void reserve (size_type num)
 reserve the space in the container for at least 'num' elements More...
 
void swap (VectorMap &other)
 swap function, which 'swaps' the content of two containers More...
 
bool operator== (const VectorMap &other) const
 comparison criteria for containers More...
 
bool operator< (const VectorMap &other) const
 comparison criteria for containers More...
 
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 existing mapped value. More...
 
bool update (const value_type &val)
 forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the mapped value. More...
 
const mapped_typeoperator() (const key_type &key) const
 access to element by key (const version) there is no container increment for missing keys More...
 
const mapped_typeoperator[] (const key_type &key) const
 access to element by key (const version) there is no container increment for missing keys More...
 
const mapped_typeat (const key_type &key) const
 checked access to elements by key throw std::out_of_range exception for non-existing keys More...
 
 VectorMap (const allocator_type &alloc=allocator_type())
 default constructor from the the allocator More...
 
 VectorMap (const VectorMap &right)
 copy constructor More...
 
template<class INPUT >
 VectorMap (INPUT first, INPUT last, const allocator_type &alloc=allocator_type())
 templated constructor from "convertible" sequence More...
 
 ~VectorMap ()
 destructor (non-virtual!) More...
 
VectorMapoperator= (const VectorMap &right)
 
const compare_typecompare () const
 get the comparison criteria itself More...
 
const key_comparecompare_key () const
 get the comparison criteria for keys More...
 
VectorMapmerge (const VectorMap &right)
 merge two maps More...
 
template<class K1 , class K2 , class K3 , class K4 >
VectorMapmerge (const VectorMap< K1, K2, K3, K4 > &right)
 merge two maps More...
 
const key_typekey_at (const size_t index) const
 useful method for python decoration: More...
 
const mapped_typevalue_at (const size_t index) const
 useful method for python decoration: More...
 
iterator begin () const
 "begin" iterator for sequential access (const-only version!) More...
 
iterator end () const
 "end" iterator for sequential access (const-only version!) More...
 
reverse_iterator rbegin () const
 "rbegin" iterator for sequential access (const-only version!) More...
 
reverse_iterator rend () const
 "rend" iterator for sequential access (const-only version!) More...
 
void erase (iterator pos)
 erase the element using the iterator More...
 
size_type erase (const key_type &key)
 erase the element using the key More...
 
size_type erase (iterator first, iterator last)
 erase the sequence of elements using the iterators More...
 
template<class TYPE >
size_type erase (TYPE first, TYPE last)
 erase the sequence of elements using the sequence of keys More...
 
result_type insert (const key_type &key, const mapped_type &mapped)
 insert the (key,value) pair into the container More...
 
result_type insert (const value_type &value)
 insert the (key,value) pair into the container More...
 
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 more efficient More...
 
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 efficient More...
 
template<class PAIRS >
void insert (PAIRS first, PAIRS last)
 insert the sequence of elements into the container More...
 
template<class KEYS , class VALUES >
void insert (KEYS kf, KEYS kl, VALUES vf)
 insert into the container the elements from 2 "parallel" sequences More...
 
iterator find (const key_type &key) const
 find the element by key More...
 
size_type count (const key_type &key) const
 count number of elements with the certain key More...
 
iterator lower_bound (const key_type &key) const
 
iterator upper_bound (const key_type &key) const
 
iterators equal_range (const key_type &key) const
 
bool empty () const
 empty container ? More...
 
size_type size () const
 number of elements More...
 
size_type max_size () const
 maximal allowed size More...
 
void clear ()
 clear the container More...
 
void reserve (size_type num)
 reserve the space in the container for at least 'num' elements More...
 
void swap (VectorMap &other)
 swap function, which 'swaps' the content of two containers More...
 
bool operator== (const VectorMap &other) const
 comparison criteria for containers More...
 
bool operator< (const VectorMap &other) const
 comparison criteria for containers More...
 
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 existing mapped value. More...
 
bool update (const value_type &val)
 forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the mapped value. More...
 
const mapped_typeoperator() (const key_type &key) const
 access to element by key (const version) there is no container increment for missing keys More...
 
const mapped_typeoperator[] (const key_type &key) const
 access to element by key (const version) there is no container increment for missing keys More...
 
const mapped_typeat (const key_type &key) const
 checked access to elements by key throw std::out_of_range exception for non-existing keys More...
 
 VectorMap (const allocator_type &alloc=allocator_type())
 default constructor from the the allocator More...
 
 VectorMap (const VectorMap &right)
 copy constructor More...
 
template<class INPUT >
 VectorMap (INPUT first, INPUT last, const allocator_type &alloc=allocator_type())
 templated constructor from "convertible" sequence More...
 
 ~VectorMap ()
 destructor (non-virtual!) More...
 
VectorMapoperator= (const VectorMap &right)
 
const compare_typecompare () const
 get the comparison criteria itself More...
 
const key_comparecompare_key () const
 get the comparison criteria for keys More...
 
VectorMapmerge (const VectorMap &right)
 merge two maps More...
 
template<class K1 , class K2 , class K3 , class K4 >
VectorMapmerge (const VectorMap< K1, K2, K3, K4 > &right)
 merge two maps More...
 
const key_typekey_at (const size_t index) const
 useful method for python decoration: More...
 
const mapped_typevalue_at (const size_t 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 Types

typedef _vector::iterator _iterator
 the regular iterator (no export) More...
 
typedef _vector::iterator _iterator
 the regular iterator (no export) More...
 

Protected Member Functions

template<class TYPE1 , class TYPE2 >
bool compare (const TYPE1 &obj1, const TYPE2 &obj2) const
 compare the objects using the comaprison criteria More...
 
_iterator lower_bound (const key_type &key)
 'lower-bound' - non-const version More...
 
_iterator iter (iterator p)
 the conversion from 'const' to 'non-const' iterator More...
 
iterator iter (_iterator p)
 the conversion from 'non-const' to 'const' iterator More...
 
template<class TYPE1 , class TYPE2 >
bool compare (const TYPE1 &obj1, const TYPE2 &obj2) const
 compare the objects using the comaprison criteria More...
 
_iterator lower_bound (const key_type &key)
 'lower-bound' - non-const version More...
 
_iterator iter (iterator p)
 the conversion from 'const' to 'non-const' iterator More...
 
iterator iter (_iterator p)
 the conversion from 'non-const' to 'const' iterator More...
 
- 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...
 

Private Attributes

_vector m_vct
 the underlying sorted vector of (key,mapped) pairs More...
 

Friends

bool operator> (const VectorMap &left, const VectorMap &right)
 
bool operator!= (const VectorMap &left, const VectorMap &right)
 
bool operator>= (const VectorMap &left, const VectorMap &right)
 
bool operator<= (const VectorMap &left, const VectorMap &right)
 
std::ostream & operator<< (std::ostream &str, const VectorMap &)
 printout to ostream - not implemented More...
 
bool operator> (const VectorMap &left, const VectorMap &right)
 
bool operator!= (const VectorMap &left, const VectorMap &right)
 
bool operator>= (const VectorMap &left, const VectorMap &right)
 
bool operator<= (const VectorMap &left, const VectorMap &right)
 
std::ostream & operator<< (std::ostream &str, const VectorMap &)
 printout to ostream - not implemented More...
 

Detailed Description

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
class GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >

A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandrescu.

The number of "non-const" operations is reduced, e.g. all non-const iterators are not exported, therefore it is almost impossible e.g. externally re-sort the underlying sorted container.


The nominal CPU performance:

Container insertion: O(N) Container look-up: O(log(N)) (a'la std::map, but a bit faster)

It could be used as a "light" and good alternative for std::map associative container, in the case of relatively rare insertion and frequent look-up.

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 redefind

To avoid the unnesessary expansion of dictionaries it is highly recommended to exclude from dictionary the following methods:

  • lower_bound
  • upper_bound
  • equal_range
  • insert
See also
Gaudi::Utils::MapBase
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-07-23

Definition at line 107 of file VectorMap.h.

Member Typedef Documentation

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _vector::iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::_iterator
protected

the regular iterator (no export)

Definition at line 141 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _vector::iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::_iterator
protected

the regular iterator (no export)

Definition at line 141 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::vector<value_type,allocator_type> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::_vector

the actual storage container (no export)

Definition at line 136 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::vector<value_type,allocator_type> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::_vector

the actual storage container (no export)

Definition at line 136 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::allocator_type

allocator (could be useful for optimizations)

Definition at line 123 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::allocator_type

allocator (could be useful for optimizations)

Definition at line 123 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _compare_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare_type

the actual comparison criteria for valye_type objects

Definition at line 188 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _compare_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare_type

the actual comparison criteria for valye_type objects

Definition at line 188 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _vector::const_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::const_iterator

visible const_iterator (exported)

Definition at line 148 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _vector::const_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::const_iterator

visible const_iterator (exported)

Definition at line 148 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::const_reference GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::const_reference

the types to conform STL

Definition at line 127 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::const_reference GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::const_reference

the types to conform STL

Definition at line 127 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::reverse_iterator<const_iterator> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::const_reverse_iterator

visible reverse const_iterator (exported)

Definition at line 152 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::reverse_iterator<const_iterator> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::const_reverse_iterator

visible reverse const_iterator (exported)

Definition at line 152 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::difference_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::difference_type

the types to conform STL

Definition at line 131 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::difference_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::difference_type

the types to conform STL

Definition at line 131 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _vector::const_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iterator

visible const_iterator (exported)

Definition at line 146 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef _vector::const_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iterator

visible const_iterator (exported)

Definition at line 146 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::pair<iterator,iterator> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iterators

visible iterator pait

Definition at line 154 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::pair<iterator,iterator> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iterators

visible iterator pait

Definition at line 154 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef KEYCOMPARE GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::key_compare

comparison of keys

Definition at line 116 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef KEYCOMPARE GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::key_compare

comparison of keys

Definition at line 116 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef KEY GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::key_type

the actual type of key

Definition at line 112 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef KEY GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::key_type

the actual type of key

Definition at line 112 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef VALUE GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::mapped_type

the actual type of value

Definition at line 114 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef VALUE GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::mapped_type

the actual type of value

Definition at line 114 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::const_reference GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::reference

the types to conform STL

Definition at line 125 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::const_reference GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::reference

the types to conform STL

Definition at line 125 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::pair<iterator,bool> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::result_type

visible iterator pait

Definition at line 156 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::pair<iterator,bool> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::result_type

visible iterator pait

Definition at line 156 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::reverse_iterator<iterator> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::reverse_iterator

visible reverse const_iterator (exported)

Definition at line 150 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::reverse_iterator<iterator> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::reverse_iterator

visible reverse const_iterator (exported)

Definition at line 150 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::size_type

the types to conform STL

Definition at line 129 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef ALLOCATOR::size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::size_type

the types to conform STL

Definition at line 129 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::pair<key_type,mapped_type> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::value_type

the actual storage item

Definition at line 118 of file VectorMap.h.

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
typedef std::pair<key_type,mapped_type> GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::value_type

the actual storage item

Definition at line 118 of file VectorMap.h.

Constructor & Destructor Documentation

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::VectorMap ( const allocator_type alloc = allocator_type ())
inline

default constructor from the the allocator

Parameters
cmpcomparison criteria for the key
allocallocator to be used

Definition at line 709 of file VectorMap.h.

710  : m_vct ( alloc )
711  {}
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::VectorMap ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right)
inline

copy constructor

Parameters
rightobject to be copied

Definition at line 716 of file VectorMap.h.

717  : Gaudi::Utils::MapBase(right), m_vct ( right.m_vct )
718  {}
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
Helper base-class to allow the generic Python-decoration for all "map-like" classes in Gaudi...
Definition: MapBase.h:44
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class INPUT >
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::VectorMap ( INPUT  first,
INPUT  last,
const allocator_type alloc = allocator_type () 
)
inline

templated constructor from "convertible" sequence

Parameters
first'begin'-iterator for the convertible sequence
last'end'-iterator for the convertible sequence
cmpcomparison criteria for the key
allocallocator to be used

Definition at line 727 of file VectorMap.h.

730  : m_vct ( first , last , alloc )
731  { std::sort ( m_vct.begin(), m_vct.end(), compare() ) ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::~VectorMap ( )
inline

destructor (non-virtual!)

Definition at line 734 of file VectorMap.h.

734 { clear() ; } // destructor (non-virtual!)
void clear()
clear the container
Definition: VectorMap.h:496
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::VectorMap ( const allocator_type alloc = allocator_type ())
inline

default constructor from the the allocator

Parameters
cmpcomparison criteria for the key
allocallocator to be used

Definition at line 709 of file VectorMap.h.

710  : m_vct ( alloc )
711  {}
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::VectorMap ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right)
inline

copy constructor

Parameters
rightobject to be copied

Definition at line 716 of file VectorMap.h.

717  : Gaudi::Utils::MapBase(right), m_vct ( right.m_vct )
718  {}
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
Helper base-class to allow the generic Python-decoration for all "map-like" classes in Gaudi...
Definition: MapBase.h:44
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class INPUT >
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::VectorMap ( INPUT  first,
INPUT  last,
const allocator_type alloc = allocator_type () 
)
inline

templated constructor from "convertible" sequence

Parameters
first'begin'-iterator for the convertible sequence
last'end'-iterator for the convertible sequence
cmpcomparison criteria for the key
allocallocator to be used

Definition at line 727 of file VectorMap.h.

730  : m_vct ( first , last , alloc )
731  { std::sort ( m_vct.begin(), m_vct.end(), compare() ) ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::~VectorMap ( )
inline

destructor (non-virtual!)

Definition at line 734 of file VectorMap.h.

734 { clear() ; } // destructor (non-virtual!)
void clear()
clear the container
Definition: VectorMap.h:496

Member Function Documentation

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::at ( const key_type key) const
inline

checked access to elements by key throw std::out_of_range exception for non-existing keys

// OK:
K key = ... ;
std::cout << " Value: " << m.at(key) << std::end ; // it is OK!
Exceptions
std::out_of_rangefor non-existing keys
Parameters
keykey value
Returns
mapped value

Definition at line 694 of file VectorMap.h.

695  {
696  iterator res = find ( key ) ;
697  if ( end() == res ) { this->throw_out_of_range_exception () ; }
698  return res->second ;
699  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:28
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::at ( const key_type key) const
inline

checked access to elements by key throw std::out_of_range exception for non-existing keys

// OK:
K key = ... ;
std::cout << " Value: " << m.at(key) << std::end ; // it is OK!
Exceptions
std::out_of_rangefor non-existing keys
Parameters
keykey value
Returns
mapped value

Definition at line 694 of file VectorMap.h.

695  {
696  iterator res = find ( key ) ;
697  if ( end() == res ) { this->throw_out_of_range_exception () ; }
698  return res->second ;
699  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:28
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::begin ( ) const
inline

"begin" iterator for sequential access (const-only version!)

Definition at line 195 of file VectorMap.h.

195 { return m_vct . begin () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::begin ( ) const
inline

"begin" iterator for sequential access (const-only version!)

Definition at line 195 of file VectorMap.h.

195 { return m_vct . begin () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::clear ( )
inline

clear the container

Definition at line 496 of file VectorMap.h.

496 { m_vct.clear () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::clear ( )
inline

clear the container

Definition at line 496 of file VectorMap.h.

496 { m_vct.clear () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const compare_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare ( ) const
inline

get the comparison criteria itself

Definition at line 752 of file VectorMap.h.

753  {
754  static const compare_type s_cmp = compare_type() ;
755  return s_cmp ;
756  }
_compare_type compare_type
the actual comparison criteria for valye_type objects
Definition: VectorMap.h:188
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const compare_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare ( ) const
inline

get the comparison criteria itself

Definition at line 752 of file VectorMap.h.

753  {
754  static const compare_type s_cmp = compare_type() ;
755  return s_cmp ;
756  }
_compare_type compare_type
the actual comparison criteria for valye_type objects
Definition: VectorMap.h:188
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class TYPE1 , class TYPE2 >
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare ( const TYPE1 &  obj1,
const TYPE2 &  obj2 
) const
inlineprotected

compare the objects using the comaprison criteria

Parameters
objthe first object
objthe second object
Returns
result of (obj1,obj2) comparison

Definition at line 823 of file VectorMap.h.

825  {
826  return compare() ( obj1 , obj2 ) ;
827  }
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class TYPE1 , class TYPE2 >
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare ( const TYPE1 &  obj1,
const TYPE2 &  obj2 
) const
inlineprotected

compare the objects using the comaprison criteria

Parameters
objthe first object
objthe second object
Returns
result of (obj1,obj2) comparison

Definition at line 823 of file VectorMap.h.

825  {
826  return compare() ( obj1 , obj2 ) ;
827  }
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const key_compare& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare_key ( ) const
inline

get the comparison criteria for keys

Definition at line 758 of file VectorMap.h.

758 { return compare() ; }
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const key_compare& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::compare_key ( ) const
inline

get the comparison criteria for keys

Definition at line 758 of file VectorMap.h.

758 { return compare() ; }
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::count ( const key_type key) const
inline

count number of elements with the certain key

K key = ... ;
std::cout << " # of elements for the key: " << m.count(key) << std::end ;
Parameters
keykey to be searched
Returns
number of elements with the given key (0 or 1)

Definition at line 477 of file VectorMap.h.

478  { return end() == find ( key ) ? 0 : 1 ; }
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::count ( const key_type key) const
inline

count number of elements with the certain key

K key = ... ;
std::cout << " # of elements for the key: " << m.count(key) << std::end ;
Parameters
keykey to be searched
Returns
number of elements with the given key (0 or 1)

Definition at line 477 of file VectorMap.h.

478  { return end() == find ( key ) ? 0 : 1 ; }
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::empty ( ) const
inline

empty container ?

Definition at line 490 of file VectorMap.h.

490 { return m_vct . empty () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
bool empty() const
empty container ?
Definition: VectorMap.h:490
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::empty ( ) const
inline

empty container ?

Definition at line 490 of file VectorMap.h.

490 { return m_vct . empty () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
bool empty() const
empty container ?
Definition: VectorMap.h:490
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::end ( ) const
inline

"end" iterator for sequential access (const-only version!)

Definition at line 197 of file VectorMap.h.

197 { return m_vct . end () ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::end ( ) const
inline

"end" iterator for sequential access (const-only version!)

Definition at line 197 of file VectorMap.h.

197 { return m_vct . end () ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterators GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::equal_range ( const key_type key) const
inline

Definition at line 484 of file VectorMap.h.

485  { return std::equal_range ( begin () , end () , key , compare () ) ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterators GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::equal_range ( const key_type key) const
inline

Definition at line 484 of file VectorMap.h.

485  { return std::equal_range ( begin () , end () , key , compare () ) ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( iterator  pos)
inline

erase the element using the iterator

Parameters
posposition of the element to be erased

Definition at line 208 of file VectorMap.h.

208 { m_vct.erase ( iter ( pos ) ) ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( iterator  pos)
inline

erase the element using the iterator

Parameters
posposition of the element to be erased

Definition at line 208 of file VectorMap.h.

208 { m_vct.erase ( iter ( pos ) ) ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( const key_type key)
inline

erase the element using the key

...
K key = ... ;
std::cout << " # of erased elements "
<< m.erase ( key ) << std::endl ;
Parameters
keykey for the element to be erased
Returns
number of erased elements (0 or 1)

Definition at line 226 of file VectorMap.h.

227  {
228  iterator pos = find ( key ) ;
229  if ( end() == pos ) { return 0 ; }
230  erase ( pos ) ;
231  return 1 ;
232  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
void erase(iterator pos)
erase the element using the iterator
Definition: VectorMap.h:208
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( const key_type key)
inline

erase the element using the key

...
K key = ... ;
std::cout << " # of erased elements "
<< m.erase ( key ) << std::endl ;
Parameters
keykey for the element to be erased
Returns
number of erased elements (0 or 1)

Definition at line 226 of file VectorMap.h.

227  {
228  iterator pos = find ( key ) ;
229  if ( end() == pos ) { return 0 ; }
230  erase ( pos ) ;
231  return 1 ;
232  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
void erase(iterator pos)
erase the element using the iterator
Definition: VectorMap.h:208
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( iterator  first,
iterator  last 
)
inline

erase the sequence of elements using the iterators

Parameters
firstbegin iterator of sub-sequence to be erased
endend iterator of the sub_sequence to be erased
Returns
number of erased elements

Definition at line 239 of file VectorMap.h.

241  {
242  m_vct.erase ( iter ( first ) , iter ( last ) ) ;
243  return last - first ;
244  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( iterator  first,
iterator  last 
)
inline

erase the sequence of elements using the iterators

Parameters
firstbegin iterator of sub-sequence to be erased
endend iterator of the sub_sequence to be erased
Returns
number of erased elements

Definition at line 239 of file VectorMap.h.

241  {
242  m_vct.erase ( iter ( first ) , iter ( last ) ) ;
243  return last - first ;
244  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class TYPE >
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( TYPE  first,
TYPE  last 
)
inline

erase the sequence of elements using the sequence of keys

// some sequence of keys, to be removed
KEYS keys = ... ;
std::cout
<< " # keys to be removed: " << keys.size()
<< " # keys removed: " << m.erase( keys.begin() , keys.end() )
<< std::endl ;
Parameters
firstbegin-iterator for the sequence of keys
lastend-iterator for the sequence of keys
Returns
number of erased elements

Definition at line 267 of file VectorMap.h.

268  {
269  size_type res = 0 ;
270  for ( ; first != last ; ++first ) { res += erase ( *first ) ; }
271  return res ;
272  }
ALLOCATOR::size_type size_type
the types to conform STL
Definition: VectorMap.h:129
void erase(iterator pos)
erase the element using the iterator
Definition: VectorMap.h:208
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class TYPE >
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::erase ( TYPE  first,
TYPE  last 
)
inline

erase the sequence of elements using the sequence of keys

// some sequence of keys, to be removed
KEYS keys = ... ;
std::cout
<< " # keys to be removed: " << keys.size()
<< " # keys removed: " << m.erase( keys.begin() , keys.end() )
<< std::endl ;
Parameters
firstbegin-iterator for the sequence of keys
lastend-iterator for the sequence of keys
Returns
number of erased elements

Definition at line 267 of file VectorMap.h.

268  {
269  size_type res = 0 ;
270  for ( ; first != last ; ++first ) { res += erase ( *first ) ; }
271  return res ;
272  }
ALLOCATOR::size_type size_type
the types to conform STL
Definition: VectorMap.h:129
void erase(iterator pos)
erase the element using the iterator
Definition: VectorMap.h:208
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::find ( const key_type key) const
inline

find the element by key

Map m = ... ;
K key = ...;
// Is key in the container?
Map::iterator ifound = m.find( key ) ;
if ( m.end() != ifound )
{
std::cout << "The value is : " << ifound->second << std::endl ;
}
Parameters
keykey to be searched
Returns
iterator to the element position in the container

Definition at line 454 of file VectorMap.h.

455  {
456  iterator res = lower_bound ( key ) ;
457  if ( end() != res && compare ( key , res->first ) )
458  { res = end(); }
459  return res ;
460  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:480
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::find ( const key_type key) const
inline

find the element by key

Map m = ... ;
K key = ...;
// Is key in the container?
Map::iterator ifound = m.find( key ) ;
if ( m.end() != ifound )
{
std::cout << "The value is : " << ifound->second << std::endl ;
}
Parameters
keykey to be searched
Returns
iterator to the element position in the container

Definition at line 454 of file VectorMap.h.

455  {
456  iterator res = lower_bound ( key ) ;
457  if ( end() != res && compare ( key , res->first ) )
458  { res = end(); }
459  return res ;
460  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:480
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( const key_type key,
const mapped_type mapped 
)
inline

insert the (key,value) pair into the container

Attention
there is no replacement for the existing key!

It is STL-compliant behavior for associative containers.

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout
<< " Before insert: " << m[key] // should be: V()
<< std::end ;
// insert the value into the map:
const bool inserted1 = m.insert( key , val1 ).second ;
std::cout
<< " 1st insert: "
<< Gaudi::Utils::toString( inserted1 ) // should be: "True"
<< " value: " << m[key] // should be: val1
<< std::endl ;
// try to re-insert another value with the same key:
const bool inserted2 = m.insert( key , val2 ).second ;
std::cout
<< " 2nd insert: "
<< Gaudi::Utils::toString( inserted2 ) // should be: "False"
<< " value: " << m[key] // should be: val1
<< std::endl ;
Parameters
keykey value to be inserted
mappedvalue to be associated with the key
Returns
position of the inserted elements with the flag which allows to distinguish the actual insertion

Definition at line 316 of file VectorMap.h.

318  { return insert ( value_type ( key , mapped ) ) ; }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:118
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( const key_type key,
const mapped_type mapped 
)
inline

insert the (key,value) pair into the container

Attention
there is no replacement for the existing key!

It is STL-compliant behavior for associative containers.

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout
<< " Before insert: " << m[key] // should be: V()
<< std::end ;
// insert the value into the map:
const bool inserted1 = m.insert( key , val1 ).second ;
std::cout
<< " 1st insert: "
<< Gaudi::Utils::toString( inserted1 ) // should be: "True"
<< " value: " << m[key] // should be: val1
<< std::endl ;
// try to re-insert another value with the same key:
const bool inserted2 = m.insert( key , val2 ).second ;
std::cout
<< " 2nd insert: "
<< Gaudi::Utils::toString( inserted2 ) // should be: "False"
<< " value: " << m[key] // should be: val1
<< std::endl ;
Parameters
keykey value to be inserted
mappedvalue to be associated with the key
Returns
position of the inserted elements with the flag which allows to distinguish the actual insertion

Definition at line 316 of file VectorMap.h.

318  { return insert ( value_type ( key , mapped ) ) ; }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:118
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( const value_type value)
inline

insert the (key,value) pair into the container

Attention
there is no replacement for the existing element!

It is STL-compliant behavior for associative containers.

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout
<< " Before insert: " << m[key] // should be: V()
<< std::end ;
// insert the value into the map:
const bool inserted1 = m.insert ( std::make_pair( key , val1 ) ).second ;
std::cout
<< " 1st insert: "
<< Gaudi::Utils::toString( inserted1 ) // should be: "True"
<< " value: " << m[key] // should be: val1
<< std::endl ;
// try to re-insert another value with the same key:
const bool inserted2 = m.insert ( std::make_pair( key , val2 ) ).second ;
std::cout
<< " 2nd insert: "
<< Gaudi::Utils::toString( inserted2 ) // should be: "False"
<< " value: " << m[key] // should be: val1
<< std::endl ;
Parameters
valuevalue to be inserted
Returns
position of the inserted elements with the flag which allows to distinguish the actual insertion

Definition at line 361 of file VectorMap.h.

362  {
363  bool found = true ;
364  _iterator result = lower_bound ( value.first ) ;
365  if ( end() == result || compare( value.first , result -> first ) )
366  { result = m_vct.insert ( result , value ) ; found = false ; }
367  return result_type ( iter ( result ) , !found ) ;
368  }
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:141
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:480
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
std::pair< iterator, bool > result_type
visible iterator pait
Definition: VectorMap.h:156
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( const value_type value)
inline

insert the (key,value) pair into the container

Attention
there is no replacement for the existing element!

It is STL-compliant behavior for associative containers.

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout
<< " Before insert: " << m[key] // should be: V()
<< std::end ;
// insert the value into the map:
const bool inserted1 = m.insert ( std::make_pair( key , val1 ) ).second ;
std::cout
<< " 1st insert: "
<< Gaudi::Utils::toString( inserted1 ) // should be: "True"
<< " value: " << m[key] // should be: val1
<< std::endl ;
// try to re-insert another value with the same key:
const bool inserted2 = m.insert ( std::make_pair( key , val2 ) ).second ;
std::cout
<< " 2nd insert: "
<< Gaudi::Utils::toString( inserted2 ) // should be: "False"
<< " value: " << m[key] // should be: val1
<< std::endl ;
Parameters
valuevalue to be inserted
Returns
position of the inserted elements with the flag which allows to distinguish the actual insertion

Definition at line 361 of file VectorMap.h.

362  {
363  bool found = true ;
364  _iterator result = lower_bound ( value.first ) ;
365  if ( end() == result || compare( value.first , result -> first ) )
366  { result = m_vct.insert ( result , value ) ; found = false ; }
367  return result_type ( iter ( result ) , !found ) ;
368  }
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:141
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:480
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
std::pair< iterator, bool > result_type
visible iterator pait
Definition: VectorMap.h:156
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( iterator  pos,
const value_type value 
)
inline

insert the element with some guess about its new position With the right guess the method could be more efficient

Attention
there is no replacement for the existing element!
Parameters
posthe guess about position where to insert the element
valuevalue to be inserted
Returns
position of the inserted elements with the flag which indicated the actual insertion

Definition at line 379 of file VectorMap.h.

381  {
382  if ( pos != end() && compare ( *pos , value ) &&
383  ( pos == end() - 1 ||
384  ( !compare ( value , *( pos + 1 ) )
385  && compare ( *( pos + 1 ) , value ) ) ) )
386  { return result_type( m_vct.insert ( iter ( pos ) , value ) , true ) ; }
387  return insert ( value ) ;
388  }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
std::pair< iterator, bool > result_type
visible iterator pait
Definition: VectorMap.h:156
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( iterator  pos,
const value_type value 
)
inline

insert the element with some guess about its new position With the right guess the method could be more efficient

Attention
there is no replacement for the existing element!
Parameters
posthe guess about position where to insert the element
valuevalue to be inserted
Returns
position of the inserted elements with the flag which indicated the actual insertion

Definition at line 379 of file VectorMap.h.

381  {
382  if ( pos != end() && compare ( *pos , value ) &&
383  ( pos == end() - 1 ||
384  ( !compare ( value , *( pos + 1 ) )
385  && compare ( *( pos + 1 ) , value ) ) ) )
386  { return result_type( m_vct.insert ( iter ( pos ) , value ) , true ) ; }
387  return insert ( value ) ;
388  }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
std::pair< iterator, bool > result_type
visible iterator pait
Definition: VectorMap.h:156
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
_iterator iter(iterator p)
the conversion from 'const' to 'non-const' iterator
Definition: VectorMap.h:837
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( iterator  pos,
const key_type key,
const mapped_type mapped 
)
inline

insert the (key,value) pair into the container With the right guess the method could be more efficient

Attention
there is no replacement for the existing element!
Parameters
posthe guess about position where to insert the element
keykey value to be inserted
mappedvalue to be associated with the key
Returns
position of the inserted elements with the flag which indicated the actual insertion

Definition at line 400 of file VectorMap.h.

403  { return insert ( pos , value_type ( key , mapped ) ) ; }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:118
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
result_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( iterator  pos,
const key_type key,
const mapped_type mapped 
)
inline

insert the (key,value) pair into the container With the right guess the method could be more efficient

Attention
there is no replacement for the existing element!
Parameters
posthe guess about position where to insert the element
keykey value to be inserted
mappedvalue to be associated with the key
Returns
position of the inserted elements with the flag which indicated the actual insertion

Definition at line 400 of file VectorMap.h.

403  { return insert ( pos , value_type ( key , mapped ) ) ; }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:118
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class PAIRS >
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( PAIRS  first,
PAIRS  last 
)
inline

insert the sequence of elements into the container

Attention
there is no replacement for the existing element!
Parameters
firstthe begin iterator of the sequence
lastthe end iterator of the sequence

Definition at line 412 of file VectorMap.h.

414  { for ( ; first != last ; ++first ) { insert ( *first ) ; } }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class PAIRS >
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( PAIRS  first,
PAIRS  last 
)
inline

insert the sequence of elements into the container

Attention
there is no replacement for the existing element!
Parameters
firstthe begin iterator of the sequence
lastthe end iterator of the sequence

Definition at line 412 of file VectorMap.h.

414  { for ( ; first != last ; ++first ) { insert ( *first ) ; } }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class KEYS , class VALUES >
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( KEYS  kf,
KEYS  kl,
VALUES  vf 
)
inline

insert into the container the elements from 2 "parallel" sequences

Attention
there is no replacement for the existing element!
Parameters
kfthe begin iterator of the sequence of keys
klthe end iterator of the sequence of keys
vfthe begin iterator of the sequence of values

Definition at line 424 of file VectorMap.h.

427  { for ( ; kf != kl ; ++kf, ++vf ) { insert ( *kf , *vf ) ; } }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class KEYS , class VALUES >
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::insert ( KEYS  kf,
KEYS  kl,
VALUES  vf 
)
inline

insert into the container the elements from 2 "parallel" sequences

Attention
there is no replacement for the existing element!
Parameters
kfthe begin iterator of the sequence of keys
klthe end iterator of the sequence of keys
vfthe begin iterator of the sequence of values

Definition at line 424 of file VectorMap.h.

427  { for ( ; kf != kl ; ++kf, ++vf ) { insert ( *kf , *vf ) ; } }
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:316
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iter ( iterator  p)
inlineprotected

the conversion from 'const' to 'non-const' iterator

Definition at line 837 of file VectorMap.h.

838  {
839  _iterator result = m_vct.begin() ;
840  std::advance ( result , std::distance ( begin() , p ) ) ;
841  return result ;
842  }
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:141
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iter ( iterator  p)
inlineprotected

the conversion from 'const' to 'non-const' iterator

Definition at line 837 of file VectorMap.h.

838  {
839  _iterator result = m_vct.begin() ;
840  std::advance ( result , std::distance ( begin() , p ) ) ;
841  return result ;
842  }
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:141
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iter ( _iterator  p)
inlineprotected

the conversion from 'non-const' to 'const' iterator

Definition at line 845 of file VectorMap.h.

846  {
847  iterator result ( begin() ) ;
848  std::advance ( result , std::distance ( m_vct.begin() , p ) ) ;
849  return result ;
850  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::iter ( _iterator  p)
inlineprotected

the conversion from 'non-const' to 'const' iterator

Definition at line 845 of file VectorMap.h.

846  {
847  iterator result ( begin() ) ;
848  std::advance ( result , std::distance ( m_vct.begin() , p ) ) ;
849  return result ;
850  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const key_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::key_at ( const size_t  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 791 of file VectorMap.h.

792  {
793  if ( index >= size() )
794  { this->throw_out_of_range_exception () ; }
795  const_iterator it = this->begin() ;
796  std::advance ( it , index ) ;
797  return it -> first ;
798  }
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:148
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:28
size_type size() const
number of elements
Definition: VectorMap.h:492
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const key_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::key_at ( const size_t  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 791 of file VectorMap.h.

792  {
793  if ( index >= size() )
794  { this->throw_out_of_range_exception () ; }
795  const_iterator it = this->begin() ;
796  std::advance ( it , index ) ;
797  return it -> first ;
798  }
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:148
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:28
size_type size() const
number of elements
Definition: VectorMap.h:492
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::lower_bound ( const key_type key) const
inline

Definition at line 480 of file VectorMap.h.

481  { return std::lower_bound ( begin () , end () , key , compare () ) ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::lower_bound ( const key_type key) const
inline

Definition at line 480 of file VectorMap.h.

481  { return std::lower_bound ( begin () , end () , key , compare () ) ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::lower_bound ( const key_type key)
inlineprotected

'lower-bound' - non-const version

Definition at line 830 of file VectorMap.h.

831  {
832  return std::lower_bound
833  ( m_vct.begin() , m_vct.end() , key , compare() ) ;
834  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::lower_bound ( const key_type key)
inlineprotected

'lower-bound' - non-const version

Definition at line 830 of file VectorMap.h.

831  {
832  return std::lower_bound
833  ( m_vct.begin() , m_vct.end() , key , compare() ) ;
834  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::max_size ( ) const
inline

maximal allowed size

Definition at line 494 of file VectorMap.h.

494 { return m_vct . max_size () ; }
size_type max_size() const
maximal allowed size
Definition: VectorMap.h:494
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::max_size ( ) const
inline

maximal allowed size

Definition at line 494 of file VectorMap.h.

494 { return m_vct . max_size () ; }
size_type max_size() const
maximal allowed size
Definition: VectorMap.h:494
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
VectorMap& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::merge ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right)
inline

merge two maps

Definition at line 766 of file VectorMap.h.

767  {
768  for ( const_iterator it = right.begin() ; right.end() != it ; ++it )
769  { update ( it->first , it->second ) ; }
770  //
771  return *this ;
772  }
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:148
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:560
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
VectorMap& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::merge ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right)
inline

merge two maps

Definition at line 766 of file VectorMap.h.

767  {
768  for ( const_iterator it = right.begin() ; right.end() != it ; ++it )
769  { update ( it->first , it->second ) ; }
770  //
771  return *this ;
772  }
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:148
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:560
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class K1 , class K2 , class K3 , class K4 >
VectorMap& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::merge ( const VectorMap< K1, K2, K3, K4 > &  right)
inline

merge two maps

Definition at line 775 of file VectorMap.h.

776  {
777  for ( typename VectorMap<K1,K2,K3,K4>::const_iterator it =
778  right.begin() ; right.end() != it ; ++it )
779  { update ( it->first , it->second ) ; }
780  //
781  return *this ;
782  }
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:560
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
template<class K1 , class K2 , class K3 , class K4 >
VectorMap& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::merge ( const VectorMap< K1, K2, K3, K4 > &  right)
inline

merge two maps

Definition at line 775 of file VectorMap.h.

776  {
777  for ( typename VectorMap<K1,K2,K3,K4>::const_iterator it =
778  right.begin() ; right.end() != it ; ++it )
779  { update ( it->first , it->second ) ; }
780  //
781  return *this ;
782  }
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:560
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator() ( const key_type key) const
inline

access to element by key (const version) there is no container increment for missing keys

Attention
The behavior different from std::map, it is similar to GaudiUtils::Map

The method is added on request from ATLAS (see Savannah report #21395 and #21394) For typical usage of this class in LHCb context as "ExtraInfo" field I would like to recommend to AVOID this method

// OK:
K key = ... ;
std::cout << " Value: " << m(key) << std::end ; // it is OK!
// ERROR:
V value = ... ;
m(key) = value ; // ERROR!
See also
GaudiUtils::Map
Parameters
keykey value
Returns
mapped value for existing key and the default value for non-existing key

Definition at line 636 of file VectorMap.h.

637  {
638  static const mapped_type s_default = mapped_type() ;
639  iterator res = find ( key ) ;
640  if ( end() == res ) { return s_default ; }
641  return res->second ;
642  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
VALUE mapped_type
the actual type of value
Definition: VectorMap.h:114
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator() ( const key_type key) const
inline

access to element by key (const version) there is no container increment for missing keys

Attention
The behavior different from std::map, it is similar to GaudiUtils::Map

The method is added on request from ATLAS (see Savannah report #21395 and #21394) For typical usage of this class in LHCb context as "ExtraInfo" field I would like to recommend to AVOID this method

// OK:
K key = ... ;
std::cout << " Value: " << m(key) << std::end ; // it is OK!
// ERROR:
V value = ... ;
m(key) = value ; // ERROR!
See also
GaudiUtils::Map
Parameters
keykey value
Returns
mapped value for existing key and the default value for non-existing key

Definition at line 636 of file VectorMap.h.

637  {
638  static const mapped_type s_default = mapped_type() ;
639  iterator res = find ( key ) ;
640  if ( end() == res ) { return s_default ; }
641  return res->second ;
642  }
_vector::const_iterator iterator
visible const_iterator (exported)
Definition: VectorMap.h:146
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:454
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
VALUE mapped_type
the actual type of value
Definition: VectorMap.h:114
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator< ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  other) const
inline

comparison criteria for containers

Definition at line 512 of file VectorMap.h.

513  { return m_vct < other.m_vct ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator< ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  other) const
inline

comparison criteria for containers

Definition at line 512 of file VectorMap.h.

513  { return m_vct < other.m_vct ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
VectorMap& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right)
inline

Definition at line 740 of file VectorMap.h.

741  {
742  if ( &right == this ) { return *this ; }
743  m_vct = right.m_vct ;
744  return *this ;
745  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
VectorMap& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right)
inline

Definition at line 740 of file VectorMap.h.

741  {
742  if ( &right == this ) { return *this ; }
743  m_vct = right.m_vct ;
744  return *this ;
745  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator== ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  other) const
inline

comparison criteria for containers

Definition at line 509 of file VectorMap.h.

510  { return m_vct == other.m_vct ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator== ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  other) const
inline

comparison criteria for containers

Definition at line 509 of file VectorMap.h.

510  { return m_vct == other.m_vct ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator[] ( const key_type key) const
inline

access to element by key (const version) there is no container increment for missing keys

Attention
The behavior different from std::map, it is similar to GaudiUtils::Map

The method is added on request from ATLAS (see Savannah report #21395 and #21394) For typical usage of this class in LHCb context as "ExtraInfo" field I would like to recommend to AVOID this method

// OK:
K key = ... ;
std::cout << " Value: " << m[key] << std::end ; // it is OK!
// ERROR:
V value = ... ;
m[key] = value ; // ERROR!
See also
GaudiUtils::Map
Parameters
keykey value
Returns
mapped value

Definition at line 674 of file VectorMap.h.

675  { return (*this)( key ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::operator[] ( const key_type key) const
inline

access to element by key (const version) there is no container increment for missing keys

Attention
The behavior different from std::map, it is similar to GaudiUtils::Map

The method is added on request from ATLAS (see Savannah report #21395 and #21394) For typical usage of this class in LHCb context as "ExtraInfo" field I would like to recommend to AVOID this method

// OK:
K key = ... ;
std::cout << " Value: " << m[key] << std::end ; // it is OK!
// ERROR:
V value = ... ;
m[key] = value ; // ERROR!
See also
GaudiUtils::Map
Parameters
keykey value
Returns
mapped value

Definition at line 674 of file VectorMap.h.

675  { return (*this)( key ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
reverse_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::rbegin ( ) const
inline

"rbegin" iterator for sequential access (const-only version!)

Definition at line 199 of file VectorMap.h.

199 { return m_vct . rbegin () ; }
reverse_iterator rbegin() const
"rbegin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:199
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
reverse_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::rbegin ( ) const
inline

"rbegin" iterator for sequential access (const-only version!)

Definition at line 199 of file VectorMap.h.

199 { return m_vct . rbegin () ; }
reverse_iterator rbegin() const
"rbegin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:199
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
reverse_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::rend ( ) const
inline

"rend" iterator for sequential access (const-only version!)

Definition at line 201 of file VectorMap.h.

201 { return m_vct . rend () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
reverse_iterator rend() const
"rend" iterator for sequential access (const-only version!)
Definition: VectorMap.h:201
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
reverse_iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::rend ( ) const
inline

"rend" iterator for sequential access (const-only version!)

Definition at line 201 of file VectorMap.h.

201 { return m_vct . rend () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
reverse_iterator rend() const
"rend" iterator for sequential access (const-only version!)
Definition: VectorMap.h:201
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::reserve ( size_type  num)
inline

reserve the space in the container for at least 'num' elements

Definition at line 498 of file VectorMap.h.

498 { m_vct.reserve ( num ) ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::reserve ( size_type  num)
inline

reserve the space in the container for at least 'num' elements

Definition at line 498 of file VectorMap.h.

498 { m_vct.reserve ( num ) ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::size ( ) const
inline

number of elements

Definition at line 492 of file VectorMap.h.

492 { return m_vct . size () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
size_type size() const
number of elements
Definition: VectorMap.h:492
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
size_type GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::size ( ) const
inline

number of elements

Definition at line 492 of file VectorMap.h.

492 { return m_vct . size () ; }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
size_type size() const
number of elements
Definition: VectorMap.h:492
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::swap ( VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  other)
inline

swap function, which 'swaps' the content of two containers

Definition at line 501 of file VectorMap.h.

502  {
503  std::swap ( m_vct , other.m_vct ) ;
504  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
void GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::swap ( VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  other)
inline

swap function, which 'swaps' the content of two containers

Definition at line 501 of file VectorMap.h.

502  {
503  std::swap ( m_vct , other.m_vct ) ;
504  }
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::update ( const key_type key,
const mapped_type mapped 
)
inline

forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the existing mapped value.

Attention
There is no STL analogue

The method is added on request from ATLAS (see Savannah report #21395 and #21394)

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout << "Value " << m[key] << std::endl ; // should be: V()
m.update ( key , val1 ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val1
m.update ( key , val2 ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val2
Parameters
keykey value
mappedmapped value
Returns
true if the existing value has been replaced

Definition at line 560 of file VectorMap.h.

562  {
563  _iterator result = lower_bound ( key ) ;
564  if ( end() == result || compare ( key , result -> first ) )
565  {
566  result = m_vct.insert ( result , value_type(key,mapped) ) ;
567  return false ;
568  }
569  else { result->second = mapped ; }
570  //
571  return true ;
572  }
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:141
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:480
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:118
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::update ( const key_type key,
const mapped_type mapped 
)
inline

forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the existing mapped value.

Attention
There is no STL analogue

The method is added on request from ATLAS (see Savannah report #21395 and #21394)

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout << "Value " << m[key] << std::endl ; // should be: V()
m.update ( key , val1 ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val1
m.update ( key , val2 ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val2
Parameters
keykey value
mappedmapped value
Returns
true if the existing value has been replaced

Definition at line 560 of file VectorMap.h.

562  {
563  _iterator result = lower_bound ( key ) ;
564  if ( end() == result || compare ( key , result -> first ) )
565  {
566  result = m_vct.insert ( result , value_type(key,mapped) ) ;
567  return false ;
568  }
569  else { result->second = mapped ; }
570  //
571  return true ;
572  }
_vector::iterator _iterator
the regular iterator (no export)
Definition: VectorMap.h:141
iterator lower_bound(const key_type &key) const
Definition: VectorMap.h:480
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
_vector m_vct
the underlying sorted vector of (key,mapped) pairs
Definition: VectorMap.h:855
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
std::pair< key_type, mapped_type > value_type
the actual storage item
Definition: VectorMap.h:118
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::update ( const value_type val)
inline

forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the mapped value.

Attention
There is no STL analogue

The method is added on request from ATLAS (see Savannah report #21395 and #21394)

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout << "Value " << m[key] << std::endl ; // should be: V()
m.update ( std::make_pair ( key , val1 ) ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val1
m.update ( std::make_pair ( key , val2 ) ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val2
Parameters
vala pair of (key,value)
Returns
true if the existing value has been replaced

Definition at line 602 of file VectorMap.h.

603  { return update ( val.first , val.second ) ; }
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:560
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::update ( const value_type val)
inline

forced insertion of the key/mapped pair The method acts like "insert" but it DOES overwrite the mapped value.

Attention
There is no STL analogue

The method is added on request from ATLAS (see Savannah report #21395 and #21394)

K key = ... ;
V val1 = ... ;
V val2 = ... ;
std::cout << "Value " << m[key] << std::endl ; // should be: V()
m.update ( std::make_pair ( key , val1 ) ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val1
m.update ( std::make_pair ( key , val2 ) ) ;
std::cout << "Value " << m[key] << std::endl ; // should be: val2
Parameters
vala pair of (key,value)
Returns
true if the existing value has been replaced

Definition at line 602 of file VectorMap.h.

603  { return update ( val.first , val.second ) ; }
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:560
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::upper_bound ( const key_type key) const
inline

Definition at line 482 of file VectorMap.h.

483  { return std::upper_bound ( begin () , end () , key , compare () ) ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
iterator GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::upper_bound ( const key_type key) const
inline

Definition at line 482 of file VectorMap.h.

483  { return std::upper_bound ( begin () , end () , key , compare () ) ; }
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:197
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
const compare_type & compare() const
get the comparison criteria itself
Definition: VectorMap.h:752
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::value_at ( const size_t  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 804 of file VectorMap.h.

805  {
806  if ( index >= size() )
807  { this->throw_out_of_range_exception () ; }
808  const_iterator it = this->begin() ;
809  std::advance ( it , index ) ;
810  return it -> second ;
811  }
constexpr double second
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:148
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:28
size_type size() const
number of elements
Definition: VectorMap.h:492
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
const mapped_type& GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::value_at ( const size_t  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 804 of file VectorMap.h.

805  {
806  if ( index >= size() )
807  { this->throw_out_of_range_exception () ; }
808  const_iterator it = this->begin() ;
809  std::advance ( it , index ) ;
810  return it -> second ;
811  }
constexpr double second
iterator begin() const
"begin" iterator for sequential access (const-only version!)
Definition: VectorMap.h:195
_vector::const_iterator const_iterator
visible const_iterator (exported)
Definition: VectorMap.h:148
void throw_out_of_range_exception() const
throw std::out_of_range exception
Definition: MapBase.cpp:28
size_type size() const
number of elements
Definition: VectorMap.h:492

Friends And Related Function Documentation

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator!= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 520 of file VectorMap.h.

522  { return !( left == right ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator!= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 520 of file VectorMap.h.

522  { return !( left == right ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
std::ostream& operator<< ( std::ostream &  str,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &   
)
friend

printout to ostream - not implemented

Definition at line 761 of file VectorMap.h.

761 { return str ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
std::ostream& operator<< ( std::ostream &  str,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &   
)
friend

printout to ostream - not implemented

Definition at line 761 of file VectorMap.h.

761 { return str ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator<= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 526 of file VectorMap.h.

528  { return !( right < left ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator<= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 526 of file VectorMap.h.

528  { return !( right < left ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator> ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 517 of file VectorMap.h.

519  { return right < left ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator> ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 517 of file VectorMap.h.

519  { return right < left ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator>= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 523 of file VectorMap.h.

525  { return !( left < right ) ; }
template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
bool operator>= ( const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  left,
const VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &  right 
)
friend

Definition at line 523 of file VectorMap.h.

525  { return !( left < right ) ; }

Member Data Documentation

template<class KEY, class VALUE, class KEYCOMPARE = std::less<const KEY>, class ALLOCATOR = std::allocator<std::pair<KEY,VALUE> >>
_vector GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::m_vct
private

the underlying sorted vector of (key,mapped) pairs

Definition at line 855 of file VectorMap.h.


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