#include <DataFormats/Common/interface/ValueMap.h>
Public Types | |
typedef container::const_reference | const_reference_type |
typedef std::vector< value_type > | container |
typedef helper::Filler < ValueMap< T > > | Filler |
typedef std::vector< std::pair < ProductID, offset > > | id_offset_vector |
typedef unsigned int | offset |
typedef container::reference | reference_type |
typedef T | value_type |
Public Member Functions | |
const_iterator | begin () const |
void | clear () |
bool | contains (ProductID id) const |
bool | empty () const |
const_iterator | end () const |
const_reference_type | get (size_t idx) const |
meant to be used in AssociativeIterator, not by the ordinary user | |
reference_type | get (ProductID id, size_t idx) |
const_reference_type | get (ProductID id, size_t idx) const |
const id_offset_vector & | ids () const |
meant to be used in AssociativeIterator, not by the ordinary user | |
size_t | idSize () const |
ValueMap< T > & | operator+= (const ValueMap< T > &o) |
ValueMap & | operator= (ValueMap const &rhs) |
template<typename RefKey> | |
reference_type | operator[] (const RefKey &r) |
template<typename RefKey> | |
const_reference_type | operator[] (const RefKey &r) const |
size_t | rawIndexOf (ProductID id, size_t idx) const |
size_t | size () const |
void | swap (ValueMap &other) |
ValueMap () | |
Protected Member Functions | |
id_offset_vector::const_iterator | getIdOffset (ProductID id) const |
void | throwIndexBound () const |
Protected Attributes | |
id_offset_vector | ids_ |
container | values_ |
Private Member Functions | |
void | add (const ValueMap< T > &o) |
void | throwNotExisting () const |
Friends | |
class | helper::Filler< ValueMap< T > > |
Classes | |
struct | const_iterator |
struct | IDComparator |
Definition at line 96 of file ValueMap.h.
typedef container::const_reference edm::ValueMap< T >::const_reference_type |
Definition at line 103 of file ValueMap.h.
typedef std::vector<value_type> edm::ValueMap< T >::container |
Definition at line 99 of file ValueMap.h.
typedef helper::Filler<ValueMap<T> > edm::ValueMap< T >::Filler |
Definition at line 154 of file ValueMap.h.
typedef std::vector<std::pair<ProductID, offset> > edm::ValueMap< T >::id_offset_vector |
Definition at line 101 of file ValueMap.h.
typedef unsigned int edm::ValueMap< T >::offset |
typedef container::reference edm::ValueMap< T >::reference_type |
typedef T edm::ValueMap< T >::value_type |
Definition at line 98 of file ValueMap.h.
edm::ValueMap< T >::ValueMap | ( | ) | [inline] |
void edm::ValueMap< T >::add | ( | const ValueMap< T > & | o | ) | [inline, private] |
Definition at line 226 of file ValueMap.h.
00226 { 00227 Filler filler(*this); 00228 filler.add(o); 00229 filler.fill(); 00230 }
const_iterator edm::ValueMap< T >::begin | ( | ) | const [inline] |
void edm::ValueMap< T >::clear | ( | void | ) | [inline] |
Reimplemented in edm::Association< C >.
Definition at line 152 of file ValueMap.h.
Referenced by edm::Association< C >::clear().
bool edm::ValueMap< T >::contains | ( | ProductID | id | ) | const [inline] |
Reimplemented in edm::Association< C >.
Definition at line 146 of file ValueMap.h.
Referenced by edm::Association< C >::contains(), and pat::helper::RefHelper< T >::recursiveLookup().
00146 { 00147 return getIdOffset(id) != ids_.end(); 00148 }
bool edm::ValueMap< T >::empty | ( | ) | const [inline] |
Reimplemented in edm::Association< C >.
Definition at line 151 of file ValueMap.h.
00151 { return values_.empty(); }
const_iterator edm::ValueMap< T >::end | ( | ) | const [inline] |
const_reference_type edm::ValueMap< T >::get | ( | size_t | idx | ) | const [inline] |
meant to be used in AssociativeIterator, not by the ordinary user
Reimplemented in edm::Association< C >.
Definition at line 199 of file ValueMap.h.
00199 { return values_[idx]; }
reference_type edm::ValueMap< T >::get | ( | ProductID | id, | |
size_t | idx | |||
) | [inline] |
Definition at line 138 of file ValueMap.h.
00138 { 00139 return values_[rawIndexOf(id,idx)]; 00140 }
const_reference_type edm::ValueMap< T >::get | ( | ProductID | id, | |
size_t | idx | |||
) | const [inline] |
Reimplemented in edm::Association< C >.
Definition at line 131 of file ValueMap.h.
00131 { 00132 return values_[rawIndexOf(id,idx)]; 00133 }
id_offset_vector::const_iterator edm::ValueMap< T >::getIdOffset | ( | ProductID | id | ) | const [inline, protected] |
Definition at line 204 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::contains(), and edm::ValueMap< edm::Ptr >::rawIndexOf().
00204 { 00205 typename id_offset_vector::const_iterator i = std::lower_bound(ids_.begin(), ids_.end(), id, IDComparator()); 00206 if(i==ids_.end()) return i; 00207 return i->first == id ? i : ids_.end(); 00208 }
const id_offset_vector& edm::ValueMap< T >::ids | ( | ) | const [inline] |
meant to be used in AssociativeIterator, not by the ordinary user
Reimplemented in edm::Association< C >.
Definition at line 197 of file ValueMap.h.
00197 { return ids_; }
size_t edm::ValueMap< T >::idSize | ( | ) | const [inline] |
ValueMap<T>& edm::ValueMap< T >::operator+= | ( | const ValueMap< T > & | o | ) | [inline] |
ValueMap& edm::ValueMap< T >::operator= | ( | ValueMap< T > const & | rhs | ) | [inline] |
reference_type edm::ValueMap< T >::operator[] | ( | const RefKey & | r | ) | [inline] |
const_reference_type edm::ValueMap< T >::operator[] | ( | const RefKey & | r | ) | const [inline] |
size_t edm::ValueMap< T >::rawIndexOf | ( | ProductID | id, | |
size_t | idx | |||
) | const [inline] |
Definition at line 123 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::get().
00123 { 00124 typename id_offset_vector::const_iterator f = getIdOffset(id); 00125 if(f==ids_.end()) throwNotExisting(); 00126 offset off = f->second; 00127 size_t j = off+idx; 00128 if(j >= values_.size()) throwIndexBound(); 00129 return j; 00130 }
size_t edm::ValueMap< T >::size | ( | void | ) | const [inline] |
Reimplemented in edm::Association< C >.
Definition at line 149 of file ValueMap.h.
Referenced by CandIsolatorFromDeposits::produce(), and TrackProducerWithSCAssociation::produce().
00149 { return values_.size(); }
void edm::ValueMap< T >::swap | ( | ValueMap< T > & | other | ) | [inline] |
Definition at line 107 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::operator=(), and edm::swap().
void edm::ValueMap< T >::throwIndexBound | ( | ) | const [inline, protected] |
Definition at line 210 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::rawIndexOf().
00210 { 00211 throw Exception(errors::InvalidReference) 00212 << "ValueMap: index out of upper boundary\n"; 00213 }
void edm::ValueMap< T >::throwNotExisting | ( | ) | const [inline, private] |
Definition at line 221 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::rawIndexOf().
00221 { 00222 throw Exception(errors::InvalidReference) 00223 << "ValueMap: no associated value for given product and index\n"; 00224 }
friend class helper::Filler< ValueMap< T > > [friend] |
Definition at line 232 of file ValueMap.h.
id_offset_vector edm::ValueMap< T >::ids_ [protected] |
Definition at line 202 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::begin(), edm::ValueMap< edm::Ptr >::clear(), edm::ValueMap< edm::Ptr >::contains(), edm::ValueMap< edm::Ptr >::end(), edm::ValueMap< edm::Ptr >::getIdOffset(), edm::ValueMap< edm::Ptr >::ids(), edm::ValueMap< edm::Ptr >::idSize(), edm::ValueMap< edm::Ptr >::rawIndexOf(), and edm::ValueMap< edm::Ptr >::swap().
container edm::ValueMap< T >::values_ [protected] |
Definition at line 201 of file ValueMap.h.
Referenced by edm::ValueMap< edm::Ptr >::begin(), edm::ValueMap< edm::Ptr >::clear(), edm::ValueMap< edm::Ptr >::empty(), edm::ValueMap< edm::Ptr >::end(), edm::ValueMap< edm::Ptr >::get(), edm::ValueMap< edm::Ptr >::rawIndexOf(), edm::ValueMap< edm::Ptr >::size(), and edm::ValueMap< edm::Ptr >::swap().