ATLAS Offline Software
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-2020 CERN for the benefit of the ATLAS collaboration
5 */
42 #ifndef TCONVERTINGBRANCHELEMENT_H
43 #define TCONVERTINGBRANCHELEMENT_H
44 
45 #if defined(__clang__)
46 # pragma clang diagnostic push
47 # if __has_warning("-Wformat-pedantic")
48 # pragma clang diagnostic ignored "-Wformat-pedantic"
49 # endif
50 #endif
51 #include "TBranchElement.h"
52 #if defined(__clang__)
53 # pragma clang diagnostic pop
54 #endif
55 
56 #include <atomic>
57 
58 class TVirtualConverter;
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 {
73 public:
74  // --- Public methods ---
77 
79  virtual ~TConvertingBranchElement();
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__
104 
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 
131 protected:
136  virtual void InitInfo();
137 
142  virtual void InitializeOffsets();
143 
148  void ReadLeavesCollectionConverting(TBuffer& b);
149 
151 
152 
153 private:
155  enum {
156  kIsDummy = BIT(20)
157  };
158 
168  static void* new_TConvertingBranchElement (void* p);
169 
173  void BuildConvertedElisions();
174 
179  void CheckForConversion();
180 
184  void ConvResetType();
185 
193  Int_t ReadSubBranches(Long64_t entry,
194  Int_t getall,
195  bool dont_reset);
196 
198  TClass *fConvClass;
199  char *fConvObject;
200  TObjArray *fConvOrigBranches;
201  // the branch list, we store the
202  // original one here, so that
203  // when we stream, we use the
204  // original.
206  // type is stored here, so that if
207  // we stream, we can save the original
208  // type. This is set to -1 before
209  // it's initialized.
211  // conversion.
213  // not reset the buffer pointer.
214  // See GetEntry().
215  static std::atomic<bool> fgDoDel;
216  // branch object when the branch
217  // is deleted.
218 
219 
222 };
223 
224 #endif
225 
TConvertingBranchElement::operator=
TConvertingBranchElement & operator=(const TConvertingBranchElement &)
If true, try to delete the.
TConvertingBranchElement::fConvOrigBranches
TObjArray * fConvOrigBranches
Pointer to tmp obj used for conversion.
Definition: TConvertingBranchElement.h:200
TConvertingBranchElement::ConvResetType
void ConvResetType()
Recursively reset the type field of containers in conversions.
Definition: TConvertingBranchElement.cxx:753
TConvertingBranchElement::fgDoDel
static std::atomic< bool > fgDoDel
Flag that the next read should.
Definition: TConvertingBranchElement.h:215
TConvertingBranchElement::fConvDontReset
bool fConvDontReset
True if we're doing a container.
Definition: TConvertingBranchElement.h:212
TConvertingBranchElement::ReadSubBranches
Int_t ReadSubBranches(Long64_t entry, Int_t getall, bool dont_reset)
@branch Read in the subbranches of this branch.
Definition: TConvertingBranchElement.cxx:1125
TConvertingBranchElement::InitializeOffsets
virtual void InitializeOffsets()
Initialize data member offsets.
Definition: TConvertingBranchElement.cxx:1301
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TConvertingBranchElement::GetEntry
virtual Int_t GetEntry(Long64_t entry, Int_t getall)
Read all branches into the previously-declared object.
Definition: TConvertingBranchElement.cxx:858
TVirtualConverter
Base class for converters for Root schema evolution.
Definition: TVirtualConverter.h:110
master.flag
bool flag
Definition: master.py:29
TConvertingBranchElement::ReadLeavesCollectionConverting
void ReadLeavesCollectionConverting(TBuffer &b)
Read leaves into I/O buffers for this branch.
Definition: TConvertingBranchElement.cxx:977
TConvertingBranchElement::ReadLeavesMemberBranchCountConverting
void ReadLeavesMemberBranchCountConverting(TBuffer &b)
Definition: TConvertingBranchElement.cxx:1069
TConvertingBranchElement::SetDoDel
static void SetDoDel(bool flag)
Set the deletion flag.
Definition: TConvertingBranchElement.cxx:1464
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
TConvertingBranchElement::fConvClass
TClass * fConvClass
Conversion for this branch.
Definition: TConvertingBranchElement.h:198
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TConvertingBranchElement::Initialize
static void Initialize()
Set up to allow for conversions in split mode.
Definition: TConvertingBranchElement.cxx:335
TConvertingBranchElement::fConv
TVirtualConverter * fConv
Definition: TConvertingBranchElement.h:197
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TConvertingBranchElement
A variant of TBranchElement that can call converters when reading objects in split mode.
Definition: TConvertingBranchElement.h:72
TConvertingBranchElement::~TConvertingBranchElement
virtual ~TConvertingBranchElement()
Destructor.
Definition: TConvertingBranchElement.cxx:304
TConvertingBranchElement::Streamer
virtual void Streamer(TBuffer &R__b)
Read or write this object.
Definition: TConvertingBranchElement.cxx:1268
TConvertingBranchElement::ResetAddress
virtual void ResetAddress()
Reset branch addresses and maybe delete the object.
Definition: TConvertingBranchElement.cxx:1388
TConvertingBranchElement::kIsDummy
@ kIsDummy
Definition: TConvertingBranchElement.h:156
TConvertingBranchElement::fConvObject
char * fConvObject
Class for conversion.
Definition: TConvertingBranchElement.h:199
TConvertingBranchElement::fConvOrigType
Int_t fConvOrigType
Saved branch list. If we change.
Definition: TConvertingBranchElement.h:205
TConvertingBranchElement::SetAddress
virtual void SetAddress(void *add)
Set the address of the object to use for I/O.
Definition: TConvertingBranchElement.cxx:1358
TConvertingBranchElement::InitInfo
virtual void InitInfo()
Initialize the TStreamerInfo pointer.
Definition: TConvertingBranchElement.cxx:721
TConvertingBranchElement::TConvertingBranchElement
TConvertingBranchElement()
Constructor.
Definition: TConvertingBranchElement.cxx:287
TConvertingBranchElement::CheckForConversion
void CheckForConversion()
Check to see if we need to worry about conversions for this branch.
Definition: TConvertingBranchElement.cxx:611
TConvertingBranchElement::BuildConvertedElisions
void BuildConvertedElisions()
Add dummy nodes if needed to recover the correct tree structure.
Definition: TConvertingBranchElement.cxx:397
TConvertingBranchElement::fConvContainerFlag
bool fConvContainerFlag
Saved branch type. The original.
Definition: TConvertingBranchElement.h:210
TConvertingBranchElement::TConvertingBranchElement
TConvertingBranchElement(const TConvertingBranchElement &)
TConvertingBranchElement::new_TConvertingBranchElement
static void * new_TConvertingBranchElement(void *p)
new() method for this object.
Definition: TConvertingBranchElement.cxx:366