CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Framework/interface/ProxyArgumentFactoryTemplate.h

Go to the documentation of this file.
00001 #ifndef Framework_ProxyArgumentFactoryTemplate_h
00002 #define Framework_ProxyArgumentFactoryTemplate_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Framework
00006 // Class  :     ProxyArgumentFactoryTemplate
00007 // 
00016 //
00017 // Author:      Chris Jones
00018 // Created:     Mon Apr 11 16:20:52 CDT 2005
00019 //
00020 
00021 // system include files
00022 #include <memory>
00023 #include <string>
00024 
00025 // user include files
00026 #include "FWCore/Framework/interface/ProxyFactoryBase.h"
00027 #include "FWCore/Framework/interface/DataKey.h"
00028 
00029 // forward declarations
00030 namespace edm {
00031    namespace eventsetup {
00032       
00033 template <class T, class ArgT>
00034 class ProxyArgumentFactoryTemplate : public ProxyFactoryBase
00035 {
00036 
00037    public:
00038       typedef typename T::record_type record_type;
00039 
00040       ProxyArgumentFactoryTemplate(ArgT iArg) : arg_(iArg) {}
00041       //virtual ~ProxyArgumentFactoryTemplate()
00042 
00043       // ---------- const member functions ---------------------
00044       virtual std::auto_ptr<DataProxy> makeProxy() const {
00045          return std::auto_ptr<DataProxy>(new T(arg_));
00046       }
00047             
00048       virtual DataKey makeKey(const std::string& iName) const {
00049          return DataKey(DataKey::makeTypeTag< typename T::value_type>(),iName.c_str());
00050       }
00051       
00052       // ---------- static member functions --------------------
00053 
00054       // ---------- member functions ---------------------------
00055 
00056    private:
00057       ProxyArgumentFactoryTemplate(const ProxyArgumentFactoryTemplate&); // stop default
00058 
00059       const ProxyArgumentFactoryTemplate& operator=(const ProxyArgumentFactoryTemplate&); // stop default
00060 
00061       // ---------- member data --------------------------------
00062       mutable ArgT arg_;
00063 };
00064 
00065    }
00066 }
00067 #endif