CMS 3D CMS Logo

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 
26 
27 #include <string>
28 #include <vector>
29 
30 namespace edm {
31 
32  class ModuleDescription;
33 
35  public:
37 
38  std::vector<std::string> const& paths() const { return doPaths(); }
39  std::vector<std::string> const& endPaths() const { return doEndPaths(); }
40 
41  std::vector<ModuleDescription const*> const& allModules() const { return doAllModules(); }
42 
43  ModuleDescription const* moduleDescription(unsigned int moduleID) const { return doModuleDescription(moduleID); }
44 
45  std::vector<ModuleDescription const*> const& modulesOnPath(unsigned int pathIndex) const {
46  return doModulesOnPath(pathIndex);
47  }
48 
49  std::vector<ModuleDescription const*> const& modulesOnEndPath(unsigned int endPathIndex) const {
50  return doModulesOnEndPath(endPathIndex);
51  }
52 
53  // The modules in the returned vector will be from the current process
54  // (not the prior process, and it will never include the source even
55  // though the source can make products) and these modules will declare
56  // they produce (they might or might not really produce) at least one
57  // product in the event (not run, not lumi) that the module corresponding
58  // to the moduleID argument declares it consumes (includes declarations using
59  // consumes, maybeConsumes, or consumesMany). Note that if a module declares
60  // it consumes a module label that is an EDAlias, the corresponding module
61  // description will be included in the returned vector (but the label in the
62  // module description is not the EDAlias label).
63  std::vector<ModuleDescription const*> const& modulesWhoseProductsAreConsumedBy(unsigned int moduleID) const {
64  return doModulesWhoseProductsAreConsumedBy(moduleID);
65  }
66 
67  // This returns the declared consumes information for a module.
68  // Note the other functions above return a reference to an object
69  // that is held in memory throughout the job, while the following
70  // function returns a newly created object each time. We do not
71  // expect this to be called during a normal production job where
72  // performance and memory are important. These objects are bigger
73  // than just a pointer.
74  std::vector<ConsumesInfo> consumesInfo(unsigned int moduleID) const { return doConsumesInfo(moduleID); }
75 
76  private:
77  virtual std::vector<std::string> const& doPaths() const = 0;
78  virtual std::vector<std::string> const& doEndPaths() const = 0;
79  virtual std::vector<ModuleDescription const*> const& doAllModules() const = 0;
80  virtual ModuleDescription const* doModuleDescription(unsigned int moduleID) const = 0;
81  virtual std::vector<ModuleDescription const*> const& doModulesOnPath(unsigned int pathIndex) const = 0;
82  virtual std::vector<ModuleDescription const*> const& doModulesOnEndPath(unsigned int endPathIndex) const = 0;
83  virtual std::vector<ModuleDescription const*> const& doModulesWhoseProductsAreConsumedBy(
84  unsigned int moduleID) const = 0;
85  virtual std::vector<ConsumesInfo> doConsumesInfo(unsigned int moduleID) const = 0;
86  };
87 } // namespace edm
88 #endif
virtual std::vector< ModuleDescription const * > const & doModulesOnPath(unsigned int pathIndex) const =0
std::vector< ConsumesInfo > consumesInfo(unsigned int moduleID) const
std::vector< ModuleDescription const * > const & modulesOnEndPath(unsigned int endPathIndex) const
virtual std::vector< std::string > const & doEndPaths() const =0
std::vector< ModuleDescription const * > const & modulesOnPath(unsigned int pathIndex) const
std::vector< ModuleDescription const * > const & allModules() const
std::vector< std::string > const & endPaths() const
virtual std::vector< ConsumesInfo > doConsumesInfo(unsigned int moduleID) const =0
ModuleDescription const * moduleDescription(unsigned int moduleID) const
virtual std::vector< ModuleDescription const * > const & doModulesOnEndPath(unsigned int endPathIndex) const =0
virtual std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy(unsigned int moduleID) const =0
virtual std::vector< ModuleDescription const * > const & doAllModules() const =0
std::vector< ModuleDescription const * > const & modulesWhoseProductsAreConsumedBy(unsigned int moduleID) const
HLT enums.
std::vector< std::string > const & paths() const
virtual ModuleDescription const * doModuleDescription(unsigned int moduleID) const =0
virtual std::vector< std::string > const & doPaths() const =0