CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
edm::BasicHandle Class Reference

#include <BasicHandle.h>

Public Member Functions

 BasicHandle ()
 
 BasicHandle (BasicHandle const &h)
 
 BasicHandle (void const *iProd, WrapperInterfaceBase const *iInterface, Provenance const *iProv)
 
 BasicHandle (WrapperHolder const &iWrapperHolder, Provenance const *iProv)
 
 BasicHandle (ProductData const &productData)
 
 BasicHandle (std::shared_ptr< HandleExceptionFactory > const &iWhyFailed)
 Used when the attempt to get the data failed. More...
 
bool failedToGet () const
 
ProductID id () const
 
WrapperInterfaceBase const * interface () const
 
bool isValid () const
 
BasicHandleoperator= (BasicHandle const &rhs)
 
Provenance const * provenance () const
 
void swap (BasicHandle &other)
 
std::shared_ptr< cms::ExceptionwhyFailed () const
 
std::shared_ptr
< HandleExceptionFactory >
const & 
whyFailedFactory () const
 
std::shared_ptr
< HandleExceptionFactory > & 
whyFailedFactory ()
 
void const * wrapper () const
 
WrapperHolder wrapperHolder () const
 
 ~BasicHandle ()
 

Private Attributes

WrapperHolder product_
 
Provenance const * prov_
 
std::shared_ptr
< HandleExceptionFactory
whyFailedFactory_
 

Detailed Description

Definition at line 47 of file BasicHandle.h.

Constructor & Destructor Documentation

edm::BasicHandle::BasicHandle ( )
inline

Definition at line 49 of file BasicHandle.h.

49  :
50  product_(),
51  prov_(0) {}
WrapperHolder product_
Definition: BasicHandle.h:139
Provenance const * prov_
Definition: BasicHandle.h:140
edm::BasicHandle::BasicHandle ( BasicHandle const &  h)
inline

Definition at line 53 of file BasicHandle.h.

53  :
54  product_(h.product_),
55  prov_(h.prov_),
56  whyFailedFactory_(h.whyFailedFactory_){}
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:141
WrapperHolder product_
Definition: BasicHandle.h:139
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Provenance const * prov_
Definition: BasicHandle.h:140
edm::BasicHandle::BasicHandle ( void const *  iProd,
WrapperInterfaceBase const *  iInterface,
Provenance const *  iProv 
)
inline

Definition at line 62 of file BasicHandle.h.

62  :
63  product_(WrapperHolder(iProd, iInterface)),
64  prov_(iProv) {
65  }
WrapperHolder product_
Definition: BasicHandle.h:139
Provenance const * prov_
Definition: BasicHandle.h:140
edm::BasicHandle::BasicHandle ( WrapperHolder const &  iWrapperHolder,
Provenance const *  iProv 
)
inline

Definition at line 67 of file BasicHandle.h.

67  :
68  product_(iWrapperHolder),
69  prov_(iProv) {
70  }
WrapperHolder product_
Definition: BasicHandle.h:139
Provenance const * prov_
Definition: BasicHandle.h:140
edm::BasicHandle::BasicHandle ( ProductData const &  productData)
inline

Definition at line 72 of file BasicHandle.h.

72  :
73  product_(WrapperHolder(productData.wrapper_.get(), productData.getInterface())),
74  prov_(&productData.prov_) {
75  }
WrapperHolder product_
Definition: BasicHandle.h:139
Provenance const * prov_
Definition: BasicHandle.h:140
edm::BasicHandle::BasicHandle ( std::shared_ptr< HandleExceptionFactory > const &  iWhyFailed)
inline

Used when the attempt to get the data failed.

Definition at line 78 of file BasicHandle.h.

78  :
79  product_(),
80  prov_(0),
81  whyFailedFactory_(iWhyFailed) {}
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:141
WrapperHolder product_
Definition: BasicHandle.h:139
Provenance const * prov_
Definition: BasicHandle.h:140
edm::BasicHandle::~BasicHandle ( )
inline

Definition at line 83 of file BasicHandle.h.

83 {}

Member Function Documentation

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

Definition at line 102 of file BasicHandle.h.

References whyFailedFactory_.

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

