CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 <boost/bind.hpp>
17 #include <functional>
18 
19 // user include files
22 
24 
25 using namespace edm;
26 //
27 // constants, enums and typedefs
28 //
29 
30 //
31 // static data member definitions
32 //
33 
34 //
35 // constructors and destructor
36 //
38 schedule_(iSchedule)
39 {
40 }
41 
42 // ScheduleInfo::ScheduleInfo(const ScheduleInfo& rhs)
43 // {
44 // // do actual copying here;
45 // }
46 
48 {
49 }
50 
51 //
52 // assignment operators
53 //
54 // const ScheduleInfo& ScheduleInfo::operator=(const ScheduleInfo& rhs)
55 // {
56 // //An exception safe implementation is
57 // ScheduleInfo temp(rhs);
58 // swap(rhs);
59 //
60 // return *this;
61 // }
62 
63 //
64 // member functions
65 //
66 
67 //
68 // const member functions
69 //
70 void
71 ScheduleInfo::availableModuleLabels(std::vector<std::string>& oLabelsToFill) const
72 {
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  boost::bind(&ModuleDescription::moduleLabel,_1));
79 }
80 
81 const ParameterSet*
83 {
84  std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
85 
86  std::vector<ModuleDescription const*>::iterator itFound = std::find_if(desc.begin(),
87  desc.end(),
88  boost::bind(std::equal_to<std::string>(),
89  iLabel,
90  boost::bind(&ModuleDescription::moduleLabel,_1)));
91  if (itFound == desc.end()) {
92  return 0;
93  }
94  return pset::Registry::instance()->getMapped((*itFound)->parameterSetID());
95 }
96 
97 void
98 ScheduleInfo::availablePaths(std::vector<std::string>& oLabelsToFill) const
99 {
100  schedule_->availablePaths(oLabelsToFill);
101 }
102 
103 void
105  std::vector<std::string>& oLabelsToFill) const
106 {
107  schedule_->modulesInPath(iPathLabel, oLabelsToFill);
108 }
109 
110 //
111 // static member functions
112 //
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:973
std::string const & moduleLabel() const
virtual ~ScheduleInfo()
Definition: ScheduleInfo.cc:47
ScheduleInfo(const Schedule *)
Definition: ScheduleInfo.cc:37
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:20
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:978
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Definition: Schedule.cc:956
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: ScheduleInfo.cc:98
static Registry * instance()
Definition: Registry.cc:14
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:71