CMS 3D CMS Logo

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

#include <EDProductfwd.h>

Inheritance diagram for edm::reftobase::RefHolder< REF >:
edm::reftobase::RefHolderBase

Public Member Functions

RefHolderBaseclone () const override
 
bool fillRefIfMyTypeMatches (RefHolderBase &fillme, std::string &msg) const override
 
REF const & getRef () const
 
ProductID id () const override
 
bool isAvailable () const override
 
bool isEqualTo (RefHolderBase const &rhs) const override
 
bool isTransient () const override
 
size_t key () const override
 
std::unique_ptr< RefVectorHolderBasemakeVectorHolder () const override
 
EDProductGetter const * productGetter () const override
 
 RefHolder ()
 
 RefHolder (REF const &ref)
 
void setRef (REF const &r)
 
void swap (RefHolder &other)
 
 ~RefHolder () override
 
- Public Member Functions inherited from edm::reftobase::RefHolderBase
template<class T >
T const * getPtr () const
 
 RefHolderBase ()
 
virtual ~RefHolderBase ()
 

Static Public Member Functions

static short Class_Version ()
 

Private Member Functions

void const * pointerToType (std::type_info const &iToType) const override
 

Private Attributes

REF ref_
 

Detailed Description

template<class REF>
class edm::reftobase::RefHolder< REF >

Definition at line 50 of file EDProductfwd.h.

Constructor & Destructor Documentation

◆ RefHolder() [1/2]

template<class REF >
edm::reftobase::RefHolder< REF >::RefHolder ( )

Definition at line 53 of file RefHolder_.h.

53 : RefHolderBase(), ref_() {}

◆ RefHolder() [2/2]

template<class REF >
edm::reftobase::RefHolder< REF >::RefHolder ( REF const &  ref)
explicit

Definition at line 56 of file RefHolder_.h.

56 : RefHolderBase(), ref_(ref) {}

◆ ~RefHolder()

template<class REF >
edm::reftobase::RefHolder< REF >::~RefHolder ( )
override

Definition at line 59 of file RefHolder_.h.

59 {}

Member Function Documentation

◆ Class_Version()

template<class REF>
static short edm::reftobase::RefHolder< REF >::Class_Version ( )
inlinestatic

Definition at line 42 of file RefHolder_.h.

43 :
44  void const* pointerToType(std::type_info const& iToType) const override;

◆ clone()

template<class REF >
RefHolderBase * edm::reftobase::RefHolder< REF >::clone ( void  ) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 62 of file RefHolder_.h.

62  {
63  return new RefHolder(ref_);
64  }

◆ fillRefIfMyTypeMatches()

template<class REF >
bool edm::reftobase::RefHolder< REF >::fillRefIfMyTypeMatches ( RefHolderBase fillme,
std::string &  msg 
) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 78 of file RefHolder_.h.

78  {
79  RefHolder* h = dynamic_cast<RefHolder*>(&fillme);
80  bool conversion_worked = (h != nullptr);
81  if (conversion_worked)
82  h->setRef(ref_);
83  else
84  msg = typeid(REF).name();
85  return conversion_worked;
86  }

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

◆ getRef()

template<class REF >
REF const & edm::reftobase::RefHolder< REF >::getRef ( ) const
inline

Definition at line 89 of file RefHolder_.h.

89  {
90  return ref_;
91  }

Referenced by edm::reftobase::RefVectorHolder< REFV >::push_back().

◆ id()

template<class REF >
ProductID edm::reftobase::RefHolder< REF >::id ( ) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 67 of file RefHolder_.h.

67  {
68  return ref_.id();
69  }

References edm::ProductID::id().

◆ isAvailable()

template<class REF>
bool edm::reftobase::RefHolder< REF >::isAvailable ( ) const
inlineoverridevirtual

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

Implements edm::reftobase::RefHolderBase.

Definition at line 37 of file RefHolder_.h.

