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 ()
 
std::unique_ptr< RefHolderBaseholder () const override
 
 Holder (Holder const &other)
 
 Holder (REF const &iRef)
 
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 45 of file EDProductfwd.h.

Constructor & Destructor Documentation

◆ Holder() [1/3]

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

Definition at line 58 of file Holder.h.

58 : BaseHolder<T>(), ref_() {}

◆ Holder() [2/3]

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

Definition at line 61 of file Holder.h.

61 : BaseHolder<T>(other), ref_(other.ref_) {}

◆ Holder() [3/3]

template<class T , class REF >
edm::reftobase::Holder< T, REF >::Holder ( REF const &  iRef)
inlineexplicit

Definition at line 64 of file Holder.h.

64 : BaseHolder<T>(), ref_(r) {}

◆ ~Holder()

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

Definition at line 79 of file Holder.h.

79 {}

Member Function Documentation

◆ Class_Version()

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

Definition at line 47 of file Holder.h.

49 :
50  REF ref_;

◆ clone()

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

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

Definition at line 82 of file Holder.h.

82  {
83  return new Holder(*this);
84  }

◆ fillRefIfMyTypeMatches()

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 115 of file Holder.h.

115  {
116  RefHolder<REF>* h = dynamic_cast<RefHolder<REF>*>(&fillme);
117  bool conversion_worked = (h != nullptr);
118 
119  if (conversion_worked)
120  h->setRef(ref_);
121  else
122  msg = typeid(REF).name();
123 
124  return conversion_worked;
125  }

References mps_check::msg, and Skims_PA_cff::name.

◆ getPtr()

template<class T , class REF >
T const * edm::reftobase::Holder< T, REF >::getPtr ( ) const
inlineoverridevirtual

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

Definition at line 87 of file Holder.h.

87  {
88  return ref_.operator->();
89  }

◆ getRef()

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

Definition at line 105 of file Holder.h.

105  {
106  return ref_;
107  }

◆ holder()

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 34 of file Holder.h.

34  {
35  return std::unique_ptr<RefHolderBase>(new RefHolder<REF>(ref_));
36  }

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

◆ id()

template<class T , class REF >
ProductID edm::reftobase::Holder< T, REF >::id ( ) const
inlineoverridevirtual

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

Definition at line 92 of file Holder.h.

92  {
93  return ref_.id();
94  }

References edm::ProductID::id().

◆ isAvailable()

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 42 of file Holder.h.

42 { return ref_.isAvailable(); }

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

◆ isEqualTo()

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 97 of file Holder.h.

97  {
98  Holder const* h = dynamic_cast<Holder const*>(&rhs);
99  return h && (getRef() == h->getRef());
100  // if (h == 0) return false;
101  // return getRef() == h->getRef();
102  }

References edm::getRef().

◆ isTransient()

template<class T , class REF >
bool edm::reftobase::Holder< T, REF >::isTransient ( ) const
inlineoverridevirtual

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

Definition at line 44 of file Holder.h.

44 { return ref_.isTransient(); }

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

◆ key()

template<class T , class REF >
size_t edm::reftobase::Holder< T, REF >::key ( ) const
inlineoverridevirtual

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

Definition at line 150 of file Holder.h.

150  {
151  typedef typename RefKeyTrait<REF>::type helper;
152  return helper::key(ref_);
153  }

References crabWrapper::key.

◆ makeVectorHolder()

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 137 of file Holder.h.

137  {
138  typedef typename HolderToVectorTrait<T, REF>::type helper;
139  return helper::makeVectorHolder();
140  }

◆ operator=()

template<class T , class REF >
Holder< T, REF > & edm::reftobase::Holder< T, REF >::operator= ( Holder< T, REF > const &  rhs)
inline

Definition at line 67 of file Holder.h.

67  {
68  Holder temp(rhs);
69  swap(temp);
70  return *this;
71  }

References edm::reftobase::swap(), and groupFilesInBlocks::temp.

◆ productGetter()

template<class T , class REF >
EDProductGetter const * edm::reftobase::Holder< T, REF >::productGetter ( ) const
inlineoverridevirtual

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

Definition at line 110 of file Holder.h.

110  {
111  return ref_.productGetter();
112  }

◆ swap()

template<class T , class REF >
void edm::reftobase::Holder< T, REF >::swap ( Holder< T, REF > &  other)
inline

Definition at line 74 of file Holder.h.

74  {
75  std::swap(ref_, other.ref_);
76  }

References trackingPlots::other, and std::swap().

Member Data Documentation

◆ ref_

template<class T , class REF >
REF edm::reftobase::Holder< T, REF >::ref_
private
edm::reftobase::Holder::ref_
REF ref_
Definition: Holder.h:50
edm::reftobase::Holder::Holder
Holder()
Definition: Holder.h:58
mps_check.msg
tuple msg
Definition: mps_check.py:285
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::reftobase::Holder::swap
void swap(Holder &other)
Definition: Holder.h:74
trackingPlots.other
other
Definition: trackingPlots.py:1464
h
edm::reftobase::RefKeyTrait::type
RefKey type
Definition: RefKeyTrait.h:29
helper
Definition: helper.py:1
edm::reftobase::Holder::getRef
REF const & getRef() const
Definition: Holder.h:105
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::reftobase::HolderToVectorTrait::type
InvalidHolderToVector< T, REF > type
Definition: HolderToVectorTrait.h:27
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
crabWrapper.key
key
Definition: crabWrapper.py:19