Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:02

0001 // -*- C++ -*-
0002 //
0003 // Package:     Framework
0004 // Class  :     ScheduleInfo
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Thu Jul 15 19:40:14 CEST 2010
0011 //
0012 
0013 // system include files
0014 #include <algorithm>
0015 #include <iterator>
0016 #include <functional>
0017 
0018 // user include files
0019 #include "FWCore/Framework/interface/ScheduleInfo.h"
0020 #include "FWCore/Framework/interface/Schedule.h"
0021 
0022 #include "FWCore/ParameterSet/interface/Registry.h"
0023 
0024 using namespace edm;
0025 //
0026 // constants, enums and typedefs
0027 //
0028 
0029 //
0030 // static data member definitions
0031 //
0032 
0033 //
0034 // constructors and destructor
0035 //
0036 ScheduleInfo::ScheduleInfo(const Schedule* iSchedule) : schedule_(iSchedule) {}
0037 
0038 // ScheduleInfo::ScheduleInfo(const ScheduleInfo& rhs)
0039 // {
0040 //    // do actual copying here;
0041 // }
0042 
0043 ScheduleInfo::~ScheduleInfo() {}
0044 
0045 //
0046 // assignment operators
0047 //
0048 // const ScheduleInfo& ScheduleInfo::operator=(const ScheduleInfo& rhs)
0049 // {
0050 //   //An exception safe implementation is
0051 //   ScheduleInfo temp(rhs);
0052 //   swap(rhs);
0053 //
0054 //   return *this;
0055 // }
0056 
0057 //
0058 // member functions
0059 //
0060 
0061 //
0062 // const member functions
0063 //
0064 void ScheduleInfo::availableModuleLabels(std::vector<std::string>& oLabelsToFill) const {
0065   using std::placeholders::_1;
0066   std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
0067 
0068   oLabelsToFill.reserve(oLabelsToFill.size() + desc.size());
0069   std::transform(
0070       desc.begin(), desc.end(), std::back_inserter(oLabelsToFill), std::bind(&ModuleDescription::moduleLabel, _1));
0071 }
0072 
0073 const ParameterSet* ScheduleInfo::parametersForModule(const std::string& iLabel) const {
0074   using std::placeholders::_1;
0075   std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
0076 
0077   std::vector<ModuleDescription const*>::iterator itFound =
0078       std::find_if(desc.begin(),
0079                    desc.end(),
0080                    std::bind(std::equal_to<std::string>(), iLabel, std::bind(&ModuleDescription::moduleLabel, _1)));
0081   if (itFound == desc.end()) {
0082     return nullptr;
0083   }
0084   return pset::Registry::instance()->getMapped((*itFound)->parameterSetID());
0085 }
0086 
0087 void ScheduleInfo::availablePaths(std::vector<std::string>& oLabelsToFill) const {
0088   schedule_->availablePaths(oLabelsToFill);
0089 }
0090 
0091 void ScheduleInfo::modulesInPath(const std::string& iPathLabel, std::vector<std::string>& oLabelsToFill) const {
0092   schedule_->modulesInPath(iPathLabel, oLabelsToFill);
0093 }
0094 
0095 //
0096 // static member functions
0097 //