CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/FWCore/Framework/interface/DataProxyTemplate.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_DataProxyTemplate_h
00002 #define FWCore_Framework_DataProxyTemplate_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Framework
00006 // Class  :     DataProxyTemplate
00007 // 
00016 //
00017 // Author:      Chris Jones
00018 // Created:     Thu Mar 31 12:45:32 EST 2005
00019 //
00020 
00021 // system include files
00022 
00023 // user include files
00024 #include "FWCore/Framework/interface/DataProxy.h"
00025 #include "FWCore/Framework/interface/EventSetupRecord.h"
00026 #include <cassert>
00027 
00028 // forward declarations
00029 
00030 namespace edm {
00031    namespace eventsetup {
00032 template<class RecordT, class DataT>
00033 class DataProxyTemplate : public DataProxy
00034 {
00035 
00036    public:
00037       typedef DataT value_type;
00038       typedef RecordT record_type;
00039    
00040       DataProxyTemplate(){}
00041       //virtual ~DataProxyTemplate();
00042 
00043       // ---------- const member functions ---------------------
00044 
00045       // ---------- static member functions --------------------
00046 
00047       // ---------- member functions ---------------------------
00048       virtual const void* getImpl(const EventSetupRecord& iRecord,
00049                                   const DataKey& iKey) {
00050          assert(iRecord.key() == RecordT::keyForClass());
00051          return this->make(static_cast<const RecordT&>(iRecord), iKey);
00052       }
00053       
00054    protected:
00055       virtual const DataT* make(const RecordT&, const DataKey&) = 0;
00056       
00057    private:
00058       DataProxyTemplate(const DataProxyTemplate&); // stop default
00059 
00060       const DataProxyTemplate& operator=(const DataProxyTemplate&); // stop default
00061 
00062       // ---------- member data --------------------------------
00063 };
00064 
00065    }
00066 }
00067 #endif