CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::BasicHandle Class Reference

#include <BasicHandle.h>

Public Member Functions

 BasicHandle ()=delete
 
 BasicHandle (BasicHandle const &h)=default
 
 BasicHandle (BasicHandle &&h)=default
 
 BasicHandle (WrapperBase const *iProd, Provenance const *iProv)(true)
 
 BasicHandle (std::shared_ptr< HandleExceptionFactory > const &iWhyFailed)(true)
 Used when the attempt to get the data failed. More...
 
void clear ()(true)
 
bool failedToGet () const (true)
 
ProductID id () const (true)
 
bool isValid () const (true)
 
BasicHandleoperator= (BasicHandle &&rhs)=default
 
BasicHandleoperator= (BasicHandle const &rhs)=default
 
Provenance const * provenance () const (true)
 
void swap (BasicHandle &other)(true)
 
std::shared_ptr< cms::ExceptionwhyFailed () const
 
std::shared_ptr< HandleExceptionFactory > const & whyFailedFactory () const (true)
 
std::shared_ptr< HandleExceptionFactory > & whyFailedFactory ()(true)
 
WrapperBase const * wrapper () const (true)
 
 ~BasicHandle ()=default
 

Static Public Member Functions

static BasicHandle makeInvalid ()
 

Private Member Functions

 BasicHandle (bool)
 

Private Attributes

WrapperBase const * product_
 
Provenance const * prov_
 
std::shared_ptr< HandleExceptionFactorywhyFailedFactory_
 

Detailed Description

Definition at line 43 of file BasicHandle.h.

Constructor & Destructor Documentation

edm::BasicHandle::BasicHandle ( )
delete
edm::BasicHandle::BasicHandle ( BasicHandle const &  h)
default
edm::BasicHandle::BasicHandle ( BasicHandle &&  h)
default
edm::BasicHandle::BasicHandle ( WrapperBase const *  iProd,
Provenance const *  iProv 
)
inline

Definition at line 51 of file BasicHandle.h.

51  :
52  product_(iProd),
53  prov_(iProv) {
54  }
WrapperBase const * product_
Definition: BasicHandle.h:116
Provenance const * prov_
Definition: BasicHandle.h:117
edm::BasicHandle::BasicHandle ( std::shared_ptr< HandleExceptionFactory > const &  iWhyFailed)
inline

Used when the attempt to get the data failed.

Definition at line 57 of file BasicHandle.h.

57  :
58  product_(),
59  prov_(nullptr),
60  whyFailedFactory_(iWhyFailed) {}
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:118
WrapperBase const * product_
Definition: BasicHandle.h:116
Provenance const * prov_
Definition: BasicHandle.h:117
edm::BasicHandle::~BasicHandle ( )
default
edm::BasicHandle::BasicHandle ( bool  )
inlineexplicitprivate

Definition at line 115 of file BasicHandle.h.

115 :product_(nullptr) {}
WrapperBase const * product_
Definition: BasicHandle.h:116

Member Function Documentation

void edm::BasicHandle::clear ( void  )
inline
bool edm::BasicHandle::failedToGet ( ) const
inline

Definition at line 78 of file BasicHandle.h.

References electrons_cff::bool.

Referenced by edm::convert_handle(), edm::Event::get(), edm::EventBase::getByLabel(), edm::Event::getByLabel(), edm::Event::getByToken(), and edm::Event::getHandle().

78  {
79  return bool(whyFailedFactory_);
80  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:118
ProductID edm::BasicHandle::id ( ) const
inline

Definition at line 90 of file BasicHandle.h.

Referenced by edm::convert_handle(), and edm::Event::fillView_().

90  {
91  return prov_->productID();
92  }
ProductID const & productID() const
Definition: Provenance.h:83
Provenance const * prov_
Definition: BasicHandle.h:117
bool edm::BasicHandle::isValid ( void  ) const
inline
static BasicHandle edm::BasicHandle::makeInvalid ( )
inlinestatic

Definition at line 112 of file BasicHandle.h.

Referenced by edm::Principal::getByToken().

112 { return BasicHandle(true);}
BasicHandle()=delete
BasicHandle& edm::BasicHandle::operator= ( BasicHandle &&  rhs)
default
BasicHandle& edm::BasicHandle::operator= ( BasicHandle const &  rhs)
default
Provenance const* edm::BasicHandle::provenance ( ) const
inline
void edm::BasicHandle::swap ( BasicHandle other)
inline

Definition at line 64 of file BasicHandle.h.

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

64  {
65  using std::swap;
66  swap(product_, other.product_);
67  std::swap(prov_, other.prov_);
68  swap(whyFailedFactory_,other.whyFailedFactory_);
69  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:118
WrapperBase const * product_
Definition: BasicHandle.h:116
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void swap(BasicHandle &other)(true)
Definition: BasicHandle.h:64
Provenance const * prov_
Definition: BasicHandle.h:117
std::shared_ptr<cms::Exception> edm::BasicHandle::whyFailed ( ) const
inline

Definition at line 94 of file BasicHandle.h.

Referenced by edm::convert_handle().

94  {
95  return whyFailedFactory_->make();
96  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:118
std::shared_ptr<HandleExceptionFactory> const& edm::BasicHandle::whyFailedFactory ( ) const
inline

Definition at line 98 of file BasicHandle.h.

Referenced by edm::Event::get(), edm::Event::getByLabel(), edm::Event::getByToken(), and edm::Event::getHandle().

98  {
99  return whyFailedFactory_;
100  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:118
std::shared_ptr<HandleExceptionFactory>& edm::BasicHandle::whyFailedFactory ( )
inline

Definition at line 102 of file BasicHandle.h.

102  {
103  return whyFailedFactory_;
104  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:118
WrapperBase const* edm::BasicHandle::wrapper ( ) const
inline

Member Data Documentation

WrapperBase const* edm::BasicHandle::product_
private

Definition at line 116 of file BasicHandle.h.

Provenance const* edm::BasicHandle::prov_
private

Definition at line 117 of file BasicHandle.h.

std::shared_ptr<HandleExceptionFactory> edm::BasicHandle::whyFailedFactory_
private

Definition at line 118 of file BasicHandle.h.