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 44 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 52 of file BasicHandle.h.

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

Used when the attempt to get the data failed.

Definition at line 55 of file BasicHandle.h.

56  : product_(), prov_(nullptr), whyFailedFactory_(iWhyFailed) {}
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:99
WrapperBase const * product_
Definition: BasicHandle.h:97
Provenance const * prov_
Definition: BasicHandle.h:98
edm::BasicHandle::~BasicHandle ( )
default
edm::BasicHandle::BasicHandle ( bool  )
inlineexplicitprivate

Definition at line 96 of file BasicHandle.h.

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

Member Function Documentation

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

Definition at line 78 of file BasicHandle.h.

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

78 { return prov_->productID(); }
ProductID const & productID() const
Definition: Provenance.h:85
Provenance const * prov_
Definition: BasicHandle.h:98
bool edm::BasicHandle::isValid ( void  ) const
inline
static BasicHandle edm::BasicHandle::makeInvalid ( )
inlinestatic

Definition at line 92 of file BasicHandle.h.

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

92 { 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 60 of file BasicHandle.h.

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

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

Definition at line 80 of file BasicHandle.h.

Referenced by edm::convert_handle().

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

Definition at line 82 of file BasicHandle.h.

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

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

Definition at line 84 of file BasicHandle.h.

84 { return whyFailedFactory_; }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:99
WrapperBase const* edm::BasicHandle::wrapper ( ) const
inline

Member Data Documentation

WrapperBase const* edm::BasicHandle::product_
private

Definition at line 97 of file BasicHandle.h.

Provenance const* edm::BasicHandle::prov_
private

Definition at line 98 of file BasicHandle.h.

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

Definition at line 99 of file BasicHandle.h.