CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 //
36 ScheduleInfo::ScheduleInfo(const Schedule* iSchedule) : schedule_(iSchedule) {}
37 
38 // ScheduleInfo::ScheduleInfo(const ScheduleInfo& rhs)
39 // {
40 // // do actual copying here;
41 // }
42 
44 
45 //
46 // assignment operators
47 //
48 // const ScheduleInfo& ScheduleInfo::operator=(const ScheduleInfo& rhs)
49 // {
50 // //An exception safe implementation is
51 // ScheduleInfo temp(rhs);
52 // swap(rhs);
53 //
54 // return *this;
55 // }
56 
57 //
58 // member functions
59 //
60 
61 //
62 // const member functions
63 //
64 void ScheduleInfo::availableModuleLabels(std::vector<std::string>& oLabelsToFill) const {
65  using std::placeholders::_1;
66  std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
67 
68  oLabelsToFill.reserve(oLabelsToFill.size() + desc.size());
70  desc.begin(), desc.end(), std::back_inserter(oLabelsToFill), std::bind(&ModuleDescription::moduleLabel, _1));
71 }
72 
74  using std::placeholders::_1;
75  std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
76 
77  std::vector<ModuleDescription const*>::iterator itFound =
78  std::find_if(desc.begin(),
79  desc.end(),
80  std::bind(std::equal_to<std::string>(), iLabel, std::bind(&ModuleDescription::moduleLabel, _1)));
81  if (itFound == desc.end()) {
82  return nullptr;
83  }
84  return pset::Registry::instance()->getMapped((*itFound)->parameterSetID());
85 }
86 
87 void ScheduleInfo::availablePaths(std::vector<std::string>& oLabelsToFill) const {
88  schedule_->availablePaths(oLabelsToFill);
89 }
90 
91 void ScheduleInfo::modulesInPath(const std::string& iPathLabel, std::vector<std::string>& oLabelsToFill) const {
92  schedule_->modulesInPath(iPathLabel, oLabelsToFill);
93 }
94 
95 //
96 // static member functions
97 //
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 ...
Definition: ScheduleInfo.cc:91
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: Schedule.cc:1453
std::string const & moduleLabel() const
virtual ~ScheduleInfo()
Definition: ScheduleInfo.cc:43
ScheduleInfo(const Schedule *)
Definition: ScheduleInfo.cc:36
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
const edm::ParameterSet * parametersForModule(const std::string &iLabel) const
Definition: ScheduleInfo.cc:73
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:1461
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Definition: Schedule.cc:1434
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: ScheduleInfo.cc:87
static Registry * instance()
Definition: Registry.cc:12
const Schedule * schedule_
Definition: ScheduleInfo.h:62
void availableModuleLabels(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all modules used in the process
Definition: ScheduleInfo.cc:64
unsigned transform(const HcalDetId &id, unsigned transformCode)