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 | Private Member Functions | Private Attributes | Friends
edm::Association< C > Struct 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)
 

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
 
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
 

Detailed Description

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

Definition at line 19 of file Association.h.

Member Typedef Documentation

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

Definition at line 22 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 104 of file ValueMap.h.

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

Definition at line 21 of file Association.h.

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

Definition at line 23 of file Association.h.

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

Definition at line 25 of file Association.h.

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

Definition at line 24 of file Association.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file Association.h.

27 : base() { }
ValueMap< index > base
Definition: Association.h:22
template<typename C>
template<typename H >
edm::Association< C >::Association ( const H &  h)
inlineexplicit

Definition at line 29 of file Association.h.

29 : base(), ref_(h) { }
refprod_type ref_
Definition: Association.h:98
ValueMap< index > base
Definition: Association.h:22
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Function Documentation

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

Definition at line 106 of file Association.h.

References edm::Association< C >::Filler::add(), and edm::helper::Filler< Map >::fill().

Referenced by edm::Association< C >::operator+=().

106  {
107  Filler filler(*this);
108  filler.add(o);
109  filler.fill();
110  }
helper::Filler< ValueMap< int > > Filler
Definition: ValueMap.h:157
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 63 of file Association.h.

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

Referenced by LumiList.LumiList::__contains__().

63 { return base::contains(id); }
bool contains(ProductID id) const
Definition: ValueMap.h:149
template<typename C>
bool edm::Association< C >::empty ( ) const
inline
template<typename C>
reference_type edm::Association< C >::get ( size_t  rawIdx) const
inline

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

Definition at line 40 of file Association.h.

References i, gen::k, edm::Association< C >::ref_, edm::Association< C >::throwIndexMapBound(), and edm::ValueMap< int >::values_.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

40  {
41  index i = values_[rawIdx];
42  if(i < 0) return reference_type();
43  size_t k = i;
44  if (k >= ref_->size()) throwIndexMapBound();
45  return reference_type(ref_,k);
46  }
int i
Definition: DBlmapReader.cc:9
refprod_type ref_
Definition: Association.h:98
Ref< typename refprod_type::product_type > reference_type
Definition: Association.h:25
int k[5][pyjets_maxn]
void throwIndexMapBound() const
Definition: Association.h:99
container values_
Definition: ValueMap.h:208
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 90 of file Association.h.

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

90 { return ids_; }
id_offset_vector ids_
Definition: ValueMap.h:209
template<typename C>
Association<C>& edm::Association< C >::operator+= ( const Association< C > &  o)
inline

Definition at line 52 of file Association.h.

References edm::Association< C >::add().

52  {
53  add(o);
54  return *this;
55  }
void add(const Association< C > &o)
Definition: Association.h:106
template<typename C>
Association& edm::Association< C >::operator= ( Association< C > const &  rhs)
inline

Definition at line 72 of file Association.h.

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

72  {
73  Association temp(rhs);
74  this->swap(temp);
75  return *this;
76  }
void swap(Association &other)
Definition: Association.h:68
template<typename C>
template<typename RefKey >
reference_type edm::Association< C >::operator[] ( const RefKey &  r) const
inline

Definition at line 35 of file Association.h.

35  {
36  return get(r.id(), r.key());
37  }
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 56 of file Association.h.

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

56  {
57  if(ref_.isNull() ) {
58  ref_ = ref;
59  } else {
60  if(ref_.id() != ref.id()) throwRefSet();
61  }
62  }
refprod_type ref() const
Definition: Association.h:67
refprod_type ref_
Definition: Association.h:98
bool isNull() const
Checks for null.
Definition: RefProd.h:131
void throwRefSet() const
Definition: Association.h:102
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:140
template<typename C>
size_t edm::Association< C >::size ( void  ) const
inline

Definition at line 64 of file Association.h.

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

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

Definition at line 68 of file Association.h.

References edm::Association< C >::ref_, edm::ValueMap< T >::swap(), and edm::RefProd< T >::swap().

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

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

Definition at line 99 of file Association.h.

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

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

99  {
100  Exception::throwThis(errors::InvalidReference, "Association: index in the map out of upper boundary\n");
101  }
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 102 of file Association.h.

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

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

102  {
103  Exception::throwThis(errors::InvalidReference, "Association: reference to product already set\n");
104  }
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 112 of file Association.h.

Member Data Documentation

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