CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

edm::BasicHandle::BasicHandle ( )
delete

Referenced by makeInvalid().

edm::BasicHandle::BasicHandle ( BasicHandle const &  h)
default
edm::BasicHandle::BasicHandle ( BasicHandle &&  h)
default
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
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
edm::BasicHandle::~BasicHandle ( )
default
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

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

Definition at line 87 of file BasicHandle.h.

References product_, prov_, and whyFailedFactory_.

Referenced by BeautifulSoup.Tag::setString().

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
bool edm::BasicHandle::failedToGet ( ) const
inlinenoexcept

Definition at line 71 of file BasicHandle.h.

References whyFailedFactory_.

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

71 { return bool(whyFailedFactory_); }
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: BasicHandle.h:100
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
bool edm::BasicHandle::isValid ( void  ) const
inlinenoexcept
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
BasicHandle& edm::BasicHandle::operator= ( BasicHandle &&  rhs)
default
BasicHandle& edm::BasicHandle::operator= ( BasicHandle const &  rhs)
default
Provenance const* edm::BasicHandle::provenance ( ) const
inlinenoexcept
void edm::BasicHandle::swap ( BasicHandle other)
inlinenoexcept

Definition at line 59 of file BasicHandle.h.

References 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
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
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
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
WrapperBase const* edm::BasicHandle::wrapper ( ) const
inlinenoexcept

Member Data Documentation

WrapperBase const* edm::BasicHandle::product_
private

Definition at line 98 of file BasicHandle.h.

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

Provenance const* edm::BasicHandle::prov_
private

Definition at line 99 of file BasicHandle.h.

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

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