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 
33  public:
34  TransformerBase() = default;
35  virtual ~TransformerBase() noexcept(false) = default;
36 
37  protected:
38  //The function takes the WrapperBase corresponding to the data product from the EDPutToken
39  // and returns the WrapperBase associated to the id and instanceName
40  using TransformFunction = std::function<std::unique_ptr<edm::WrapperBase>(std::any)>;
41  using PreTransformFunction = std::function<std::any(edm::WrapperBase const&, edm::WaitingTaskWithArenaHolder)>;
42 
46 
47  std::size_t findMatchingIndex(ProducerBase const& iBase, edm::BranchDescription const&) const;
48  ProductResolverIndex prefetchImp(std::size_t iIndex) const { return transformInfo_.get<kResolverIndex>(iIndex); }
50  std::size_t iIndex,
51  ProducerBase const& iBase,
53 
54  void extendUpdateLookup(ProducerBase const&,
55  ModuleDescription const& iModuleDesc,
56  ProductResolverIndexHelper const& iHelper);
57 
58  private:
61  };
62 } // namespace edm
63 
64 #endif /* TransformerBase_h */
void transformImpAsync(WaitingTaskHolder iTask, std::size_t iIndex, ProducerBase const &iBase, edm::EventForTransformer &) const
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:37
ProductResolverIndex prefetchImp(std::size_t iIndex) 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