#include <DataFormats/Common/interface/Association.h>
Public Types | |
typedef ValueMap< index > | base |
typedef int | index |
typedef base::offset | offset |
typedef Ref< typename refprod_type::product_type > | reference_type |
typedef edm::RefProd< C > | refprod_type |
Public Member Functions | |
template<typename H> | |
Association (const H &h) | |
Association () | |
void | clear () |
bool | contains (ProductID id) const |
bool | empty () const |
reference_type | get (ProductID id, size_t idx) const |
reference_type | get (size_t rawIdx) const |
meant to be used internally or in AssociativeIterator, not by the ordinary user | |
const id_offset_vector & | ids () const |
meant to be used in AssociativeIterator, not by the ordinary user | |
Association< C > & | operator+= (const Association< C > &o) |
Association & | operator= (Association const &rhs) |
template<typename RefKey> | |
reference_type | operator[] (const RefKey &r) const |
refprod_type | ref () const |
void | setRef (const refprod_type &ref) |
size_t | size () const |
void | swap (Association &other) |
Private Member Functions | |
void | add (const Association< C > &o) |
void | throwIndexMapBound () const |
void | throwRefSet () const |
Private Attributes | |
refprod_type | ref_ |
Friends | |
class | helper::Filler< Association< C > > |
Classes | |
class | Filler |
Definition at line 18 of file Association.h.
typedef ValueMap<index> edm::Association< C >::base |
Definition at line 21 of file Association.h.
typedef int edm::Association< C >::index |
Definition at line 20 of file Association.h.
typedef base::offset edm::Association< C >::offset |
typedef Ref<typename refprod_type::product_type> edm::Association< C >::reference_type |
typedef edm::RefProd<C> edm::Association< C >::refprod_type |
Definition at line 23 of file Association.h.
edm::Association< C >::Association | ( | ) | [inline] |
edm::Association< C >::Association | ( | const H & | h | ) | [inline, explicit] |
void edm::Association< C >::add | ( | const Association< C > & | o | ) | [inline, private] |
Definition at line 103 of file Association.h.
References edm::Association< C >::Filler::add(), and edm::helper::Filler< Map >::fill().
00103 { 00104 Filler filler(*this); 00105 filler.add(o); 00106 filler.fill(); 00107 }
void edm::Association< C >::clear | ( | void | ) | [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 65 of file Association.h.
References edm::ValueMap< T >::clear().
00065 { base::clear(); }
bool edm::Association< C >::contains | ( | ProductID | id | ) | const [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 62 of file Association.h.
References edm::ValueMap< T >::contains().
00062 { return base::contains(id); }
bool edm::Association< C >::empty | ( | ) | const [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 64 of file Association.h.
References empty.
00064 { return base::empty(); }
reference_type edm::Association< C >::get | ( | ProductID | id, | |
size_t | idx | |||
) | const [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 47 of file Association.h.
References edm::ValueMap< int >::rawIndexOf().
00047 { 00048 return get(rawIndexOf(id,idx)); 00049 }
reference_type edm::Association< C >::get | ( | size_t | rawIdx | ) | const [inline] |
meant to be used internally or in AssociativeIterator, not by the ordinary user
Reimplemented from edm::ValueMap< int >.
Definition at line 39 of file Association.h.
References i, k, edm::Association< C >::ref_, edm::Association< C >::throwIndexMapBound(), and edm::ValueMap< int >::values_.
00039 { 00040 index i = values_[rawIdx]; 00041 if(i < 0) return reference_type(); 00042 size_t k = i; 00043 if (k >= ref_->size()) throwIndexMapBound(); 00044 return reference_type(ref_,k); 00045 }
const id_offset_vector& edm::Association< C >::ids | ( | ) | const [inline] |
meant to be used in AssociativeIterator, not by the ordinary user
Reimplemented from edm::ValueMap< int >.
Definition at line 89 of file Association.h.
References edm::ValueMap< int >::ids_.
00089 { return ids_; }
Association<C>& edm::Association< C >::operator+= | ( | const Association< C > & | o | ) | [inline] |
Association& edm::Association< C >::operator= | ( | Association< C > const & | rhs | ) | [inline] |
Definition at line 71 of file Association.h.
References edm::Association< C >::swap(), and pyDBSRunClass::temp.
00071 { 00072 Association temp(rhs); 00073 this->swap(temp); 00074 return *this; 00075 }
reference_type edm::Association< C >::operator[] | ( | const RefKey & | r | ) | const [inline] |
refprod_type edm::Association< C >::ref | ( | ) | const [inline] |
Definition at line 66 of file Association.h.
References edm::Association< C >::ref_.
Referenced by reco::utilsNew::CandMatcher< C >::operator[](), and reco::utilsNew::CandMatcher< C >::ref().
00066 { return ref_; }
void edm::Association< C >::setRef | ( | const refprod_type & | ref | ) | [inline] |
Definition at line 55 of file Association.h.
References edm::RefProd< C >::id(), edm::RefProd< C >::isNull(), edm::Association< C >::ref_, and edm::Association< C >::throwRefSet().
00055 { 00056 if(ref_.isNull() ) { 00057 ref_ = ref; 00058 } else { 00059 if(ref_.id() != ref.id()) throwRefSet(); 00060 } 00061 }
size_t edm::Association< C >::size | ( | void | ) | const [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 63 of file Association.h.
References size.
00063 { return base::size(); }
void edm::Association< C >::swap | ( | Association< C > & | other | ) | [inline] |
Definition at line 67 of file Association.h.
References edm::Association< C >::ref_, edm::RefProd< C >::swap(), and swap().
Referenced by edm::Association< C >::operator=(), and edm::swap().
00067 { 00068 this->ValueMap<int>::swap(other); 00069 ref_.swap(other.ref_); 00070 }
void edm::Association< C >::throwIndexMapBound | ( | ) | const [inline, private] |
Definition at line 94 of file Association.h.
References edm::errors::InvalidReference.
Referenced by edm::Association< C >::get().
00094 { 00095 throw Exception(errors::InvalidReference) 00096 << "Association: index in the map out of upper boundary\n"; 00097 }
void edm::Association< C >::throwRefSet | ( | ) | const [inline, private] |
Definition at line 98 of file Association.h.
References edm::errors::InvalidReference.
Referenced by edm::Association< C >::setRef().
00098 { 00099 throw Exception(errors::InvalidReference) 00100 << "Association: reference to product already set\n"; 00101 }
friend class helper::Filler< Association< C > > [friend] |
Definition at line 109 of file Association.h.
refprod_type edm::Association< C >::ref_ [private] |
Definition at line 93 of file Association.h.
Referenced by edm::Association< C >::get(), edm::Association< C >::ref(), edm::Association< C >::setRef(), and edm::Association< C >::swap().