CMS 3D CMS Logo

ScheduleInfo.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Framework
4 // Class : ScheduleInfo
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Thu Jul 15 19:40:14 CEST 2010
11 //
12 
13 // system include files
14 #include <algorithm>
15 #include <iterator>
16 #include <functional>
17 
18 // user include files
21 
23 
24 using namespace edm;
25 //
26 // constants, enums and typedefs
27 //
28 
29 //
30 // static data member definitions
31 //
32 
33 //
34 // constructors and destructor
35 //
37 schedule_(iSchedule)
38 {
39 }
40 
41 // ScheduleInfo::ScheduleInfo(const ScheduleInfo& rhs)
42 // {
43 // // do actual copying here;
44 // }
45 
47 {
48 }
49 
50 //
51 // assignment operators
52 //
53 // const ScheduleInfo& ScheduleInfo::operator=(const ScheduleInfo& rhs)
54 // {
55 // //An exception safe implementation is
56 // ScheduleInfo temp(rhs);
57 // swap(rhs);
58 //
59 // return *this;
60 // }
61 
62 //
63 // member functions
64 //
65 
66 //
67 // const member functions
68 //
69 void
70 ScheduleInfo::availableModuleLabels(std::vector<std::string>& oLabelsToFill) const
71 {
72  using std::placeholders::_1;
73  std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
74 
75  oLabelsToFill.reserve(oLabelsToFill.size()+desc.size());
76  std::transform(desc.begin(),desc.end(),
77  std::back_inserter(oLabelsToFill),
78  std::bind(&ModuleDescription::moduleLabel,_1));
79 }
80 
81 const ParameterSet*
83 {
84  using std::placeholders::_1;
85  std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
86 
87  std::vector<ModuleDescription const*>::iterator itFound = std::find_if(desc.begin(),
88  desc.end(),
89  std::bind(std::equal_to<std::string>(),
90  iLabel,
91  std::bind(&ModuleDescription::moduleLabel,_1)));
92  if (itFound == desc.end()) {
93  return nullptr;
94  }
95  return pset::Registry::instance()->getMapped((*itFound)->parameterSetID());
96 }
97 
98 void
99 ScheduleInfo::availablePaths(std::vector<std::string>& oLabelsToFill) const
100 {
101  schedule_->availablePaths(oLabelsToFill);
102 }
103 
104 void
106  std::vector<std::string>& oLabelsToFill) const
107 {
108  schedule_->modulesInPath(iPathLabel, oLabelsToFill);
109 }
110 
111 //
112 // static member functions
113 //
void modulesInPath(const std::string &iPathLabel, std::vector< std::string > &oLabelsToFill) const
add to oLabelsToFill in execution order the labels of all modules in path iPathLabel ...
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: Schedule.cc:1122
std::string const & moduleLabel() const
virtual ~ScheduleInfo()
Definition: ScheduleInfo.cc:46
ScheduleInfo(const Schedule *)
Definition: ScheduleInfo.cc:36
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:19
const edm::ParameterSet * parametersForModule(const std::string &iLabel) const
Definition: ScheduleInfo.cc:82
void modulesInPath(std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel ...
Definition: Schedule.cc:1138
HLT enums.
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Definition: Schedule.cc:1099
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: ScheduleInfo.cc:99
static Registry * instance()
Definition: Registry.cc:13
const Schedule * schedule_
Definition: ScheduleInfo.h:64
void availableModuleLabels(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all modules used in the process
Definition: ScheduleInfo.cc:70