37 { return ref_.isAvailable(); }

References edm::reftobase::RefHolder< REF >::ref_.

◆ isEqualTo()

template<class REF >
bool edm::reftobase::RefHolder< REF >::isEqualTo ( RefHolderBase const &  rhs) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 72 of file RefHolder_.h.

72  {
73  RefHolder const* h(dynamic_cast<RefHolder const*>(&rhs));
74  return h && (getRef() == h->getRef());
75  }

References edm::getRef(), and h.

◆ isTransient()

template<class REF>
bool edm::reftobase::RefHolder< REF >::isTransient ( ) const
inlineoverridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 39 of file RefHolder_.h.

39 { return ref_.isTransient(); }

References edm::reftobase::RefHolder< REF >::ref_.

◆ key()

template<class REF >
size_t edm::reftobase::RefHolder< REF >::key ( ) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 26 of file RefHolder.h.

26  {
27  typedef typename RefKeyTrait<REF>::type helper;
28  return helper::key(ref_);
29  }

References crabWrapper::key.

◆ makeVectorHolder()

template<class REF >
std::unique_ptr< RefVectorHolderBase > edm::reftobase::RefHolder< REF >::makeVectorHolder ( ) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 14 of file RefHolder.h.

14  {
16  return helper::makeVectorHolder();
17  }

◆ pointerToType()

template<class REF >
void const * edm::reftobase::RefHolder< REF >::pointerToType ( std::type_info const &  iToType) const
overrideprivatevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 109 of file RefHolder_.h.

109  {
110  typedef typename REF::value_type contained_type;
111  if (iToType == typeid(contained_type)) {
112  return ref_.get();
113  }
114  return pointerToBase(iToType, ref_.get());
115  }

References edm::pointerToBase().

◆ productGetter()

template<class REF >
EDProductGetter const * edm::reftobase::RefHolder< REF >::productGetter ( ) const
overridevirtual

Implements edm::reftobase::RefHolderBase.

Definition at line 94 of file RefHolder_.h.

94  {
95  return ref_.productGetter();
96  }

◆ setRef()

template<class REF >
void edm::reftobase::RefHolder< REF >::setRef ( REF const &  r)
inline

Definition at line 104 of file RefHolder_.h.

104  {
105  ref_ = r;
106  }

References alignCSCRings::r.

◆ swap()

template<class REF >
void edm::reftobase::RefHolder< REF >::swap ( RefHolder< REF > &  other)
inline

Definition at line 99 of file RefHolder_.h.

99  {
100  std::swap(ref_, other.ref_);
101  }

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

Member Data Documentation

◆ ref_

template<class REF>
REF edm::reftobase::RefHolder< REF >::ref_
private
edm::reftobase::RefHolderBase::RefHolderBase
RefHolderBase()
Definition: RefHolder.cc:6
mps_check.msg
tuple msg
Definition: mps_check.py:285
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
edm::pointerToBase
void const * pointerToBase(std::type_info const &baseTypeInfo, T const *address)
Definition: OffsetToBase.h:47
edm::reftobase::RefHolder::getRef
REF const & getRef() const
Definition: RefHolder_.h:89
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::reftobase::RefHolder::pointerToType
void const * pointerToType(std::type_info const &iToType) const override
Definition: RefHolder_.h:109
edm::reftobase::RefHolderToRefVectorTrait::type
InvalidRefHolderToRefVector< REF > type
Definition: HolderToVectorTrait.h:44
trackingPlots.other
other
Definition: trackingPlots.py:1464
edm::reftobase::RefHolder::RefHolder
RefHolder()
Definition: RefHolder_.h:53
h
edm::reftobase::RefKeyTrait::type
RefKey type
Definition: RefKeyTrait.h:29
helper
Definition: helper.py:1
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::reftobase::RefHolder::ref_
REF ref_
Definition: RefHolder_.h:45
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
crabWrapper.key
key
Definition: crabWrapper.py:19