CMS 3D CMS Logo

PathsAndConsumesOfModules.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_PathsAndConsumesOfModules_h
2 #define FWCore_Framework_PathsAndConsumesOfModules_h
3 
11 //
12 // Original Author: W. David Dagenhart
13 // Created: 11/5/2014
14 
17 
20 
21 #include <memory>
22 #include <string>
23 #include <utility>
24 #include <vector>
25 
26 namespace edm {
27 
28  class ModuleDescription;
29  class ProductRegistry;
30  class Schedule;
31 
33  public:
35  ~PathsAndConsumesOfModules() override;
36 
37  void initialize(Schedule const*, std::shared_ptr<ProductRegistry const>);
38 
39  void removeModules(std::vector<ModuleDescription const*> const& modules);
40 
41  std::vector<ModuleProcessName> const& modulesInPreviousProcessesWhoseProductsAreConsumedBy(
42  unsigned int moduleID) const;
43 
44  private:
45  std::vector<std::string> const& doPaths() const override { return paths_; }
46  std::vector<std::string> const& doEndPaths() const override { return endPaths_; }
47 
48  std::vector<ModuleDescription const*> const& doAllModules() const override { return allModuleDescriptions_; }
49  ModuleDescription const* doModuleDescription(unsigned int moduleID) const override;
50 
51  std::vector<ModuleDescription const*> const& doModulesOnPath(unsigned int pathIndex) const override;
52  std::vector<ModuleDescription const*> const& doModulesOnEndPath(unsigned int endPathIndex) const override;
53  std::vector<ModuleDescription const*> const& doModulesWhoseProductsAreConsumedBy(
54  unsigned int moduleID, BranchType branchType) const override;
55 
56  std::vector<ConsumesInfo> doConsumesInfo(unsigned int moduleID) const override;
57 
58  unsigned int doLargestModuleID() const override;
59 
60  unsigned int moduleIndex(unsigned int moduleID) const;
61 
62  // data members
63 
64  std::vector<std::string> paths_;
65  std::vector<std::string> endPaths_;
66 
67  std::vector<ModuleDescription const*> allModuleDescriptions_;
68 
69  std::vector<std::vector<ModuleDescription const*> > modulesOnPaths_;
70  std::vector<std::vector<ModuleDescription const*> > modulesOnEndPaths_;
71 
72  // Gives a translation from the module ID to the index into the
73  // following data member
74  std::vector<std::pair<unsigned int, unsigned int> > moduleIDToIndex_;
75 
76  std::array<std::vector<std::vector<ModuleDescription const*> >, NumBranchTypes> modulesWhoseProductsAreConsumedBy_;
77  std::vector<std::vector<ModuleProcessName> > modulesInPreviousProcessesWhoseProductsAreConsumedBy_;
78 
80  std::shared_ptr<ProductRegistry const> preg_;
81  };
82 
83  std::vector<ModuleDescription const*> nonConsumedUnscheduledModules(
84  edm::PathsAndConsumesOfModulesBase const& iPnC, std::vector<ModuleProcessName>& consumedByChildren);
85 
86  void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const& iPnC, bool iPrintDependencies);
87 } // namespace edm
88 #endif
edm::PathsAndConsumesOfModules::doConsumesInfo
std::vector< ConsumesInfo > doConsumesInfo(unsigned int moduleID) const override
Definition: PathsAndConsumesOfModules.cc:121
edm::PathsAndConsumesOfModules::modulesOnPaths_
std::vector< std::vector< ModuleDescription const * > > modulesOnPaths_
Definition: PathsAndConsumesOfModules.h:69
edm::PathsAndConsumesOfModules::doModulesWhoseProductsAreConsumedBy
std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy(unsigned int moduleID, BranchType branchType) const override
Definition: PathsAndConsumesOfModules.cc:116
BranchType.h
edm::PathsAndConsumesOfModules::modulesInPreviousProcessesWhoseProductsAreConsumedBy
std::vector< ModuleProcessName > const & modulesInPreviousProcessesWhoseProductsAreConsumedBy(unsigned int moduleID) const
Definition: PathsAndConsumesOfModules.cc:90
modules
Definition: MuonCleanerBySegments.cc:35
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::PathsAndConsumesOfModules::doLargestModuleID
unsigned int doLargestModuleID() const override
Definition: PathsAndConsumesOfModules.cc:126
edm::PathsAndConsumesOfModules::modulesOnEndPaths_
std::vector< std::vector< ModuleDescription const * > > modulesOnEndPaths_
Definition: PathsAndConsumesOfModules.h:70
edm::PathsAndConsumesOfModules::modulesWhoseProductsAreConsumedBy_
std::array< std::vector< std::vector< ModuleDescription const * > >, NumBranchTypes > modulesWhoseProductsAreConsumedBy_
Definition: PathsAndConsumesOfModules.h:76
edm::PathsAndConsumesOfModules::doEndPaths
std::vector< std::string > const & doEndPaths() const override
Definition: PathsAndConsumesOfModules.h:46
edm::PathsAndConsumesOfModules::initialize
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
Definition: PathsAndConsumesOfModules.cc:16
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::NumBranchTypes
Definition: BranchType.h:11
edm::PathsAndConsumesOfModules
Definition: PathsAndConsumesOfModules.h:32
edm::Schedule
Definition: Schedule.h:121
edm::PathsAndConsumesOfModules::modulesInPreviousProcessesWhoseProductsAreConsumedBy_
std::vector< std::vector< ModuleProcessName > > modulesInPreviousProcessesWhoseProductsAreConsumedBy_
Definition: PathsAndConsumesOfModules.h:77
edm::PathsAndConsumesOfModules::doAllModules
std::vector< ModuleDescription const * > const & doAllModules() const override
Definition: PathsAndConsumesOfModules.h:48
edm::PathsAndConsumesOfModules::doModuleDescription
ModuleDescription const * doModuleDescription(unsigned int moduleID) const override
Definition: PathsAndConsumesOfModules.cc:95
edm::checkForModuleDependencyCorrectness
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
Definition: PathsAndConsumesOfModules.cc:269
ModuleProcessName.h
edm::PathsAndConsumesOfModules::paths_
std::vector< std::string > paths_
Definition: PathsAndConsumesOfModules.h:64
edm::PathsAndConsumesOfModules::preg_
std::shared_ptr< ProductRegistry const > preg_
Definition: PathsAndConsumesOfModules.h:80
edm::PathsAndConsumesOfModules::moduleIDToIndex_
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_
Definition: PathsAndConsumesOfModules.h:74
edm::PathsAndConsumesOfModules::doModulesOnEndPath
std::vector< ModuleDescription const * > const & doModulesOnEndPath(unsigned int endPathIndex) const override
Definition: PathsAndConsumesOfModules.cc:111
edm::PathsAndConsumesOfModules::doPaths
std::vector< std::string > const & doPaths() const override
Definition: PathsAndConsumesOfModules.h:45
edm::PathsAndConsumesOfModules::endPaths_
std::vector< std::string > endPaths_
Definition: PathsAndConsumesOfModules.h:65
edm::PathsAndConsumesOfModules::allModuleDescriptions_
std::vector< ModuleDescription const * > allModuleDescriptions_
Definition: PathsAndConsumesOfModules.h:67
edm::nonConsumedUnscheduledModules
std::vector< ModuleDescription const * > nonConsumedUnscheduledModules(edm::PathsAndConsumesOfModulesBase const &iPnC, std::vector< ModuleProcessName > &consumedByChildren)
Definition: PathsAndConsumesOfModules.cc:165
edm::PathsAndConsumesOfModules::schedule_
Schedule const * schedule_
Definition: PathsAndConsumesOfModules.h:79
edm::PathsAndConsumesOfModules::removeModules
void removeModules(std::vector< ModuleDescription const * > const &modules)
Definition: PathsAndConsumesOfModules.cc:53
edm::PathsAndConsumesOfModulesBase
Definition: PathsAndConsumesOfModulesBase.h:35
edm::PathsAndConsumesOfModules::PathsAndConsumesOfModules
PathsAndConsumesOfModules()
edm::PathsAndConsumesOfModules::~PathsAndConsumesOfModules
~PathsAndConsumesOfModules() override
edm::PathsAndConsumesOfModules::doModulesOnPath
std::vector< ModuleDescription const * > const & doModulesOnPath(unsigned int pathIndex) const override
Definition: PathsAndConsumesOfModules.cc:107
PathsAndConsumesOfModulesBase.h
edm::PathsAndConsumesOfModules::moduleIndex
unsigned int moduleIndex(unsigned int moduleID) const
Definition: PathsAndConsumesOfModules.cc:131
ConsumesInfo.h