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