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 &&h)=default
 
 BasicHandle (BasicHandle const &h)=default
 
 BasicHandle (std::shared_ptr< HandleExceptionFactory const > const &iWhyFailed) noexcept(true)
 Used when the attempt to get the data failed. More...
 
 BasicHandle (WrapperBase const *iProd, Provenance const *iProv) noexcept(true)
 
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) {}

◆ 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) {}

◆ ~BasicHandle()

edm::BasicHandle::~BasicHandle ( )
default

◆ BasicHandle() [6/6]

edm::BasicHandle::BasicHandle ( bool  )
inlineexplicitprivate

Definition at line 97 of file BasicHandle.h.

97 : product_(nullptr) {}

Member Function Documentation

◆ clear()

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

Definition at line 87 of file BasicHandle.h.

87  {
88  product_ = nullptr;
89  prov_ = nullptr;
90  whyFailedFactory_.reset();
91  }

References product_, prov_, and whyFailedFactory_.

Referenced by BeautifulSoup.Tag::setString().

◆ failedToGet()

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

◆ id()

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

Definition at line 77 of file BasicHandle.h.

77 { return prov_->productID(); }

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

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

◆ isValid()

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

◆ makeInvalid()

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

Definition at line 93 of file BasicHandle.h.

93 { return BasicHandle(true); }

References BasicHandle().

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

◆ 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.

59  {
60  using std::swap;
61  swap(product_, other.product_);
62  std::swap(prov_, other.prov_);
63  swap(whyFailedFactory_, other.whyFailedFactory_);
64  }

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

◆ whyFailed()

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

Definition at line 79 of file BasicHandle.h.

79 { return whyFailedFactory_->make(); }

References whyFailedFactory_.

Referenced by edm::convert_handle().

◆ whyFailedFactory() [1/2]

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

Definition at line 81 of file BasicHandle.h.

81  {
82  return whyFailedFactory_;
83  }

References whyFailedFactory_.

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

◆ whyFailedFactory() [2/2]

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

Definition at line 85 of file BasicHandle.h.

85 { return whyFailedFactory_; }

References whyFailedFactory_.

◆ wrapper()

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

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().

electrons_cff.bool
bool
Definition: electrons_cff.py:372
edm::Provenance::productID
ProductID const & productID() const
Definition: Provenance.h:79
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::BasicHandle::prov_
Provenance const * prov_
Definition: BasicHandle.h:99
edm::BasicHandle::product_
WrapperBase const * product_
Definition: BasicHandle.h:98
trackingPlots.other
other
Definition: trackingPlots.py:1465
edm::BasicHandle::swap
void swap(BasicHandle &other) noexcept(true)
Definition: BasicHandle.h:59
edm::BasicHandle::BasicHandle
BasicHandle()=delete
edm::BasicHandle::whyFailedFactory_
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100