CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::Association< C > Class Template Reference

#include <Association.h>

Inheritance diagram for edm::Association< C >:
edm::ValueMap< int >

Classes

class  Filler
 

Public Types

typedef ValueMap< indexbase
 
typedef std::vector< std::pair< ProductID, offset > > id_offset_vector
 meant to be used in AssociativeIterator, not by the ordinary user More...
 
typedef int index
 
typedef base::offset offset
 
typedef Ref< typename refprod_type::product_typereference_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 (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 More...
 
const id_offset_vectorids () const
 meant to be used in AssociativeIterator, not by the ordinary user More...
 
Association< C > & operator+= (const Association< C > &o)
 
Associationoperator= (Association const &rhs)
 
template<typename RefKey >
reference_type operator[] (const RefKey &r) const
 
size_t rawIndexOf (ProductID id, size_t idx) const
 
refprod_type ref () const
 
void setRef (const refprod_type &ref)
 
size_t size () const
 
void swap (Association &other)
 

Static Public Member Functions

static short Class_Version ()
 

Private Member Functions

void add (const Association< C > &o)
 
void throwIndexMapBound () const
 
void throwRefSet () const
 
- Private Member Functions inherited from edm::ValueMap< int >
const_iterator begin () const
 
void clear ()
 
bool contains (ProductID id) const
 
bool empty () const
 
const_iterator end () const
 
reference_type get (ProductID id, size_t idx)
 
const_reference_type get (ProductID id, size_t idx) const
 
const_reference_type get (size_t idx) const
 meant to be used in AssociativeIterator, not by the ordinary user More...
 
const id_offset_vectorids () const
 meant to be used in AssociativeIterator, not by the ordinary user More...
 
size_t idSize () const
 
ValueMap< int > & operator+= (const ValueMap< int > &o)
 
ValueMapoperator= (ValueMap const &rhs)
 
reference_type operator[] (const RefKey &r)
 
const_reference_type operator[] (const RefKey &r) const
 
size_t rawIndexOf (ProductID id, size_t idx) const
 
void shrink_to_fit ()
 
size_t size () const
 
void swap (ValueMap &other)
 
 ValueMap ()
 
id_offset_vector::const_iterator getIdOffset (ProductID id) const
 
void throwIndexBound () const
 

Private Attributes

refprod_type ref_
 
- Private Attributes inherited from edm::ValueMap< int >
id_offset_vector ids_
 
container values_
 

Friends

class helper::Filler< Association< C > >
 

Additional Inherited Members

- Private Types inherited from edm::ValueMap< int >
typedef container::const_reference const_reference_type
 
typedef std::vector< value_typecontainer
 
typedef helper::Filler< ValueMap< int > > Filler
 
typedef std::vector< std::pair< ProductID, offset > > id_offset_vector
 
typedef unsigned int offset
 
typedef container::reference reference_type
 
typedef int value_type
 
- Static Private Member Functions inherited from edm::ValueMap< int >
static short Class_Version ()
 

Detailed Description

template<typename C>
class edm::Association< C >

Definition at line 18 of file Association.h.

Member Typedef Documentation

◆ base

template<typename C>
typedef ValueMap<index> edm::Association< C >::base

Definition at line 21 of file Association.h.

◆ id_offset_vector

template<typename C>
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 112 of file ValueMap.h.

◆ index

template<typename C>
typedef int edm::Association< C >::index

Definition at line 20 of file Association.h.

◆ offset

template<typename C>
typedef base::offset edm::Association< C >::offset

Definition at line 22 of file Association.h.

◆ reference_type

template<typename C>
typedef Ref<typename refprod_type::product_type> edm::Association< C >::reference_type

Definition at line 24 of file Association.h.

◆ refprod_type

template<typename C>
typedef edm::RefProd<C> edm::Association< C >::refprod_type

Definition at line 23 of file Association.h.

Constructor & Destructor Documentation

◆ Association() [1/2]

template<typename C>
edm::Association< C >::Association ( )
inline

Definition at line 26 of file Association.h.

26 : base() {}

◆ Association() [2/2]

template<typename C>
template<typename H >
edm::Association< C >::Association ( const H &  h)
inlineexplicit

Definition at line 28 of file Association.h.

28 : base(), ref_(h) {}

Member Function Documentation

◆ add()

template<typename C>
void edm::Association< C >::add ( const Association< C > &  o)
inlineprivate

◆ Class_Version()

template<typename C>
static short edm::Association< C >::Class_Version ( )
inlinestatic

Definition at line 95 of file Association.h.

97 :

◆ clear()

template<typename C>
void edm::Association< C >::clear ( void  )
inline

Definition at line 66 of file Association.h.

66 { base::clear(); }

References edm::ValueMap< T >::clear().

Referenced by BeautifulSoup.Tag::setString().

◆ contains()

template<typename C>
bool edm::Association< C >::contains ( ProductID  id) const
inline

◆ empty()

template<typename C>
bool edm::Association< C >::empty ( ) const
inline

Definition at line 65 of file Association.h.

65 { return base::empty(); }

References edm::ValueMap< T >::empty().

◆ get() [1/2]

template<typename C>
reference_type edm::Association< C >::get ( ProductID  id,
size_t  idx 
) const
inline

◆ get() [2/2]

template<typename C>
reference_type edm::Association< C >::get ( size_t  rawIdx) const
inline

◆ ids()

template<typename C>
const id_offset_vector& edm::Association< C >::ids ( ) const
inline

meant to be used in AssociativeIterator, not by the ordinary user

Definition at line 90 of file Association.h.

90 { return ids_; }

References edm::ValueMap< int >::ids_.

◆ operator+=()

template<typename C>
Association<C>& edm::Association< C >::operator+= ( const Association< C > &  o)
inline

Definition at line 51 of file Association.h.

51  {
52  add(o);
53  return *this;
54  }

References edm::Association< C >::add(), and EcalTangentSkim_cfg::o.

◆ operator=()

template<typename C>
Association& edm::Association< C >::operator= ( Association< C > const &  rhs)
inline

Definition at line 72 of file Association.h.

72  {
73  Association temp(rhs);
74  this->swap(temp);
75  return *this;
76  }

References edm::Association< C >::swap(), and groupFilesInBlocks::temp.

◆ operator[]()

template<typename C>
template<typename RefKey >
reference_type edm::Association< C >::operator[] ( const RefKey &  r) const
inline

Definition at line 34 of file Association.h.

34  {
35  return get(r.id(), r.key());
36  }

References edm::Association< C >::get(), and alignCSCRings::r.

◆ rawIndexOf()

template<typename C>
size_t edm::ValueMap< T >::rawIndexOf
inline

Definition at line 134 of file ValueMap.h.

134  {
135  typename id_offset_vector::const_iterator f = getIdOffset(id);
136  if (f == ids_.end())
138  offset off = f->second;
139  size_t j = off + idx;
140  if (j >= values_.size())
141  throwIndexBound();
142  return j;
143  }

◆ ref()

template<typename C>
refprod_type edm::Association< C >::ref ( ) const
inline

Definition at line 67 of file Association.h.

67 { return ref_; }

References edm::Association< C >::ref_.

Referenced by reco::utilsNew::CandMatcher< C >::ref(), and edm::Association< C >::setRef().

◆ setRef()

template<typename C>
void edm::Association< C >::setRef ( const refprod_type ref)
inline

Definition at line 55 of file Association.h.

55  {
56  if (ref_.isNull()) {
57  ref_ = ref;
58  } else {
59  if (ref_.id() != ref.id())
60  throwRefSet();
61  }
62  }

References edm::RefProd< C >::id(), edm::RefProd< C >::isNull(), edm::Association< C >::ref(), edm::Association< C >::ref_, and edm::Association< C >::throwRefSet().

◆ size()

template<typename C>
size_t edm::Association< C >::size ( void  ) const
inline

◆ swap()

template<typename C>
void edm::Association< C >::swap ( Association< C > &  other)
inline

◆ throwIndexMapBound()

template<typename C>
void edm::Association< C >::throwIndexMapBound ( ) const
inlineprivate

Definition at line 99 of file Association.h.

99  {
100  Exception::throwThis(errors::InvalidReference, "Association: index in the map out of upper boundary\n");
101  }

References edm::errors::InvalidReference, and edm::Exception::throwThis().

Referenced by edm::Association< C >::get().

◆ throwRefSet()

template<typename C>
void edm::Association< C >::throwRefSet ( ) const
inlineprivate

Definition at line 102 of file Association.h.

102  {
103  Exception::throwThis(errors::InvalidReference, "Association: reference to product already set\n");
104  }

References edm::errors::InvalidReference, and edm::Exception::throwThis().

Referenced by edm::Association< C >::setRef().

Friends And Related Function Documentation

◆ helper::Filler< Association< C > >

template<typename C>
friend class helper::Filler< Association< C > >
friend

Definition at line 112 of file Association.h.

Member Data Documentation

◆ ref_

template<typename C>
refprod_type edm::Association< C >::ref_
private
mps_fire.i
i
Definition: mps_fire.py:428
edm::ValueMap::clear
void clear()
Definition: ValueMap.h:159
edm::RefProd::id
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:124
edm::errors::InvalidReference
Definition: EDMException.h:39
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::ValueMap< int >::throwNotExisting
void throwNotExisting() const
Definition: ValueMap.h:259
edm::Association::base
ValueMap< index > base
Definition: Association.h:21
edm::Association::throwRefSet
void throwRefSet() const
Definition: Association.h:102
edm::ValueMap< int >::ids_
id_offset_vector ids_
Definition: ValueMap.h:242
edm::Association::refprod_type
edm::RefProd< C > refprod_type
Definition: Association.h:23
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
edm::ValueMap::empty
bool empty() const
Definition: ValueMap.h:158
edm::RefProd::isNull
bool isNull() const
Checks for null.
Definition: RefProd.h:115
trackingPlots.other
other
Definition: trackingPlots.py:1467
h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
edm::ValueMap< int >::values_
container values_
Definition: ValueMap.h:241
edm::RefProd::swap
void swap(RefProd< C > &)
Definition: RefProd.h:173
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
edm::ValueMap::swap
void swap(ValueMap &other)
Definition: ValueMap.h:118
edm::Association::add
void add(const Association< C > &o)
Definition: Association.h:106
edm::Association::ref
refprod_type ref() const
Definition: Association.h:67
edm::Association::ref_
refprod_type ref_
Definition: Association.h:98
edm::Association::Association
Association()
Definition: Association.h:26
edm::ValueMap< int >::Filler
helper::Filler< ValueMap< int > > Filler
Definition: ValueMap.h:168
edm::ValueMap< int >::throwIndexBound
void throwIndexBound() const
Definition: ValueMap.h:251
edm::Association::offset
base::offset offset
Definition: Association.h:22
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::Association::reference_type
Ref< typename refprod_type::product_type > reference_type
Definition: Association.h:24
edm::Association::get
reference_type get(size_t rawIdx) const
meant to be used internally or in AssociativeIterator, not by the ordinary user
Definition: Association.h:39
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
edm::ValueMap< int >::rawIndexOf
size_t rawIndexOf(ProductID id, size_t idx) const
Definition: ValueMap.h:134
edm::Association::throwIndexMapBound
void throwIndexMapBound() const
Definition: Association.h:99
edm::ValueMap::contains
bool contains(ProductID id) const
Definition: ValueMap.h:155
edm::Association::index
int index
Definition: Association.h:20
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Association::swap
void swap(Association &other)
Definition: Association.h:68
edm::ValueMap< int >::getIdOffset
id_offset_vector::const_iterator getIdOffset(ProductID id) const
Definition: ValueMap.h:244
edm::ValueMap::size
size_t size() const
Definition: ValueMap.h:156