CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

fwlite::Handle< T > Class Template Reference

#include <Handle.h>

List of all members.

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

template<class T>
fwlite::Handle< T >::~Handle ( ) [inline]

Definition at line 52 of file Handle.h.

{ delete errorThrower_;}
template<class T>
fwlite::Handle< T >::Handle ( const Handle< T > &  iOther) [inline]

Definition at line 54 of file Handle.h.

                                      : data_(iOther.data_),
      errorThrower_( iOther.errorThrower_? iOther.errorThrower_->clone(): 0) {}

Member Function Documentation

template<class T>
void fwlite::Handle< T >::check ( ) const [inline, private]
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().

{return errorThrower_ != 0; }
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.

      {
         return iEvent.getBranchNameFor(TempWrapT::typeInfo(),
                                        iModuleLabel,
                                        iProductInstanceLabel,
                                        iProcessLabel);
      }
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]
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.

                                 {
        check();
        return *data_;
      }
template<class T>
const T* fwlite::Handle< T >::operator-> ( ) const [inline]

Definition at line 74 of file Handle.h.

                                  {
        check();
        return data_;
      }
template<class T>
const Handle<T>& fwlite::Handle< T >::operator= ( const Handle< T > &  iOther) [inline]

Definition at line 57 of file Handle.h.

                                                          {
         Handle<T> temp(iOther);
         swap(temp);
         return *this;
      }
template<class T>
T const* fwlite::Handle< T >::product ( ) const [inline]
template<class T>
const T* fwlite::Handle< T >::ptr ( ) const [inline]

Definition at line 71 of file Handle.h.

{ check(); return data_;}
template<class T>
const T& fwlite::Handle< T >::ref ( ) const [inline]

Definition at line 72 of file Handle.h.

{ check(); return *data_;}
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=().

                                 {
      const T* temp = data_;
      data_ = iOther.data_;
      iOther.data_ = temp;
      ErrorThrower* tempE = errorThrower_;
      errorThrower_ = iOther.errorThrower_;
      iOther.errorThrower_ = tempE;
   }

Member Data Documentation

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