#include <Association.h>
Classes | |
class | Filler |
Public Types | |
typedef ValueMap< index > | base |
typedef std::vector< std::pair < ProductID, offset > > | id_offset_vector |
meant to be used in AssociativeIterator, not by the ordinary user | |
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 | |
Association () | |
template<typename H > | |
Association (const H &h) | |
void | clear () |
bool | contains (ProductID id) const |
bool | empty () const |
reference_type | get (size_t rawIdx) const |
meant to be used internally or in AssociativeIterator, not by the ordinary user | |
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 | |
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 > > |
Definition at line 18 of file Association.h.
typedef ValueMap<index> edm::Association< C >::base |
Definition at line 21 of file Association.h.
typedef std::vector<std::pair<ProductID, offset> > edm::ValueMap< T >::id_offset_vector |
meant to be used in AssociativeIterator, not by the ordinary user
Definition at line 103 of file ValueMap.h.
typedef int edm::Association< C >::index |
Definition at line 20 of file Association.h.
typedef base::offset edm::Association< C >::offset |
Reimplemented from edm::ValueMap< int >.
Definition at line 22 of file Association.h.
typedef Ref<typename refprod_type::product_type> edm::Association< C >::reference_type |
Reimplemented from edm::ValueMap< int >.
Definition at line 24 of file Association.h.
typedef edm::RefProd<C> edm::Association< C >::refprod_type |
Definition at line 23 of file Association.h.
edm::Association< C >::Association | ( | ) | [inline] |
Definition at line 26 of file Association.h.
: base() { }
edm::Association< C >::Association | ( | const H & | h | ) | [inline, explicit] |
Definition at line 28 of file Association.h.
void edm::Association< C >::add | ( | const Association< C > & | o | ) | [inline, private] |
Definition at line 101 of file Association.h.
References edm::Association< C >::Filler::add(), and edm::helper::Filler< Map >::fill().
Referenced by edm::Association< C >::operator+=().
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().
{ 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().
{ 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 edm::ValueMap< T >::empty().
{ return base::empty(); }
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, gen::k, edm::Association< C >::ref_, edm::Association< C >::throwIndexMapBound(), and edm::ValueMap< int >::values_.
{ index i = values_[rawIdx]; if(i < 0) return reference_type(); size_t k = i; if (k >= ref_->size()) throwIndexMapBound(); return reference_type(ref_,k); }
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().
{ return get(rawIndexOf(id,idx)); }
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_.
{ return ids_; }
Association<C>& edm::Association< C >::operator+= | ( | const Association< C > & | o | ) | [inline] |
Definition at line 51 of file Association.h.
References edm::Association< C >::add().
Association& edm::Association< C >::operator= | ( | Association< C > const & | rhs | ) | [inline] |
Definition at line 71 of file Association.h.
References edm::Association< C >::swap(), and cond::rpcobtemp::temp.
{ Association temp(rhs); this->swap(temp); return *this; }
reference_type edm::Association< C >::operator[] | ( | const RefKey & | r | ) | const [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 34 of file Association.h.
refprod_type edm::Association< C >::ref | ( | ) | const [inline] |
Definition at line 66 of file Association.h.
References edm::Association< C >::ref_.
Referenced by edm::Association< C >::Filler::add(), reco::utilsNew::CandMatcher< C >::ref(), and edm::Association< C >::setRef().
{ 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(), edm::Association< C >::ref_, and edm::Association< C >::throwRefSet().
size_t edm::Association< C >::size | ( | void | ) | const [inline] |
Reimplemented from edm::ValueMap< int >.
Definition at line 63 of file Association.h.
References edm::ValueMap< T >::size().
{ 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_, and edm::RefProd< C >::swap().
Referenced by edm::Association< C >::operator=(), and edm::swap().
{ this->ValueMap<int>::swap(other); ref_.swap(other.ref_); }
void edm::Association< C >::throwIndexMapBound | ( | ) | const [inline, private] |
Definition at line 94 of file Association.h.
References edm::errors::InvalidReference, and edm::Exception::throwThis().
Referenced by edm::Association< C >::get().
{ Exception::throwThis(errors::InvalidReference, "Association: index in the map out of upper boundary\n"); }
void edm::Association< C >::throwRefSet | ( | ) | const [inline, private] |
Definition at line 97 of file Association.h.
References edm::errors::InvalidReference, and edm::Exception::throwThis().
Referenced by edm::Association< C >::setRef().
{ Exception::throwThis(errors::InvalidReference, "Association: reference to product already set\n"); }
friend class helper::Filler< Association< C > > [friend] |
Definition at line 107 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().