CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/Common/interface/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.10 2011/02/24 23:37:53 chrjones Exp $
00020 //
00021 
00022 // system include files
00023 #include "boost/utility.hpp"
00024 
00025 // user include files
00026 #include "DataFormats/Provenance/interface/ProductID.h"
00027 
00028 // forward declarations
00029 
00030 namespace edm {
00031    class EDProduct;
00032    class EDProductGetter : private boost::noncopyable {
00033 
00034    public:
00035    
00036       EDProductGetter();
00037       virtual ~EDProductGetter();
00038 
00039       // ---------- const member functions ---------------------
00040       virtual EDProduct const* getIt(ProductID const&) const = 0;
00041       
00042       // ---------- member functions ---------------------------
00043 
00044       ProductID oldToNewProductID(ProductID const& oldProductID) const {
00045         if (oldProductID.oldID() == 0) return oldProductID;
00046         return oldToNewProductID_(oldProductID);
00047       }
00048      
00050      static EDProductGetter const* switchProductGetter(EDProductGetter const*);
00051      static void assignEDProductGetter(EDProductGetter const* &);
00052 
00053 private:
00054       virtual ProductID oldToNewProductID_(ProductID const& oldProductID) const;
00055       // ---------- member data --------------------------------
00056       
00057    };
00058 
00059    EDProductGetter const*
00060    mustBeNonZero(EDProductGetter const* prodGetter, std::string refType, ProductID const& productID);
00061 }
00062 
00063 #endif