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
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::PathsAndConsumesOfModulesBase::doAllModules
virtual std::vector< ModuleDescription const * > const & doAllModules() const =0
edm::PathsAndConsumesOfModulesBase::~PathsAndConsumesOfModulesBase
virtual ~PathsAndConsumesOfModulesBase()
Definition: PathsAndConsumesOfModulesBase.cc:5
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::PathsAndConsumesOfModulesBase::consumesInfo
std::vector< ConsumesInfo > consumesInfo(unsigned int moduleID) const
Definition: PathsAndConsumesOfModulesBase.h:74
edm::PathsAndConsumesOfModulesBase::doModuleDescription
virtual ModuleDescription const * doModuleDescription(unsigned int moduleID) const =0
edm::PathsAndConsumesOfModulesBase::doModulesWhoseProductsAreConsumedBy
virtual std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy(unsigned int moduleID) const =0
edm::PathsAndConsumesOfModulesBase::doPaths
virtual std::vector< std::string > const & doPaths() const =0
edm::PathsAndConsumesOfModulesBase::doConsumesInfo
virtual std::vector< ConsumesInfo > doConsumesInfo(unsigned int moduleID) const =0
edm::PathsAndConsumesOfModulesBase::endPaths
std::vector< std::string > const & endPaths() const
Definition: PathsAndConsumesOfModulesBase.h:39
edm::PathsAndConsumesOfModulesBase::modulesWhoseProductsAreConsumedBy
std::vector< ModuleDescription const * > const & modulesWhoseProductsAreConsumedBy(unsigned int moduleID) const
Definition: PathsAndConsumesOfModulesBase.h:63
edm::PathsAndConsumesOfModulesBase::doModulesOnPath
virtual std::vector< ModuleDescription const * > const & doModulesOnPath(unsigned int pathIndex) const =0
edm::PathsAndConsumesOfModulesBase::modulesOnPath
std::vector< ModuleDescription const * > const & modulesOnPath(unsigned int pathIndex) const
Definition: PathsAndConsumesOfModulesBase.h:45
edm::PathsAndConsumesOfModulesBase::doEndPaths
virtual std::vector< std::string > const & doEndPaths() const =0
edm::PathsAndConsumesOfModulesBase::paths
std::vector< std::string > const & paths() const
Definition: PathsAndConsumesOfModulesBase.h:38
edm::PathsAndConsumesOfModulesBase
Definition: PathsAndConsumesOfModulesBase.h:34
edm::PathsAndConsumesOfModulesBase::doModulesOnEndPath
virtual std::vector< ModuleDescription const * > const & doModulesOnEndPath(unsigned int endPathIndex) const =0
edm::PathsAndConsumesOfModulesBase::modulesOnEndPath
std::vector< ModuleDescription const * > const & modulesOnEndPath(unsigned int endPathIndex) const
Definition: PathsAndConsumesOfModulesBase.h:49
edm::PathsAndConsumesOfModulesBase::moduleDescription
ModuleDescription const * moduleDescription(unsigned int moduleID) const
Definition: PathsAndConsumesOfModulesBase.h:43
ConsumesInfo.h
edm::PathsAndConsumesOfModulesBase::allModules
std::vector< ModuleDescription const * > const & allModules() const
Definition: PathsAndConsumesOfModulesBase.h:41