CMS 3D CMS Logo

EDProductGetter.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Common_EDProductGetter_h
00002 #define DataFormats_Common_EDProductGetter_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     EDProduct
00006 // Class  :     EDProductGetter
00007 // 
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Tue Nov  1 15:06:31 EST 2005
00019 // $Id: EDProductGetter.h,v 1.6 2008/05/29 21:13:15 wmtan Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 #include "DataFormats/Provenance/interface/ProductID.h"
00026 
00027 // forward declarations
00028 
00029 namespace edm {
00030    class EDProduct;
00031    class EDProductGetter {
00032 
00033    public:
00034    
00035       EDProductGetter();
00036       virtual ~EDProductGetter();
00037 
00038       // ---------- const member functions ---------------------
00039       virtual EDProduct const* getIt(ProductID const&) const = 0;
00040       
00041       // ---------- static member functions --------------------
00042       static EDProductGetter const* instance();
00043       
00044       // ---------- member functions ---------------------------
00045 
00047       class Operate {
00048        public:
00049          Operate(EDProductGetter const* iGet) : previous_(EDProductGetter::set(iGet)) {
00050          }
00051          ~Operate() {
00052             EDProductGetter::set(previous_);
00053          }
00054        private:
00055          EDProductGetter const* previous_;
00056       };
00057       
00058       friend class Operate;
00059 private:
00060       EDProductGetter(EDProductGetter const&); // stop default
00061 
00062       const EDProductGetter& operator=(EDProductGetter const&); // stop default
00063 
00066       static EDProductGetter const* set(EDProductGetter const*);
00067       // ---------- member data --------------------------------
00068       
00069    };
00070 
00071    EDProductGetter const*
00072    mustBeNonZero(EDProductGetter const* prodGetter, std::string refType, ProductID const& peoductID);
00073 }
00074 
00075 #endif

Generated on Tue Jun 9 17:28:52 2009 for CMSSW by  doxygen 1.5.4