CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::Handle< FWGenericObject > Class Template Reference

#include <FWGenericHandle.h>

Public Member Functions

void clear ()
 
bool failedToGet () const
 
 Handle (std::string const &iName)
 Throws exception if iName is not a known C++ class type. More...
 
 Handle (edm::TypeWithDict const &iType)
 Throws exception if iType is invalid. More...
 
 Handle (Handle< FWGenericObject > const &h)
 
 Handle (edm::ObjectWithDict const &prod, Provenance const *prov, ProductID const &pid)
 
ProductID id () const
 
bool isValid () const
 
edm::ObjectWithDict const & operator* () const
 
edm::ObjectWithDict const * operator-> () const
 
Handle< FWGenericObject > & operator= (Handle< FWGenericObject > const &rhs)
 
edm::ObjectWithDict const * product () const
 
Provenance const * provenance () const
 
void setWhyFailed (std::shared_ptr< cms::Exception > const &iWhyFailed)
 
void swap (Handle< FWGenericObject > &other)
 
edm::TypeWithDict const & type () const
 

Private Attributes

edm::ObjectWithDict prod_
 
Provenance const * prov_
 
edm::TypeWithDict type_
 
std::shared_ptr< cms::ExceptionwhyFailed_
 

Detailed Description

template<>
class edm::Handle< FWGenericObject >

Definition at line 50 of file FWGenericHandle.h.

Constructor & Destructor Documentation

edm::Handle< FWGenericObject >::Handle ( std::string const &  iName)
inline

Throws exception if iName is not a known C++ class type.

Definition at line 53 of file FWGenericHandle.h.

References edm::errors::NotFound, and edm::Exception::throwThis().

53  :
54  type_(edm::TypeWithDict::byName(iName)), prod_(), prov_(nullptr) {
55  if(type_ == edm::TypeWithDict()) {
57  "Handle<FWGenericObject> told to use uknown type '",
58  iName.c_str(),
59  "'.\n Please check spelling or that a module uses this type in the job.");
60  }
61  }
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
edm::Handle< FWGenericObject >::Handle ( edm::TypeWithDict const &  iType)
inline

Throws exception if iType is invalid.

Definition at line 64 of file FWGenericHandle.h.

References edm::errors::NotFound, and edm::Exception::throwThis().

64  :
65  type_(iType), prod_(), prov_(nullptr) {
66  if(iType == edm::TypeWithDict()) {
67  Exception::throwThis(errors::NotFound, "Handle<FWGenericObject> given an invalid edm::TypeWithDict");
68  }
69  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83

Definition at line 71 of file FWGenericHandle.h.

71  :
72  type_(h.type_),
73  prod_(h.prod_),
74  prov_(h.prov_),
75  whyFailed_(h.whyFailed_)
76  { }
std::shared_ptr< cms::Exception > whyFailed_
edm::Handle< FWGenericObject >::Handle ( edm::ObjectWithDict const &  prod,
Provenance const *  prov,
ProductID const &  pid 
)
inline

Definition at line 78 of file FWGenericHandle.h.

78  :
79  type_(prod.typeOf()),
80  prod_(prod),
81  prov_(prov) {
82  assert(prod_);
83  assert(prov_);
84  // assert(prov_->productID() != ProductID());
85  }

Member Function Documentation

void edm::Handle< FWGenericObject >::clear ( void  )
inline
bool edm::Handle< FWGenericObject >::failedToGet ( ) const
inline

Definition at line 111 of file FWGenericHandle.h.

111  {
112  return nullptr != whyFailed_.get();
113  }
std::shared_ptr< cms::Exception > whyFailed_
ProductID edm::Handle< FWGenericObject >::id ( void  ) const
inline

Definition at line 126 of file FWGenericHandle.h.

126 {return prov_->productID();}
ProductID const & productID() const
Definition: Provenance.h:83
bool edm::Handle< FWGenericObject >::isValid ( void  ) const
inline

Definition at line 107 of file FWGenericHandle.h.

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

107  {
108  return prod_ && nullptr!= prov_;
109  }
edm::ObjectWithDict const& edm::Handle< FWGenericObject >::operator* ( void  ) const
inline

Definition at line 121 of file FWGenericHandle.h.

121 {return *(this->product());}
edm::ObjectWithDict const * product() const
edm::ObjectWithDict const* edm::Handle< FWGenericObject >::operator-> ( ) const
inline

Definition at line 120 of file FWGenericHandle.h.

120 {return this->product();}
edm::ObjectWithDict const * product() const
Handle<FWGenericObject>& edm::Handle< FWGenericObject >::operator= ( Handle< FWGenericObject > const &  rhs)
inline

Definition at line 100 of file FWGenericHandle.h.

References edm::swap(), and groupFilesInBlocks::temp.

101  {
103  this->swap(temp);
104  return *this;
105  }
void swap(Handle< FWGenericObject > &other)
edm::ObjectWithDict const* edm::Handle< FWGenericObject >::product ( ) const
inline

Definition at line 114 of file FWGenericHandle.h.

114  {
115  if(this->failedToGet()) {
116  whyFailed_->raise();
117  }
118  return &prod_;
119  }
std::shared_ptr< cms::Exception > whyFailed_
Provenance const* edm::Handle< FWGenericObject >::provenance ( ) const
inline

Definition at line 124 of file FWGenericHandle.h.

124 {return prov_;}
void edm::Handle< FWGenericObject >::setWhyFailed ( std::shared_ptr< cms::Exception > const &  iWhyFailed)
inline

Definition at line 130 of file FWGenericHandle.h.

Referenced by edm::convert_handle().

130  {
131  whyFailed_=iWhyFailed;
132  }
std::shared_ptr< cms::Exception > whyFailed_
void edm::Handle< FWGenericObject >::swap ( Handle< FWGenericObject > &  other)
inline

Definition at line 89 of file FWGenericHandle.h.

References prod_, prov_, edm::swap(), std::swap(), type_, and whyFailed_.

90  {
91  // use unqualified swap for user defined classes
92  using std::swap;
93  swap(type_, other.type_);
94  std::swap(prod_, other.prod_);
95  swap(prov_, other.prov_);
96  swap(whyFailed_, other.whyFailed_);
97  }
void swap(Handle< FWGenericObject > &other)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::shared_ptr< cms::Exception > whyFailed_
edm::TypeWithDict const& edm::Handle< FWGenericObject >::type ( ) const
inline

Member Data Documentation

Definition at line 135 of file FWGenericHandle.h.

Referenced by swap().

Provenance const* edm::Handle< FWGenericObject >::prov_
private

Definition at line 136 of file FWGenericHandle.h.

Referenced by swap().

std::shared_ptr<cms::Exception> edm::Handle< FWGenericObject >::whyFailed_
private

Definition at line 137 of file FWGenericHandle.h.

Referenced by swap().