102  {
103  return bool(whyFailedFactory_);
104  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:141
ProductID edm::BasicHandle::id ( void  ) const
inline

Definition at line 122 of file BasicHandle.h.

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

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

122  {
123  return prov_->productID();
124  }
ProductID const & productID() const
Definition: Provenance.h:78
Provenance const * prov_
Definition: BasicHandle.h:140
WrapperInterfaceBase const* edm::BasicHandle::interface ( ) const
inline

Definition at line 106 of file BasicHandle.h.

References edm::WrapperHolder::interface(), and product_.

Referenced by edm::Event::fillView_().

106  {
107  return product_.interface();
108  }
WrapperHolder product_
Definition: BasicHandle.h:139
WrapperInterfaceBase const * interface() const
Definition: WrapperHolder.h:80
bool edm::BasicHandle::isValid ( void  ) const
inline

Definition at line 98 of file BasicHandle.h.

References product_, prov_, and edm::WrapperHolder::wrapper().

Referenced by edm::LuminosityBlock::getByLabelImpl(), edm::Run::getByLabelImpl(), edm::Event::getByLabelImpl(), and edm::PrincipalGetAdapter::getByToken_().

98  {
99  return product_.wrapper() != 0 && prov_ != 0;
100  }
WrapperHolder product_
Definition: BasicHandle.h:139
void const * wrapper() const
Definition: WrapperHolder.h:76
Provenance const * prov_
Definition: BasicHandle.h:140
BasicHandle& edm::BasicHandle::operator= ( BasicHandle const &  rhs)
inline

Definition at line 92 of file BasicHandle.h.

References swap(), and groupFilesInBlocks::temp.

92  {
93  BasicHandle temp(rhs);
94  this->swap(temp);
95  return *this;
96  }
void swap(BasicHandle &other)
Definition: BasicHandle.h:85
Provenance const* edm::BasicHandle::provenance ( ) const
inline
void edm::BasicHandle::swap ( BasicHandle other)
inline

Definition at line 85 of file BasicHandle.h.

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

Referenced by operator=(), and edm::swap().

85  {
86  using std::swap;
87  swap(product_, other.product_);
88  std::swap(prov_, other.prov_);
89  swap(whyFailedFactory_,other.whyFailedFactory_);
90  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:141
WrapperHolder product_
Definition: BasicHandle.h:139
void swap(BasicHandle &other)
Definition: BasicHandle.h:85
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Provenance const * prov_
Definition: BasicHandle.h:140
std::shared_ptr<cms::Exception> edm::BasicHandle::whyFailed ( ) const
inline

Definition at line 126 of file BasicHandle.h.

References whyFailedFactory_.

Referenced by edm::convert_handle().

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

Definition at line 130 of file BasicHandle.h.

References whyFailedFactory_.

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

130  {
131  return whyFailedFactory_;
132  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:141
std::shared_ptr<HandleExceptionFactory>& edm::BasicHandle::whyFailedFactory ( )
inline

Definition at line 134 of file BasicHandle.h.

References whyFailedFactory_.

134  {
135  return whyFailedFactory_;
136  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: BasicHandle.h:141
void const* edm::BasicHandle::wrapper ( ) const
inline

Definition at line 110 of file BasicHandle.h.

References product_, and edm::WrapperHolder::wrapper().

Referenced by edm::Event::fillView_().

110  {
111  return product_.wrapper();
112  }
WrapperHolder product_
Definition: BasicHandle.h:139
void const * wrapper() const
Definition: WrapperHolder.h:76
WrapperHolder edm::BasicHandle::wrapperHolder ( ) const
inline

Definition at line 114 of file BasicHandle.h.

References product_.

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

114  {
115  return product_;
116  }
WrapperHolder product_
Definition: BasicHandle.h:139

Member Data Documentation

WrapperHolder edm::BasicHandle::product_
private

Definition at line 139 of file BasicHandle.h.

Referenced by interface(), isValid(), swap(), wrapper(), and wrapperHolder().

Provenance const* edm::BasicHandle::prov_
private

Definition at line 140 of file BasicHandle.h.

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

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

Definition at line 141 of file BasicHandle.h.

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