File indexing completed on 2025-12-16 10:29:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RJITTEDDEFINE
0012 #define ROOT_RJITTEDDEFINE
0013
0014 #include "ROOT/RDF/RDefineBase.hxx"
0015 #include "ROOT/RDF/RSampleInfo.hxx"
0016 #include "ROOT/RDF/Utils.hxx" // TypeName2TypeID
0017 #include <string_view>
0018 #include "RtypesCore.h"
0019
0020 #include <memory>
0021 #include <stdexcept>
0022 #include <string>
0023 #include <typeinfo>
0024 #include <vector>
0025
0026 class TTreeReader;
0027
0028 namespace ROOT {
0029 namespace Detail {
0030 namespace RDF {
0031
0032
0033
0034
0035
0036 class RJittedDefine : public RDefineBase {
0037 std::unique_ptr<RDefineBase> fConcreteDefine = nullptr;
0038
0039
0040
0041 const std::type_info *fTypeId = nullptr;
0042
0043 public:
0044 RJittedDefine(std::string_view name, std::string_view type, RLoopManager &lm,
0045 const RDFInternal::RColumnRegister &colRegister, const ColumnNames_t &columns)
0046 : RDefineBase(name, type, colRegister, lm, columns)
0047 {
0048
0049 try {
0050 fTypeId = &RDFInternal::TypeName2TypeID(std::string(type));
0051 } catch (const std::runtime_error &) {
0052 }
0053 }
0054 ~RJittedDefine();
0055
0056 void SetDefine(std::unique_ptr<RDefineBase> c) { fConcreteDefine = std::move(c); }
0057
0058 void InitSlot(TTreeReader *r, unsigned int slot) final;
0059 void *GetValuePtr(unsigned int slot) final;
0060 const std::type_info &GetTypeId() const final;
0061 void Update(unsigned int slot, Long64_t entry) final;
0062 void Update(unsigned int slot, const ROOT::RDF::RSampleInfo &id) final;
0063 void FinalizeSlot(unsigned int slot) final;
0064 void MakeVariations(const std::vector<std::string> &variations) final;
0065 RDefineBase &GetVariedDefine(const std::string &variationName) final;
0066 };
0067
0068 }
0069 }
0070 }
0071
0072 #endif