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
std::vector< ModuleDescription const * > const & doAllModules() const override
unsigned int doLargestModuleID() const override
std::array< std::vector< std::vector< ModuleDescription const * > >, NumBranchTypes > modulesWhoseProductsAreConsumedBy_
std::vector< ModuleProcessName > const & modulesInPreviousProcessesWhoseProductsAreConsumedBy(unsigned int moduleID) const
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_
std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy(unsigned int moduleID, BranchType branchType) const override
std::vector< ModuleDescription const * > allModuleDescriptions_
ModuleDescription const * doModuleDescription(unsigned int moduleID) const override
BranchType
Definition: BranchType.h:11
std::vector< std::string > const & doEndPaths() const override
std::vector< std::vector< ModuleDescription const * > > modulesOnPaths_
std::vector< std::vector< ModuleProcessName > > modulesInPreviousProcessesWhoseProductsAreConsumedBy_
std::vector< ModuleDescription const * > const & doModulesOnPath(unsigned int pathIndex) const override
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
std::vector< ModuleDescription const * > nonConsumedUnscheduledModules(edm::PathsAndConsumesOfModulesBase const &iPnC, std::vector< ModuleProcessName > &consumedByChildren)
std::vector< std::string > endPaths_
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
std::vector< std::string > const & doPaths() const override
std::shared_ptr< ProductRegistry const > preg_
HLT enums.
unsigned int moduleIndex(unsigned int moduleID) const
void removeModules(std::vector< ModuleDescription const *> const &modules)
std::vector< ConsumesInfo > doConsumesInfo(unsigned int moduleID) const override
std::vector< ModuleDescription const * > const & doModulesOnEndPath(unsigned int endPathIndex) const override
std::vector< std::vector< ModuleDescription const * > > modulesOnEndPaths_