CMS 3D CMS Logo

Classes | Public Types | 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 >

List of all members.

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
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_vectorids () const
 meant to be used in AssociativeIterator, not by the ordinary user
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 Attributes

refprod_type ref_

Friends

class helper::Filler< Association< C > >

Detailed Description

template<typename C>
class 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

Reimplemented from edm::ValueMap< int >.

Definition at line 23 of file Association.h.

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

Reimplemented from edm::ValueMap< int >.

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.

: base() { }
template<typename C>
template<typename H >
edm::Association< C >::Association ( const H &  h) [inline, explicit]

Definition at line 29 of file Association.h.

: base(), ref_(h) { }

Member Function Documentation

template<typename C>
void edm::Association< C >::add ( const Association< C > &  o) [inline, private]

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+=().

                                         {
      Filler filler(*this);
      filler.add(o);
      filler.fill();
    }
template<typename C>
void edm::Association< C >::clear ( void  ) [inline]

Reimplemented from edm::ValueMap< int >.

Definition at line 66 of file Association.h.

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

{ base::clear(); }
template<typename C>
bool edm::Association< C >::contains ( ProductID  id) const [inline]

Reimplemented from edm::ValueMap< int >.

Definition at line 63 of file Association.h.

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

{ return base::contains(id); }
template<typename C>
bool edm::Association< C >::empty ( ) const [inline]

Reimplemented from edm::ValueMap< int >.

Definition at line 65 of file Association.h.

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

{ return base::empty(); }
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

Reimplemented from edm::ValueMap< int >.

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

                                            { 
      index i = values_[rawIdx];
      if(i < 0) return reference_type(); 
      size_t k = i;
      if (k >= ref_->size()) throwIndexMapBound();
      return reference_type(ref_,k);
    }
template<typename C>
reference_type edm::Association< C >::get ( ProductID  id,
size_t  idx 
) const [inline]

Reimplemented from edm::ValueMap< int >.

Definition at line 48 of file Association.h.

References UserOptions_cff::idx, and edm::ValueMap< int >::rawIndexOf().

                                                       { 
      return get(rawIndexOf(id,idx));
    }
template<typename C>
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 90 of file Association.h.

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

{ return ids_; }
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().

                                                          {
      add(o);
      return *this;
    }
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.

                                                   {
      Association temp(rhs);
      this->swap(temp);
      return *this;
    }
template<typename C>
template<typename RefKey >
reference_type edm::Association< C >::operator[] ( const RefKey &  r) const [inline]

Reimplemented from edm::ValueMap< int >.

Definition at line 35 of file Association.h.

                                                        {
      return get(r.id(), r.key());
    }
template<typename C>
refprod_type edm::Association< C >::ref ( ) const [inline]
template<typename C>
void edm::Association< C >::setRef ( const refprod_type ref) [inline]
template<typename C>
size_t edm::Association< C >::size ( void  ) const [inline]

Reimplemented from edm::ValueMap< int >.

Definition at line 64 of file Association.h.

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

{ return base::size(); }
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_, and edm::RefProd< C >::swap().

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

                                  {
      this->ValueMap<int>::swap(other);
      ref_.swap(other.ref_);
    }
template<typename C>
void edm::Association< C >::throwIndexMapBound ( ) const [inline, private]

Definition at line 99 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");
    }
template<typename C>
void edm::Association< C >::throwRefSet ( ) const [inline, private]

Definition at line 102 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");
    }

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]