CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edm::reftobase::Holder< T, REF > Class Template Reference

#include <EDProductfwd.h>

Inheritance diagram for edm::reftobase::Holder< T, REF >:
edm::reftobase::BaseHolder< T >

Public Member Functions

BaseHolder< T > * clone () const override
 
bool fillRefIfMyTypeMatches (RefHolderBase &fillme, std::string &msg) const override
 
T const * getPtr () const override
 
REF const & getRef () const
 
 Holder ()
 
 Holder (Holder const &other)
 
 Holder (REF const &iRef)
 
std::unique_ptr< RefHolderBaseholder () const override
 
ProductID id () const override
 
bool isAvailable () const override
 
bool isEqualTo (BaseHolder< T > const &rhs) const override
 
bool isTransient () const override
 
size_t key () const override
 
std::unique_ptr< BaseVectorHolder< T > > makeVectorHolder () const override
 
Holderoperator= (Holder const &rhs)
 
EDProductGetter const * productGetter () const override
 
void swap (Holder &other)
 
 ~Holder () override
 
- Public Member Functions inherited from edm::reftobase::BaseHolder< T >
 BaseHolder ()
 
void swap (BaseHolder &)
 
virtual ~BaseHolder ()
 

Static Public Member Functions

static short Class_Version ()
 
- Static Public Member Functions inherited from edm::reftobase::BaseHolder< T >
static short Class_Version ()
 

Private Attributes

REF ref_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::reftobase::BaseHolder< T >
 BaseHolder (BaseHolder const &other)
 
BaseHolderoperator= (BaseHolder const &rhs)
 

Detailed Description

template<class T, class REF>
class edm::reftobase::Holder< T, REF >

Definition at line 34 of file EDProductfwd.h.

Constructor & Destructor Documentation

template<class T , class REF >
edm::reftobase::Holder< T, REF >::Holder ( )
inline

Definition at line 61 of file Holder.h.

Referenced by edm::reftobase::Holder< T, REF >::clone().

61  : BaseHolder<T>(),
62  ref_()
63  { }
template<class T , class REF >
edm::reftobase::Holder< T, REF >::Holder ( Holder< T, REF > const &  other)
inline

Definition at line 67 of file Holder.h.

67  : BaseHolder<T>(other),
68  ref_(other.ref_)
69  { }
template<class T , class REF>
edm::reftobase::Holder< T, REF >::Holder ( REF const &  iRef)
inlineexplicit

Definition at line 73 of file Holder.h.

73  : BaseHolder<T>(),
74  ref_(r)
75  { }
template<class T , class REF >
edm::reftobase::Holder< T, REF >::~Holder ( )
inlineoverride

Definition at line 97 of file Holder.h.

98  { }

Member Function Documentation

template<class T, class REF>
static short edm::reftobase::Holder< T, REF >::Class_Version ( )
inlinestatic

Definition at line 49 of file Holder.h.

