CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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_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 More...
 
reference_type get (ProductID id, size_t idx) const
 
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
 
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
 
const_reference_type get (ProductID id, size_t idx) const
 
reference_type get (ProductID id, size_t idx)
 
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)
 
const_reference_type operator[] (const RefKey &r) const
 
reference_type operator[] (const RefKey &r)
 
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

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

Definition at line 21 of file Association.h.

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 109 of file ValueMap.h.

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

Definition at line 20 of file Association.h.

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

Definition at line 22 of file Association.h.

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

Definition at line 24 of file Association.h.

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

Definition at line 23 of file Association.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file Association.h.

26 : base() { }
ValueMap< index > base
Definition: Association.h:21
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) { }
refprod_type ref_
Definition: Association.h:97
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
ValueMap< index > base
Definition: Association.h:21

Member Function Documentation

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

Definition at line 105 of file Association.h.

Referenced by edm::Association< reco::FFTJPTJetCollection >::operator+=(), and counter.Counter::register().

105  {
106  Filler filler(*this);
107  filler.add(o);
108  filler.fill();
109  }
helper::Filler< ValueMap< int > > Filler
Definition: ValueMap.h:170
template<typename C>
static short edm::Association< C >::Class_Version ( )
inlinestatic

Definition at line 94 of file Association.h.

96 :
refprod_type ref_
Definition: Association.h:97
edm::RefProd< C > refprod_type
Definition: Association.h:23
template<typename C>
void edm::Association< C >::clear ( void  )
inline
template<typename C>
bool edm::Association< C >::contains ( ProductID  id) const
inline

Definition at line 62 of file Association.h.

Referenced by LumiList.LumiList::__contains__().

62 { return base::contains(id); }
bool contains(ProductID id) const
Definition: ValueMap.h:154
template<typename C>
bool edm::Association< C >::empty ( ) const
inline
template<typename C>
reference_type edm::Association< C >::get ( size_t  rawIdx) const
inline
template<typename C>
reference_type edm::Association< C >::get ( ProductID  id,
size_t  idx 
) const
inline
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 89 of file Association.h.

89 { return ids_; }
id_offset_vector ids_
Definition: ValueMap.h:222
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  }
void add(const Association< C > &o)
Definition: Association.h:105
template<typename C>
Association& edm::Association< C >::operator= ( Association< C > const &  rhs)
inline

Definition at line 71 of file Association.h.

71  {
72  Association temp(rhs);
73  this->swap(temp);
74  return *this;
75  }
void swap(Association &other)
Definition: Association.h:67
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  }
template<typename C>
refprod_type edm::Association< C >::ref ( ) const
inline
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()) throwRefSet();
60  }
61  }
refprod_type ref() const
Definition: Association.h:66
refprod_type ref_
Definition: Association.h:97
bool isNull() const
Checks for null.
Definition: RefProd.h:128
void throwRefSet() const
Definition: Association.h:101
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:137
template<typename C>
size_t edm::Association< C >::size ( void  ) const
inline

Definition at line 63 of file Association.h.

63 { return base::size(); }
size_t size() const
Definition: ValueMap.h:157
template<typename C>
void edm::Association< C >::swap ( Association< C > &  other)
inline

Definition at line 67 of file Association.h.

Referenced by edm::Association< reco::FFTJPTJetCollection >::operator=(), and edm::swap().

67  {
68  this->ValueMap<int>::swap(other);
69  ref_.swap(other.ref_);
70  }
refprod_type ref_
Definition: Association.h:97
void swap(ValueMap &other)
Definition: ValueMap.h:115
void swap(RefProd< C > &)
Definition: RefProd.h:190
template<typename C>
void edm::Association< C >::throwIndexMapBound ( ) const
inlineprivate

Definition at line 98 of file Association.h.

Referenced by edm::Association< reco::FFTJPTJetCollection >::get().

98  {
99  Exception::throwThis(errors::InvalidReference, "Association: index in the map out of upper boundary\n");
100  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
template<typename C>
void edm::Association< C >::throwRefSet ( ) const
inlineprivate

Definition at line 101 of file Association.h.

Referenced by edm::Association< reco::FFTJPTJetCollection >::setRef().

101  {
102  Exception::throwThis(errors::InvalidReference, "Association: reference to product already set\n");
103  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")

Friends And Related Function Documentation

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

Definition at line 111 of file Association.h.

Member Data Documentation

template<typename C>
refprod_type edm::Association< C >::ref_
private