CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
fwlite::Handle< T > Class Template Reference

#include <Handle.h>

Public Types

typedef edm::Wrapper< TTempWrapT
 

Public Member Functions

bool failedToGet () const
 Returns true only if Handle was used in a 'get' call and the data could not be found. More...
 
const std::string getBranchNameFor (const fwlite::EventBase &iEvent, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
 
template<class P >
void getByLabel (const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
 
 Handle ()
 
 Handle (const Handle< T > &iOther)
 
bool isValid () const
 
const Toperator* () const
 
const Toperator-> () const
 
const Handle< T > & operator= (const Handle< T > &iOther)
 
T const * product () const
 
const Tptr () const
 
const Tref () const
 
void swap (Handle< T > &iOther)
 
 ~Handle ()
 

Private Member Functions

void check () const
 

Private Attributes

const Tdata_
 
ErrorThrowererrorThrower_
 

Detailed Description

template<class T>
class fwlite::Handle< T >

Definition at line 41 of file Handle.h.

Member Typedef Documentation

template<class T>
typedef edm::Wrapper<T> fwlite::Handle< T >::TempWrapT

Definition at line 49 of file Handle.h.

Constructor & Destructor Documentation

template<class T>
fwlite::Handle< T >::Handle ( )
inline

Definition at line 51 of file Handle.h.

static ErrorThrower * unsetErrorThrower()
ErrorThrower * errorThrower_
Definition: Handle.h:269
const T * data_
Definition: Handle.h:268
template<class T>
fwlite::Handle< T >::~Handle ( )
inline

Definition at line 52 of file Handle.h.

52 { delete errorThrower_;}
ErrorThrower * errorThrower_
Definition: Handle.h:269
template<class T>
fwlite::Handle< T >::Handle ( const Handle< T > &  iOther)
inline

Definition at line 54 of file Handle.h.

54  : data_(iOther.data_),
55  errorThrower_( iOther.errorThrower_? iOther.errorThrower_->clone(): 0) {}
ErrorThrower * errorThrower_
Definition: Handle.h:269
const T * data_
Definition: Handle.h:268

Member Function Documentation

template<class T>
void fwlite::Handle< T >::check ( ) const
inlineprivate
template<class T>
bool fwlite::Handle< T >::failedToGet ( ) const
inline

Returns true only if Handle was used in a 'get' call and the data could not be found.

Definition at line 67 of file Handle.h.

Referenced by fwlite::Scanner< Collection >::fillDataSet(), and fwlite::Scanner< Collection >::scan().

67 {return errorThrower_ != 0; }
ErrorThrower * errorThrower_
Definition: Handle.h:269
template<class T>
const std::string fwlite::Handle< T >::getBranchNameFor ( const fwlite::EventBase iEvent,
const char *  iModuleLabel,
const char *  iProductInstanceLabel = 0,
const char *  iProcessLabel = 0 
)
inline

Definition at line 212 of file Handle.h.

216  {
217  return iEvent.getBranchNameFor(TempWrapT::typeInfo(),
218  iModuleLabel,
219  iProductInstanceLabel,
220  iProcessLabel);
221  }
virtual std::string const getBranchNameFor(std::type_info const &, char const *, char const *, char const *) const =0
static std::type_info const & typeInfo()
Definition: Wrapper.h:41
template<class T>
template<class P >
void fwlite::Handle< T >::getByLabel ( const P iP,
const char *  iModuleLabel,
const char *  iProductInstanceLabel = 0,
const char *  iProcessLabel = 0 
)
inline

Definition at line 94 of file Handle.h.

Referenced by fwlite::ObjectCountSelector< Collection >::accept(), calcSampleName(), fwlite::Scanner< Collection >::count(), fwlite::Scanner< Collection >::draw(), fwlite::Scanner< Collection >::draw2D(), fwlite::Scanner< Collection >::drawGraph(), fwlite::Scanner< Collection >::drawProf(), FWHLTTriggerTableView::fillAverageAcceptFractions(), fwlite::Scanner< Collection >::fillDataSet(), FWL1TriggerTableView::fillTable(), FWHLTTriggerTableView::fillTable(), FWFileEntry::filterEventsWithCustomParser(), main(), fwlite::Scanner< Collection >::scan(), fwlite::MultiChainEvent::triggerResultsByName(), and fwlite::Event::triggerResultsByName().

97  {
98  TempWrapT* temp;
99  void* pTemp = &temp;
100  iP.getByLabel(TempWrapT::typeInfo(),
101  iModuleLabel,
102  iProductInstanceLabel,
103  iProcessLabel,
104  pTemp);
105  delete errorThrower_;
106  errorThrower_ = 0;
107  if(0==temp) {
109  iModuleLabel,
110  iProductInstanceLabel,
111  iProcessLabel);
112  return;
113  }
114  data_ = temp->product();
115  if(data_==0) {
117  iModuleLabel,
118  iProductInstanceLabel,
119  iProcessLabel);
120  }
121  }
static ErrorThrower * errorThrowerBranchNotFoundException(const std::type_info &, const char *, const char *, const char *)
edm::Wrapper< T > TempWrapT
Definition: Handle.h:49
ErrorThrower * errorThrower_
Definition: Handle.h:269
static ErrorThrower * errorThrowerProductNotFoundException(const std::type_info &, const char *, const char *, const char *)
const T * data_
Definition: Handle.h:268
static std::type_info const & typeInfo()
Definition: Wrapper.h:41
template<class T>
bool fwlite::Handle< T >::isValid ( void  ) const
inline
template<class T>
const T& fwlite::Handle< T >::operator* ( ) const
inline