51 :
52  REF ref_;
template<class T , class REF >
BaseHolder< T > * edm::reftobase::Holder< T, REF >::clone ( void  ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 103 of file Holder.h.

References edm::reftobase::Holder< T, REF >::Holder().

104  {
105  return new Holder(*this);
106  }
template<class T , class REF >
bool edm::reftobase::Holder< T, REF >::fillRefIfMyTypeMatches ( RefHolderBase fillme,
std::string &  msg 
) const
overridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 151 of file Holder.h.

References dataset::name, edm::reftobase::Holder< T, REF >::ref_, and edm::reftobase::RefHolder< REF >::setRef().

153  {
154  RefHolder<REF>* h = dynamic_cast<RefHolder<REF>*>(&fillme);
155  bool conversion_worked = (h != nullptr);
156 
157  if (conversion_worked)
158  h->setRef(ref_);
159  else
160  msg = typeid(REF).name();
161 
162  return conversion_worked;
163  }
tuple msg
Definition: mps_check.py:277
template<class T , class REF >
T const * edm::reftobase::Holder< T, REF >::getPtr ( ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 111 of file Holder.h.

References edm::reftobase::Holder< T, REF >::ref_.

112  {
113  return ref_.operator->();
114  }
template<class T , class REF >
REF const & edm::reftobase::Holder< T, REF >::getRef ( ) const
inline

Definition at line 138 of file Holder.h.

References edm::reftobase::Holder< T, REF >::ref_.

Referenced by edm::reftobase::Holder< T, REF >::isEqualTo().

139  {
140  return ref_;
141  }
template<class T, class REF>
std::unique_ptr<RefHolderBase> edm::reftobase::Holder< T, REF >::holder ( ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 36 of file Holder.h.

36  {
37  return std::unique_ptr<RefHolderBase>( new RefHolder<REF>( ref_ ) );
38  }
template<class T , class REF >
ProductID edm::reftobase::Holder< T, REF >::id ( ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 119 of file Holder.h.

References edm::reftobase::Holder< T, REF >::ref_.

120  {
121  return ref_.id();
122  }
template<class T, class REF>
bool edm::reftobase::Holder< T, REF >::isAvailable ( ) const
inlineoverridevirtual

Checks if product collection is in memory or available in the Event. No type checking is done.

Implements edm::reftobase::BaseHolder< T >.

Definition at line 44 of file Holder.h.

44 { return ref_.isAvailable(); }
template<class T, class REF >
bool edm::reftobase::Holder< T, REF >::isEqualTo ( BaseHolder< T > const &  rhs) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 127 of file Holder.h.

References edm::reftobase::Holder< T, REF >::getRef().

128  {
129  Holder const* h = dynamic_cast<Holder const*>(&rhs);
130  return h && (getRef() == h->getRef());
131  // if (h == 0) return false;
132  // return getRef() == h->getRef();
133  }
REF const & getRef() const
Definition: Holder.h:138
template<class T, class REF>
bool edm::reftobase::Holder< T, REF >::isTransient ( ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 46 of file Holder.h.

46 { return ref_.isTransient(); }
template<class T , class REF >
size_t edm::reftobase::Holder< T, REF >::key ( ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 190 of file Holder.h.

References crabWrapper::key, and edm::reftobase::Holder< T, REF >::ref_.

191  {
192  typedef typename RefKeyTrait<REF>::type helper;
193  return helper::key( ref_ );
194  }
Definition: helper.py:1
template<typename T , typename REF >
std::unique_ptr< BaseVectorHolder< T > > edm::reftobase::Holder< T, REF >::makeVectorHolder ( ) const
overridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 175 of file Holder.h.

Referenced by edm::reftobase::Holder< reco::Candidate, reco::ElectronRef >::holder().

175  {
176  typedef typename HolderToVectorTrait<T, REF>::type helper;
177  return helper::makeVectorHolder();
178  }
Definition: helper.py:1
InvalidHolderToVector< T, REF > type
template<class T , class REF >
Holder< T, REF > & edm::reftobase::Holder< T, REF >::operator= ( Holder< T, REF > const &  rhs)
inline

Definition at line 80 of file Holder.h.

References edm::reftobase::Holder< T, REF >::swap(), and groupFilesInBlocks::temp.

81  {
82  Holder temp(rhs);
83  swap(temp);
84  return *this;
85  }
void swap(Holder &other)
Definition: Holder.h:90
template<class T , class REF >
EDProductGetter const * edm::reftobase::Holder< T, REF >::productGetter ( ) const
inlineoverridevirtual

Implements edm::reftobase::BaseHolder< T >.

Definition at line 145 of file Holder.h.

References edm::reftobase::Holder< T, REF >::ref_.

Referenced by edm::reftobase::Holder< reco::Candidate, reco::ElectronRef >::holder().

145  {
146  return ref_.productGetter();
147  }
template<class T , class REF >
void edm::reftobase::Holder< T, REF >::swap ( Holder< T, REF > &  other)
inline

Definition at line 90 of file Holder.h.

References edm::reftobase::Holder< T, REF >::ref_, and std::swap().

Referenced by edm::reftobase::Holder< T, REF >::operator=().

91  {
92  std::swap(ref_, other.ref_);
93  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

template<class T, class REF>
REF edm::reftobase::Holder< T, REF >::ref_
private