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) noexcept(true)
 
 BasicHandle (std::shared_ptr< HandleExceptionFactory const > const &iWhyFailed) noexcept(true)
 Used when the attempt to get the data failed. More...
 
void clear () noexcept(true)
 
bool failedToGet () const noexcept(true)
 
ProductID id () const noexcept(true)
 
bool isValid () const noexcept(true)
 
BasicHandleoperator= (BasicHandle &&rhs)=default
 
BasicHandleoperator= (BasicHandle const &rhs)=default
 
Provenance const * provenance () const noexcept(true)
 
void swap (BasicHandle &other) noexcept(true)
 
std::shared_ptr< cms::ExceptionwhyFailed () const
 
std::shared_ptr< HandleExceptionFactory const > const & whyFailedFactory () const noexcept(true)
 
std::shared_ptr< HandleExceptionFactory const > & whyFailedFactory () noexcept(true)
 
WrapperBase const * wrapper () const noexcept(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< HandleExceptionFactory const > whyFailedFactory_
 

Detailed Description

Definition at line 43 of file BasicHandle.h.

Constructor & Destructor Documentation

◆ BasicHandle() [1/6]

edm::BasicHandle::BasicHandle ( )
delete

Referenced by makeInvalid().

◆ BasicHandle() [2/6]

edm::BasicHandle::BasicHandle ( BasicHandle const &  h)
default

◆ BasicHandle() [3/6]

edm::BasicHandle::BasicHandle ( BasicHandle &&  h)
default

◆ BasicHandle() [4/6]

edm::BasicHandle::BasicHandle ( WrapperBase const *  iProd,
Provenance const *  iProv 
)
inlinenoexcept

Definition at line 51 of file BasicHandle.h.

51 : product_(iProd), prov_(iProv) {}
WrapperBase const * product_
Definition: BasicHandle.h:98
Provenance const * prov_
Definition: BasicHandle.h:99

◆ BasicHandle() [5/6]

edm::BasicHandle::BasicHandle ( std::shared_ptr< HandleExceptionFactory const > const &  iWhyFailed)
inlinenoexcept

Used when the attempt to get the data failed.

Definition at line 54 of file BasicHandle.h.

55  : product_(), prov_(nullptr), whyFailedFactory_(iWhyFailed) {}
WrapperBase const * product_
Definition: BasicHandle.h:98
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100
Provenance const * prov_
Definition: BasicHandle.h:99

◆ ~BasicHandle()

edm::BasicHandle::~BasicHandle ( )
default

◆ BasicHandle() [6/6]

edm::BasicHandle::BasicHandle ( bool  )
inlineexplicitprivate

Definition at line 97 of file BasicHandle.h.

97 : product_(nullptr) {}
WrapperBase const * product_
Definition: BasicHandle.h:98

Member Function Documentation

◆ clear()

void edm::BasicHandle::clear ( void  )
inlinenoexcept

Definition at line 87 of file BasicHandle.h.

References product_, prov_, and whyFailedFactory_.

87  {
88  product_ = nullptr;
89  prov_ = nullptr;
90  whyFailedFactory_.reset();
91  }
WrapperBase const * product_
Definition: BasicHandle.h:98
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100
Provenance const * prov_
Definition: BasicHandle.h:99

◆ failedToGet()

bool edm::BasicHandle::failedToGet ( ) const
inlinenoexcept

◆ id()

ProductID edm::BasicHandle::id ( ) const
inlinenoexcept

Definition at line 77 of file BasicHandle.h.

References edm::Provenance::productID(), and prov_.

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

77 { return prov_->productID(); }
ProductID const & productID() const
Definition: Provenance.h:79
Provenance const * prov_
Definition: BasicHandle.h:99

◆ isValid()

bool edm::BasicHandle::isValid ( void  ) const
inlinenoexcept

Definition at line 69 of file BasicHandle.h.

References product_, and prov_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), edm::check(), and core.AutoHandle.AutoHandle::ReallyLoad().

69 { return product_ && prov_; }
WrapperBase const * product_
Definition: BasicHandle.h:98
Provenance const * prov_
Definition: BasicHandle.h:99

◆ makeInvalid()

static BasicHandle edm::BasicHandle::makeInvalid ( )
inlinestatic

Definition at line 93 of file BasicHandle.h.

References BasicHandle().

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

93 { return BasicHandle(true); }
BasicHandle()=delete

◆ operator=() [1/2]

BasicHandle& edm::BasicHandle::operator= ( BasicHandle &&  rhs)
default

◆ operator=() [2/2]

BasicHandle& edm::BasicHandle::operator= ( BasicHandle const &  rhs)
default

◆ provenance()

Provenance const* edm::BasicHandle::provenance ( ) const
inlinenoexcept

◆ swap()

void edm::BasicHandle::swap ( BasicHandle other)
inlinenoexcept

Definition at line 59 of file BasicHandle.h.

References trackingPlots::other, product_, prov_, std::swap(), and whyFailedFactory_.

59  {
60  using std::swap;
61  swap(product_, other.product_);
62  std::swap(prov_, other.prov_);
63  swap(whyFailedFactory_, other.whyFailedFactory_);
64  }
WrapperBase const * product_
Definition: BasicHandle.h:98
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void swap(BasicHandle &other) noexcept(true)
Definition: BasicHandle.h:59
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100
Provenance const * prov_
Definition: BasicHandle.h:99

◆ whyFailed()

std::shared_ptr<cms::Exception> edm::BasicHandle::whyFailed ( ) const
inline

Definition at line 79 of file BasicHandle.h.

References whyFailedFactory_.

Referenced by edm::convert_handle().

79 { return whyFailedFactory_->make(); }
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100

◆ whyFailedFactory() [1/2]

std::shared_ptr<HandleExceptionFactory const> const& edm::BasicHandle::whyFailedFactory ( ) const
inlinenoexcept

Definition at line 81 of file BasicHandle.h.

References whyFailedFactory_.

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

81  {
82  return whyFailedFactory_;
83  }
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100

◆ whyFailedFactory() [2/2]

std::shared_ptr<HandleExceptionFactory const>& edm::BasicHandle::whyFailedFactory ( )
inlinenoexcept

Definition at line 85 of file BasicHandle.h.

References whyFailedFactory_.

85 { return whyFailedFactory_; }
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100

◆ wrapper()

WrapperBase const* edm::BasicHandle::wrapper ( ) const
inlinenoexcept

Definition at line 73 of file BasicHandle.h.

References product_.

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

73 { return product_; }
WrapperBase const * product_
Definition: BasicHandle.h:98

Member Data Documentation

◆ product_

WrapperBase const* edm::BasicHandle::product_
private

Definition at line 98 of file BasicHandle.h.

Referenced by clear(), isValid(), swap(), and wrapper().

◆ prov_

Provenance const* edm::BasicHandle::prov_
private

Definition at line 99 of file BasicHandle.h.

Referenced by clear(), id(), isValid(), provenance(), and swap().

◆ whyFailedFactory_

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

Definition at line 100 of file BasicHandle.h.

Referenced by clear(), failedToGet(), swap(), whyFailed(), and whyFailedFactory().