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 <array>
22 #include <memory>
23 #include <string>
24 #include <utility>
25 #include <vector>
26 
27 namespace edm {
28 
29  class ModuleDescription;
30  class ProductRegistry;
31  class Schedule;
32 
34  public:
36  ~PathsAndConsumesOfModules() override;
37 
38  void initialize(Schedule const*, std::shared_ptr<ProductRegistry const>);
39 
40  void removeModules(std::vector<ModuleDescription const*> const& modules);
41 
42  std::vector<ModuleProcessName> const& modulesInPreviousProcessesWhoseProductsAreConsumedBy(
43  unsigned int moduleID) const;
44 
45  private:
46  std::vector<std::string> const& doPaths() const override { return paths_; }
47  std::vector<std::string> const& doEndPaths() const override { return endPaths_; }
48 
49  std::vector<ModuleDescription const*> const& doAllModules() const override { return allModuleDescriptions_; }
50  ModuleDescription const* doModuleDescription(unsigned int moduleID) const override;
51 
52  std::vector<ModuleDescription const*> const& doModulesOnPath(unsigned int pathIndex) const override;
53  std::vector<ModuleDescription const*> const& doModulesOnEndPath(unsigned int endPathIndex) const override;
54  std::vector<ModuleDescription const*> const& doModulesWhoseProductsAreConsumedBy(
55  unsigned int moduleID, BranchType branchType) const override;
56 
57  std::vector<ConsumesInfo> doConsumesInfo(unsigned int moduleID) const override;
58 
59  unsigned int doLargestModuleID() const override;
60 
61  unsigned int moduleIndex(unsigned int moduleID) const;
62 
63  // data members
64 
65  std::vector<std::string> paths_;
66  std::vector<std::string> endPaths_;
67 
68  std::vector<ModuleDescription const*> allModuleDescriptions_;
69 
70  std::vector<std::vector<ModuleDescription const*> > modulesOnPaths_;
71  std::vector<std::vector<ModuleDescription const*> > modulesOnEndPaths_;
72 
73  // Gives a translation from the module ID to the index into the
74  // following data member
75  std::vector<std::pair<unsigned int, unsigned int> > moduleIDToIndex_;
76 
77  std::array<std::vector<std::vector<ModuleDescription const*> >, NumBranchTypes> modulesWhoseProductsAreConsumedBy_;
78  std::vector<std::vector<ModuleProcessName> > modulesInPreviousProcessesWhoseProductsAreConsumedBy_;
79 
81  std::shared_ptr<ProductRegistry const> preg_;
82  };
83 
84  std::vector<ModuleDescription const*> nonConsumedUnscheduledModules(
85  edm::PathsAndConsumesOfModulesBase const& iPnC, std::vector<ModuleProcessName>& consumedByChildren);
86 
87  void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const& iPnC, bool iPrintDependencies);
88 } // namespace edm
89 #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_