CMS 3D CMS Logo

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 // $Id: ProxyArgumentFactoryTemplate.h,v 1.5 2005/09/01 23:30:49 wmtan Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 #include "FWCore/Framework/interface/ProxyFactoryBase.h"
00026 #include "FWCore/Framework/interface/DataKey.h"
00027 
00028 // forward declarations
00029 namespace edm {
00030    namespace eventsetup {
00031       
00032 template <class T, class ArgT>
00033 class ProxyArgumentFactoryTemplate : public ProxyFactoryBase
00034 {
00035 
00036    public:
00037       typedef typename T::record_type record_type;
00038 
00039       ProxyArgumentFactoryTemplate(ArgT iArg) : arg_(iArg) {}
00040       //virtual ~ProxyArgumentFactoryTemplate()
00041 
00042       // ---------- const member functions ---------------------
00043       virtual std::auto_ptr<DataProxy> makeProxy() const {
00044          return std::auto_ptr<DataProxy>(new T(arg_));
00045       }
00046             
00047       virtual DataKey makeKey(const std::string& iName) const {
00048          return DataKey(DataKey::makeTypeTag< typename T::value_type>(),iName.c_str());
00049       }
00050       
00051       // ---------- static member functions --------------------
00052 
00053       // ---------- member functions ---------------------------
00054 
00055    private:
00056       ProxyArgumentFactoryTemplate(const ProxyArgumentFactoryTemplate&); // stop default
00057 
00058       const ProxyArgumentFactoryTemplate& operator=(const ProxyArgumentFactoryTemplate&); // stop default
00059 
00060       // ---------- member data --------------------------------
00061       mutable ArgT arg_;
00062 };
00063 
00064    }
00065 }
00066 #endif

Generated on Tue Jun 9 17:35:45 2009 for CMSSW by  doxygen 1.5.4