ATLAS Offline Software
Loading...
Searching...
No Matches
TConvertingBranchElement.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
40
41
42#ifndef ROOTCONVERSIONS_TCONVERTINGBRANCHELEMENT_H
43#define ROOTCONVERSIONS_TCONVERTINGBRANCHELEMENT_H
44
45#include <atomic>
46
47#if defined(__clang__)
48# pragma clang diagnostic push
49# if __has_warning("-Wformat-pedantic")
50# pragma clang diagnostic ignored "-Wformat-pedantic"
51# endif
52#endif
53#include "TBranchElement.h"
54#if defined(__clang__)
55# pragma clang diagnostic pop
56#endif
57
59
65#ifndef __REFLEX__
66#ifndef __CLING__
67 : public TBranchElement
68 // Need to hide the base class from reflex and cling so that it doesn't
69 // insist on generating the ClassDef functions.
70#endif
71#endif
72{
73public:
74 // --- Public methods ---
77
80
84 static void Initialize();
85
99 virtual Int_t GetEntry(Long64_t entry, Int_t getall);
100
101 // Need to hide this from cling; otherwise, genreflex will try to
102 // generate an implementation for this.
103#ifndef __CLING__
108 virtual void Streamer(TBuffer& R__b);
109#endif
110
115 virtual void SetAddress(void* add);
116
120 virtual void ResetAddress();
121
122
127 static void SetDoDel (bool flag);
128
129
130
131protected:
136 virtual void InitInfo();
137
142 virtual void InitializeOffsets();
143
148 void ReadLeavesCollectionConverting(TBuffer& b);
149
151
152
153private:
155 static constexpr unsigned int kIsDummy = BIT(20);
156
166 static void* new_TConvertingBranchElement (void* p);
167
172
177 void CheckForConversion();
178
182 void ConvResetType();
183
191 Int_t ReadSubBranches(Long64_t entry,
192 Int_t getall,
193 bool dont_reset);
194
196 TClass *fConvClass;
198 TObjArray *fConvOrigBranches;
199 // the branch list, we store the
200 // original one here, so that
201 // when we stream, we use the
202 // original.
204 // type is stored here, so that if
205 // we stream, we can save the original
206 // type. This is set to -1 before
207 // it's initialized.
209 // conversion.
211 // not reset the buffer pointer.
212 // See GetEntry().
213 static std::atomic<bool> fgDoDel;
214 // branch object when the branch
215 // is deleted.
216
217
220};
221
222#endif // not ROOTCONVERSIONS_TCONVERTINGBRANCHELEMENT_H
223
Int_t fConvOrigType
Saved branch list. If we change.
void ReadLeavesMemberBranchCountConverting(TBuffer &b)
virtual void SetAddress(void *add)
Set the address of the object to use for I/O.
bool fConvDontReset
True if we're doing a container.
virtual void ResetAddress()
Reset branch addresses and maybe delete the object.
virtual void Streamer(TBuffer &R__b)
Read or write this object.
virtual Int_t GetEntry(Long64_t entry, Int_t getall)
Read all branches into the previously-declared object.
TConvertingBranchElement & operator=(const TConvertingBranchElement &)
If true, try to delete the.
static void SetDoDel(bool flag)
Set the deletion flag.
TConvertingBranchElement(const TConvertingBranchElement &)
void ConvResetType()
Recursively reset the type field of containers in conversions.
bool fConvContainerFlag
Saved branch type. The original.
TClass * fConvClass
Conversion for this branch.
static std::atomic< bool > fgDoDel
Flag that the next read should.
static void * new_TConvertingBranchElement(void *p)
new() method for this object.
static constexpr unsigned int kIsDummy
Flag used to mark dummy nodes created by BuildConvertedElisions.
char * fConvObject
Class for conversion.
void ReadLeavesCollectionConverting(TBuffer &b)
Read leaves into I/O buffers for this branch.
virtual ~TConvertingBranchElement()
Destructor.
static void Initialize()
Set up to allow for conversions in split mode.
Int_t ReadSubBranches(Long64_t entry, Int_t getall, bool dont_reset)
@branch Read in the subbranches of this branch.
virtual void InitializeOffsets()
Initialize data member offsets.
virtual void InitInfo()
Initialize the TStreamerInfo pointer.
void CheckForConversion()
Check to see if we need to worry about conversions for this branch.
void BuildConvertedElisions()
Add dummy nodes if needed to recover the correct tree structure.
TObjArray * fConvOrigBranches
Pointer to tmp obj used for conversion.
Base class for converters for Root schema evolution.
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55