File indexing completed on 2024-04-06 12:12:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <algorithm>
0015 #include <iterator>
0016 #include <functional>
0017
0018
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
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 ScheduleInfo::ScheduleInfo(const Schedule* iSchedule) : schedule_(iSchedule) {}
0037
0038
0039
0040
0041
0042
0043 ScheduleInfo::~ScheduleInfo() {}
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
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
0097