CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/FWCore/ParameterSet/interface/ParameterSetConverter.h

Go to the documentation of this file.
00001 #ifndef FWCore_ParameterSet_ParameterSetConverter_h
00002 #define FWCore_ParameterSet_ParameterSetConverter_h
00003 
00004 #include <map>
00005 #include <list>
00006 #include <set>
00007 #include <string>
00008 #include <utility>
00009 #include <vector>
00010 #include "boost/utility.hpp"
00011 #include "DataFormats/Provenance/interface/ParameterSetID.h"
00012 #include "DataFormats/Provenance/interface/ParameterSetBlob.h"
00013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00014 
00015 namespace edm {
00016 
00017   typedef std::vector<std::string> StringVector;
00018 
00019   struct MainParameterSet {
00020     MainParameterSet(ParameterSetID const& oldID, std::string const& psetString);
00021     ~MainParameterSet();
00022     ParameterSetID oldID_;
00023     ParameterSet parameterSet_;
00024     StringVector paths_;
00025     StringVector endPaths_;
00026     std::set<std::string> triggerPaths_;
00027   };
00028 
00029   struct TriggerPath {
00030     TriggerPath(ParameterSet const& pset);
00031     ~TriggerPath();
00032     ParameterSet parameterSet_;
00033     StringVector tPaths_;
00034     std::set<std::string> triggerPaths_;
00035   };
00036 
00037   //------------------------------------------------------------
00038   // Class ParameterSetConverter
00039 
00040   typedef std::map<ParameterSetID, ParameterSetBlob> ParameterSetMap;
00041   class ParameterSetConverter : private boost::noncopyable {
00042   public:
00043     typedef std::list<std::string> StringList;
00044     typedef std::map<std::string, std::string> StringMap;
00045     typedef std::list<std::pair<std::string, ParameterSetID> > StringWithIDList;
00046     typedef std::map<ParameterSetID, ParameterSetID> ParameterSetIdConverter;
00047     ParameterSetConverter(ParameterSetMap const& psetMap, ParameterSetIdConverter& idConverter, bool alreadyByReference);
00048     ~ParameterSetConverter();
00049     ParameterSetIdConverter const& parameterSetIdConverter() const {return parameterSetIdConverter_;}
00050   private:
00051     void convertParameterSets();
00052     void noConvertParameterSets();
00053     StringWithIDList parameterSets_;
00054     std::vector<MainParameterSet> mainParameterSets_;
00055     std::vector<TriggerPath> triggerPaths_;
00056     StringMap replace_;
00057     ParameterSetIdConverter& parameterSetIdConverter_;
00058   };
00059 }
00060 #endif