Definition at line 79 of file Handle.h.

79  {
80  check();
81  return *data_;
82  }
void check() const
Definition: Handle.h:264
const T * data_
Definition: Handle.h:268
template<class T>
const T* fwlite::Handle< T >::operator-> ( ) const
inline

Definition at line 74 of file Handle.h.

74  {
75  check();
76  return data_;
77  }
void check() const
Definition: Handle.h:264
const T * data_
Definition: Handle.h:268
template<class T>
const Handle<T>& fwlite::Handle< T >::operator= ( const Handle< T > &  iOther)
inline

Definition at line 57 of file Handle.h.

57  {
58  Handle<T> temp(iOther);
59  swap(temp);
60  return *this;
61  }
void swap(Handle< T > &iOther)
Definition: Handle.h:255
template<class T>
T const* fwlite::Handle< T >::product ( ) const
inline

Definition at line 69 of file Handle.h.

Referenced by fwlite::MultiChainEvent::triggerResultsByName(), and fwlite::Event::triggerResultsByName().

69 { check(); return data_;}
void check() const
Definition: Handle.h:264
const T * data_
Definition: Handle.h:268
template<class T>
const T* fwlite::Handle< T >::ptr ( ) const
inline

Definition at line 71 of file Handle.h.

71 { check(); return data_;}
void check() const
Definition: Handle.h:264
const T * data_
Definition: Handle.h:268
template<class T>
const T& fwlite::Handle< T >::ref ( ) const
inline

Definition at line 72 of file Handle.h.

72 { check(); return *data_;}
void check() const
Definition: Handle.h:264
const T * data_
Definition: Handle.h:268
template<class T>
void fwlite::Handle< T >::swap ( Handle< T > &  iOther)
inline

Definition at line 255 of file Handle.h.

Referenced by fwlite::Handle< Collection >::operator=().

255  {
256  const T* temp = data_;
257  data_ = iOther.data_;
258  iOther.data_ = temp;
259  ErrorThrower* tempE = errorThrower_;
260  errorThrower_ = iOther.errorThrower_;
261  iOther.errorThrower_ = tempE;
262  }
ErrorThrower * errorThrower_
Definition: Handle.h:269
const T * data_
Definition: Handle.h:268
long double T

Member Data Documentation

template<class T>
const T* fwlite::Handle< T >::data_
private
template<class T>
ErrorThrower* fwlite::Handle< T >::errorThrower_
private