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 // $Id: ScheduleInfo.cc,v 1.1 2010/07/22 15:00:28 chrjones Exp $
12 //
13 
14 // system include files
15 #include <algorithm>
16 #include <iterator>
17 #include <boost/bind.hpp>
18 #include <functional>
19 
20 // user include files
23 
25 
26 using namespace edm;
27 //
28 // constants, enums and typedefs
29 //
30 
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
39 schedule_(iSchedule)
40 {
41 }
42 
43 // ScheduleInfo::ScheduleInfo(const ScheduleInfo& rhs)
44 // {
45 // // do actual copying here;
46 // }
47 
49 {
50 }
51 
52 //
53 // assignment operators
54 //
55 // const ScheduleInfo& ScheduleInfo::operator=(const ScheduleInfo& rhs)
56 // {
57 // //An exception safe implementation is
58 // ScheduleInfo temp(rhs);
59 // swap(rhs);
60 //
61 // return *this;
62 // }
63 
64 //
65 // member functions
66 //
67 
68 //
69 // const member functions
70 //
71 void
72 ScheduleInfo::availableModuleLabels(std::vector<std::string>& oLabelsToFill) const
73 {
74  std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
75 
76  oLabelsToFill.reserve(oLabelsToFill.size()+desc.size());
77  std::transform(desc.begin(),desc.end(),
78  std::back_inserter(oLabelsToFill),
79  boost::bind(&ModuleDescription::moduleLabel,_1));
80 }
81 
82 const ParameterSet*
83 ScheduleInfo::parametersForModule(const std::string& iLabel) const
84 {
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  boost::bind(std::equal_to<std::string>(),
90  iLabel,
91  boost::bind(&ModuleDescription::moduleLabel,_1)));
92  if (itFound == desc.end()) {
93  return 0;
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
105 ScheduleInfo::modulesInPath(const std::string& iPathLabel,
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:1209
static ThreadSafeRegistry * instance()
bool getMapped(key_type const &k, value_type &result) const
std::string const & moduleLabel() const
virtual ~ScheduleInfo()
Definition: ScheduleInfo.cc:48
ScheduleInfo(const Schedule *)
Definition: ScheduleInfo.cc:38
const edm::ParameterSet * parametersForModule(const std::string &iLabel) const
Definition: ScheduleInfo.cc:83
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:1218
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Definition: Schedule.cc:1194
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: ScheduleInfo.cc:99
const Schedule * schedule_
Definition: ScheduleInfo.h:65
void availableModuleLabels(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all modules used in the process
Definition: ScheduleInfo.cc:72