CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Fireworks/Core/interface/FWHandle.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_FWHandle_h
00002 #define Fireworks_Core_FWHandle_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     FWHandle
00007 //
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Thu Jan  3 19:23:45 EST 2008
00019 // $Id: FWHandle.h,v 1.3 2009/01/23 21:35:41 amraktad Exp $
00020 //
00021 
00022 // system include files
00023 #if !defined(__CINT__) && !defined(__MAKECINT__)
00024 //CINT can't handle parsing these files
00025 #include "DataFormats/Common/interface/Wrapper.h"
00026 #include "Fireworks/Core/interface/FWEventItem.h"
00027 #endif
00028 
00029 // user include files
00030 
00031 // forward declarations
00032 
00033 class FWHandle
00034 {
00035 
00036 public:
00037    FWHandle() : data(0) {
00038    }
00039    //virtual ~FWHandle();
00040 
00041    // ---------- const member functions ---------------------
00042    const T* get() const {
00043       return data_;
00044    }
00045 
00046    const T* operator->() const {
00047       return data_;
00048    }
00049 
00050    const T& operator*() const {
00051       return *data_;
00052    }
00053    // ---------- static member functions --------------------
00054 
00055    // ---------- member functions ---------------------------
00056    void getFrom(const FWEventItem& iItem) {
00057       data_ = reinterpet_cast<const T*>(
00058          iItem.data(edm::Wrapper<T>::productTypeInfo())
00059          );
00060    }
00061 
00062 private:
00063    //FWHandle(const FWHandle&); // stop default
00064 
00065    //const FWHandle& operator=(const FWHandle&); // stop default
00066 
00067    // ---------- member data --------------------------------
00068    const T* data_;
00069 
00070 };
00071 
00072 
00073 #endif