CMS 3D CMS Logo

TransformerBase.h
Go to the documentation of this file.
1 //
2 // TransformerBase.h
3 // CMSSW
4 //
5 // Created by Chris Jones on 6/02/22.
6 //
7 
8 #ifndef FWCore_Framework_TransformerBase_h
9 #define FWCore_Framework_TransformerBase_h
10 
15 
16 #include <string>
17 #include <functional>
18 #include <memory>
19 #include <any>
20 
21 namespace edm {
22  class ProducerBase;
23  class TypeID;
24  class WrapperBase;
25  class EventForTransformer;
26  class BranchDescription;
27  class ProductResolverIndexHelper;
28  class ModuleDescription;
29  class WaitingTaskWithArenaHolder;
30  class WaitingTaskHolder;
31  class ActivityRegistry;
32 
34  public:
35  TransformerBase() = default;
36  virtual ~TransformerBase() noexcept(false) = default;
37 
38  protected:
39  //The function takes the WrapperBase corresponding to the data product from the EDPutToken
40  // and returns the WrapperBase associated to the id and instanceName
41  using TransformFunction = std::function<std::unique_ptr<edm::WrapperBase>(std::any)>;
42  using PreTransformFunction = std::function<std::any(edm::WrapperBase const&, edm::WaitingTaskWithArenaHolder)>;
43 
47 
48  std::size_t findMatchingIndex(ProducerBase const& iBase, edm::BranchDescription const&) const;
49  ProductResolverIndex prefetchImp(std::size_t iIndex) const { return transformInfo_.get<kResolverIndex>(iIndex); }
51  std::size_t iIndex,
53  ProducerBase const& iBase,
55 
56  void extendUpdateLookup(ProducerBase const&,
57  ModuleDescription const& iModuleDesc,
58  ProductResolverIndexHelper const& iHelper);
59 
60  private:
63  };
64 } // namespace edm
65 
66 #endif /* TransformerBase_h */
std::function< std::any(edm::WrapperBase const &, edm::WaitingTaskWithArenaHolder)> PreTransformFunction
virtual ~TransformerBase() noexcept(false)=default
SoATuple< ProductResolverIndex, TypeID, EDPutToken, PreTransformFunction, TransformFunction > transformInfo_
unsigned int ProductResolverIndex
TransformerBase()=default
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:36
ProductResolverIndex prefetchImp(std::size_t iIndex) const
void transformImpAsync(WaitingTaskHolder iTask, std::size_t iIndex, edm::ActivityRegistry *iAct, ProducerBase const &iBase, edm::EventForTransformer &) const
void extendUpdateLookup(ProducerBase const &, ModuleDescription const &iModuleDesc, ProductResolverIndexHelper const &iHelper)
std::function< std::unique_ptr< edm::WrapperBase >(std::any)> TransformFunction
void registerTransformAsyncImp(ProducerBase &, EDPutToken, const TypeID &id, std::string instanceName, PreTransformFunction, TransformFunction)
HLT enums.
void registerTransformImp(ProducerBase &, EDPutToken, const TypeID &id, std::string instanceName, TransformFunction)
std::size_t findMatchingIndex(ProducerBase const &iBase, edm::BranchDescription const &) const