CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PathsAndConsumesOfModulesBase.h
Go to the documentation of this file.
1 #ifndef FWCore_ServiceRegistry_PathsAndConsumesOfModulesBase_h
2 #define FWCore_ServiceRegistry_PathsAndConsumesOfModulesBase_h
3 
21 //
22 // Original Author: W. David Dagenhart
23 // Created: 11/5/2014
24 
27 
28 #include <string>
29 #include <vector>
30 
31 namespace edm {
32 
33  class ModuleDescription;
34 
36  public:
38 
39  std::vector<std::string> const& paths() const { return doPaths(); }
40  std::vector<std::string> const& endPaths() const { return doEndPaths(); }
41 
42  std::vector<ModuleDescription const*> const& allModules() const { return doAllModules(); }
43 
44  ModuleDescription const* moduleDescription(unsigned int moduleID) const { return doModuleDescription(moduleID); }
45 
46  std::vector<ModuleDescription const*> const& modulesOnPath(unsigned int pathIndex) const {
47  return doModulesOnPath(pathIndex);
48  }
49 
50  std::vector<ModuleDescription const*> const& modulesOnEndPath(unsigned int endPathIndex) const {
51  return doModulesOnEndPath(endPathIndex);
52  }
53 
54  // The modules in the returned vector will be from the current process
55  // (not the prior process, and it will never include the source even
56  // though the source can make products) and these modules will declare
57  // they produce (they might or might not really produce) at least one
58  // product in the event (not run, not lumi) that the module corresponding
59  // to the moduleID argument declares it consumes (includes declarations using
60  // consumes, maybeConsumes, or consumesMany). Note that if a module declares
61  // it consumes a module label that is an EDAlias, the corresponding module
62  // description will be included in the returned vector (but the label in the
63  // module description is not the EDAlias label).
64  std::vector<ModuleDescription const*> const& modulesWhoseProductsAreConsumedBy(
65  unsigned int moduleID, BranchType branchType = InEvent) const {
66  return doModulesWhoseProductsAreConsumedBy(moduleID, branchType);
67  }
68 
69  // This returns the declared consumes information for a module.
70  // Note the other functions above return a reference to an object
71  // that is held in memory throughout the job, while the following
72  // function returns a newly created object each time. We do not
73  // expect this to be called during a normal production job where
74  // performance and memory are important. These objects are bigger
75  // than just a pointer.
76  std::vector<ConsumesInfo> consumesInfo(unsigned int moduleID) const { return doConsumesInfo(moduleID); }
77 
78  unsigned int largestModuleID() const { return doLargestModuleID(); }
79 
80  private:
81  virtual std::vector<std::string> const& doPaths() const = 0;
82  virtual std::vector<std::string> const& doEndPaths() const = 0;
83  virtual std::vector<ModuleDescription const*> const& doAllModules() const = 0;
84  virtual ModuleDescription const* doModuleDescription(unsigned int moduleID) const = 0;
85  virtual std::vector<ModuleDescription const*> const& doModulesOnPath(unsigned int pathIndex) const = 0;
86  virtual std::vector<ModuleDescription const*> const& doModulesOnEndPath(unsigned int endPathIndex) const = 0;
87  virtual std::vector<ModuleDescription const*> const& doModulesWhoseProductsAreConsumedBy(
88  unsigned int moduleID, BranchType branchType) const = 0;
89  virtual std::vector<ConsumesInfo> doConsumesInfo(unsigned int moduleID) const = 0;
90  virtual unsigned int doLargestModuleID() const = 0;
91  };
92 } // namespace edm
93 #endif
virtual std::vector< ConsumesInfo > doConsumesInfo(unsigned int moduleID) const =0
std::vector< ConsumesInfo > consumesInfo(unsigned int moduleID) const
virtual ModuleDescription const * doModuleDescription(unsigned int moduleID) const =0
virtual std::vector< std::string > const & doEndPaths() const =0
std::vector< ModuleDescription const * > const & modulesOnEndPath(unsigned int endPathIndex) const
std::vector< ModuleDescription const * > const & modulesOnPath(unsigned int pathIndex) const
BranchType
Definition: BranchType.h:11
std::vector< ModuleDescription const * > const & allModules() const
virtual std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy(unsigned int moduleID, BranchType branchType) const =0
virtual std::vector< ModuleDescription const * > const & doModulesOnEndPath(unsigned int endPathIndex) const =0
std::vector< std::string > const & endPaths() const
virtual unsigned int doLargestModuleID() const =0
virtual std::vector< ModuleDescription const * > const & doModulesOnPath(unsigned int pathIndex) const =0
ModuleDescription const * moduleDescription(unsigned int moduleID) const
virtual std::vector< std::string > const & doPaths() const =0
std::vector< ModuleDescription const * > const & modulesWhoseProductsAreConsumedBy(unsigned int moduleID, BranchType branchType=InEvent) const
virtual std::vector< ModuleDescription const * > const & doAllModules() const =0
std::vector< std::string > const & paths() const