Logo ROOT  
Reference Guide
TBufferXML.h
Go to the documentation of this file.
1 // @(#)root/xml:$Id: d90d66e8fd2aa9daa4b05bcba9166aee1e2b2e7f $
2 // Author: Sergey Linev 10.05.2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBufferXML
13 #define ROOT_TBufferXML
14 
15 #include "Compression.h"
16 #include "TBufferText.h"
17 #include "TXMLSetup.h"
18 #include "TString.h"
19 #include "TXMLEngine.h"
20 
21 #include <string>
22 #include <deque>
23 #include <memory>
24 
25 class TExMap;
27 class TStreamerInfo;
28 class TStreamerElement;
29 class TMemberStreamer;
30 class TXMLFile;
31 class TXMLStackObj;
32 
33 class TBufferXML final : public TBufferText, public TXMLSetup {
34 
35  friend class TKeyXML;
36 
37 public:
40  virtual ~TBufferXML();
41 
42  static TString ConvertToXML(const TObject *obj, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
43  static TString
44  ConvertToXML(const void *obj, const TClass *cl, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
45 
46  template <class T>
47  static TString ToXML(const T *obj, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE)
48  {
49  return ConvertToXML(obj, TClass::GetClass<T>(), GenericLayout, UseNamespaces);
50  }
51 
52  static TObject *ConvertFromXML(const char *str, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
53  static void *ConvertFromXMLAny(const char *str, TClass **cl = nullptr, Bool_t GenericLayout = kFALSE,
54  Bool_t UseNamespaces = kFALSE);
55 
56  template <class T>
57  static Bool_t FromXML(T *&obj, const char *xml, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE)
58  {
59  if (obj)
60  return kFALSE;
61  obj = (T *)ConvertFromXMLChecked(xml, TClass::GetClass<T>(), GenericLayout, UseNamespaces);
62  return obj != nullptr;
63  }
64 
65  Int_t GetIOVersion() const { return fIOVersion; }
67 
68  // suppress class writing/reading
69 
70  TClass *ReadClass(const TClass *cl = nullptr, UInt_t *objTag = nullptr) final;
71  void WriteClass(const TClass *cl) final;
72 
73  // redefined virtual functions of TBuffer
74 
75  Version_t ReadVersion(UInt_t *start = nullptr, UInt_t *bcnt = nullptr, const TClass *cl = nullptr) final;
76  UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE) final;
77 
78  void *ReadObjectAny(const TClass *clCast) final;
79  void SkipObjectAny() final;
80 
82  void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type) final;
84 
85  void ClassBegin(const TClass *, Version_t = -1) final;
86  void ClassEnd(const TClass *) final;
87  void ClassMember(const char *name, const char *typeName = nullptr, Int_t arrsize1 = -1, Int_t arrsize2 = -1) final;
88 
89  Int_t ReadArray(Bool_t *&b) final;
90  Int_t ReadArray(Char_t *&c) final;
91  Int_t ReadArray(UChar_t *&c) final;
92  Int_t ReadArray(Short_t *&h) final;
93  Int_t ReadArray(UShort_t *&h) final;
94  Int_t ReadArray(Int_t *&i) final;
95  Int_t ReadArray(UInt_t *&i) final;
96  Int_t ReadArray(Long_t *&l) final;
97  Int_t ReadArray(ULong_t *&l) final;
98  Int_t ReadArray(Long64_t *&l) final;
99  Int_t ReadArray(ULong64_t *&l) final;
100  Int_t ReadArray(Float_t *&f) final;
101  Int_t ReadArray(Double_t *&d) final;
102 
103  Int_t ReadStaticArray(Bool_t *b) final;
104  Int_t ReadStaticArray(Char_t *c) final;
105  Int_t ReadStaticArray(UChar_t *c) final;
106  Int_t ReadStaticArray(Short_t *h) final;
108  Int_t ReadStaticArray(Int_t *i) final;
109  Int_t ReadStaticArray(UInt_t *i) final;
110  Int_t ReadStaticArray(Long_t *l) final;
111  Int_t ReadStaticArray(ULong_t *l) final;
114  Int_t ReadStaticArray(Float_t *f) final;
116 
117  void ReadFastArray(Bool_t *b, Int_t n) final;
118  void ReadFastArray(Char_t *c, Int_t n) final;
119  void ReadFastArray(UChar_t *c, Int_t n) final;
120  void ReadFastArray(Short_t *h, Int_t n) final;
121  void ReadFastArray(UShort_t *h, Int_t n) final;
122  void ReadFastArray(Int_t *i, Int_t n) final;
123  void ReadFastArray(UInt_t *i, Int_t n) final;
124  void ReadFastArray(Long_t *l, Int_t n) final;
125  void ReadFastArray(ULong_t *l, Int_t n) final;
126  void ReadFastArray(Long64_t *l, Int_t n) final;
127  void ReadFastArray(ULong64_t *l, Int_t n) final;
128  void ReadFastArray(Float_t *f, Int_t n) final;
129  void ReadFastArray(Double_t *d, Int_t n) final;
130  void ReadFastArrayString(Char_t *c, Int_t n) final;
131  void ReadFastArray(void *start, const TClass *cl, Int_t n = 1, TMemberStreamer *s = nullptr,
132  const TClass *onFileClass = nullptr) final;
133  void ReadFastArray(void **startp, const TClass *cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE,
134  TMemberStreamer *s = nullptr, const TClass *onFileClass = nullptr) final;
135 
136  void WriteArray(const Bool_t *b, Int_t n) final;
137  void WriteArray(const Char_t *c, Int_t n) final;
138  void WriteArray(const UChar_t *c, Int_t n) final;
139  void WriteArray(const Short_t *h, Int_t n) final;
140  void WriteArray(const UShort_t *h, Int_t n) final;
141  void WriteArray(const Int_t *i, Int_t n) final;
142  void WriteArray(const UInt_t *i, Int_t n) final;
143  void WriteArray(const Long_t *l, Int_t n) final;
144  void WriteArray(const ULong_t *l, Int_t n) final;
145  void WriteArray(const Long64_t *l, Int_t n) final;
146  void WriteArray(const ULong64_t *l, Int_t n) final;
147  void WriteArray(const Float_t *f, Int_t n) final;
148  void WriteArray(const Double_t *d, Int_t n) final;
149 
150  void WriteFastArray(const Bool_t *b, Int_t n) final;
151  void WriteFastArray(const Char_t *c, Int_t n) final;
152  void WriteFastArray(const UChar_t *c, Int_t n) final;
153  void WriteFastArray(const Short_t *h, Int_t n) final;
154  void WriteFastArray(const UShort_t *h, Int_t n) final;
155  void WriteFastArray(const Int_t *i, Int_t n) final;
156  void WriteFastArray(const UInt_t *i, Int_t n) final;
157  void WriteFastArray(const Long_t *l, Int_t n) final;
158  void WriteFastArray(const ULong_t *l, Int_t n) final;
159  void WriteFastArray(const Long64_t *l, Int_t n) final;
160  void WriteFastArray(const ULong64_t *l, Int_t n) final;
161  void WriteFastArray(const Float_t *f, Int_t n) final;
162  void WriteFastArray(const Double_t *d, Int_t n) final;
163  void WriteFastArrayString(const Char_t *c, Int_t n) final;
164  void WriteFastArray(void *start, const TClass *cl, Int_t n = 1, TMemberStreamer *s = nullptr) final;
165  Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE,
166  TMemberStreamer *s = nullptr) final;
167 
168  void StreamObject(void *obj, const TClass *cl, const TClass *onFileClass = nullptr) final;
169  using TBufferText::StreamObject;
170 
171  void ReadBool(Bool_t &b) final;
172  void ReadChar(Char_t &c) final;
173  void ReadUChar(UChar_t &c) final;
174  void ReadShort(Short_t &s) final;
175  void ReadUShort(UShort_t &s) final;
176  void ReadInt(Int_t &i) final;
177  void ReadUInt(UInt_t &i) final;
178  void ReadLong(Long_t &l) final;
179  void ReadULong(ULong_t &l) final;
180  void ReadLong64(Long64_t &l) final;
181  void ReadULong64(ULong64_t &l) final;
182  void ReadFloat(Float_t &f) final;
183  void ReadDouble(Double_t &d) final;
184  void ReadCharP(Char_t *c) final;
185  void ReadTString(TString &s) final;
186  void ReadStdString(std::string *s) final;
187  using TBuffer::ReadStdString;
188  void ReadCharStar(char *&s) final;
189 
190  void WriteBool(Bool_t b) final;
191  void WriteChar(Char_t c) final;
192  void WriteUChar(UChar_t c) final;
193  void WriteShort(Short_t s) final;
194  void WriteUShort(UShort_t s) final;
195  void WriteInt(Int_t i) final;
196  void WriteUInt(UInt_t i) final;
197  void WriteLong(Long_t l) final;
198  void WriteULong(ULong_t l) final;
199  void WriteLong64(Long64_t l) final;
200  void WriteULong64(ULong64_t l) final;
201  void WriteFloat(Float_t f) final;
202  void WriteDouble(Double_t d) final;
203  void WriteCharP(const Char_t *c) final;
204  void WriteTString(const TString &s) final;
205  void WriteStdString(const std::string *s) final;
206  using TBuffer::WriteStdString;
207  void WriteCharStar(char *s) final;
208 
209  TVirtualStreamerInfo *GetInfo() final;
210 
211 protected:
212  // redefined protected virtual functions
213 
214  void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) final;
215 
216  // end redefined protected virtual functions
217 
218  static void *ConvertFromXMLChecked(const char *xml, const TClass *expectedClass, Bool_t GenericLayout = kFALSE,
219  Bool_t UseNamespaces = kFALSE);
220 
221  TXMLFile *XmlFile();
222 
224  Int_t GetCompressionLevel() const;
226  void SetCompressionAlgorithm(Int_t algorithm = ROOT::RCompressionSetting::EAlgorithm::kUseGlobal);
227  void SetCompressionLevel(Int_t level = ROOT::RCompressionSetting::ELevel::kUseMin);
228  void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
229  void SetXML(TXMLEngine *xml) { fXML = xml; }
230 
231  void XmlWriteBlock(XMLNodePointer_t node);
232  XMLNodePointer_t XmlWriteAny(const void *obj, const TClass *cl);
233 
234  void XmlReadBlock(XMLNodePointer_t node);
235  void *XmlReadAny(XMLNodePointer_t node, void *obj, TClass **cl);
236 
237  TXMLStackObj *PushStack(XMLNodePointer_t current, Bool_t simple = kFALSE);
238  TXMLStackObj *PopStack();
239  void ShiftStack(const char *info = nullptr);
240 
242  TXMLStackObj *Stack(UInt_t depth = 0)
243  {
244  return (depth < fStack.size()) ? (depth ? fStack[fStack.size() - depth - 1].get() : fStack.back().get()) : nullptr;
245  }
246 
247  void WorkWithClass(TStreamerInfo *info, const TClass *cl = nullptr);
248  void WorkWithElement(TStreamerElement *elem, Int_t comp_type);
249  Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo = nullptr);
250  Bool_t VerifyStackNode(const char *name, const char *errinfo = nullptr);
251 
252  Bool_t VerifyAttr(XMLNodePointer_t node, const char *name, const char *value, const char *errinfo = nullptr);
253  Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo = nullptr);
254 
255  Bool_t ProcessPointer(const void *ptr, XMLNodePointer_t node);
256  Bool_t ExtractPointer(XMLNodePointer_t node, void *&ptr, TClass *&cl);
257  void ExtractReference(XMLNodePointer_t node, const void *ptr, const TClass *cl);
258 
259  XMLNodePointer_t CreateItemNode(const char *name);
260  Bool_t VerifyItemNode(const char *name, const char *errinfo = nullptr);
261 
262  void CreateElemNode(const TStreamerElement *elem);
264 
265  void PerformPreProcessing(const TStreamerElement *elem, XMLNodePointer_t elemnode);
266  void PerformPostProcessing();
267 
281  XMLNodePointer_t XmlWriteValue(const char *value, const char *name);
282 
283  void XmlReadBasic(Char_t &value);
284  void XmlReadBasic(Short_t &value);
285  void XmlReadBasic(Int_t &value);
286  void XmlReadBasic(Long_t &value);
287  void XmlReadBasic(Long64_t &value);
288  void XmlReadBasic(Float_t &value);
289  void XmlReadBasic(Double_t &value);
290  void XmlReadBasic(Bool_t &value);
291  void XmlReadBasic(UChar_t &value);
292  void XmlReadBasic(UShort_t &value);
293  void XmlReadBasic(UInt_t &value);
294  void XmlReadBasic(ULong_t &value);
295  void XmlReadBasic(ULong64_t &value);
296  const char *XmlReadValue(const char *name);
297 
298  template <typename T>
299  R__ALWAYS_INLINE void XmlReadArrayContent(T *arr, Int_t arrsize);
300 
301  template <typename T>
302  R__ALWAYS_INLINE Int_t XmlReadArray(T *&arr, bool is_static = false);
303 
304  template <typename T>
306 
307  template <typename T>
308  R__ALWAYS_INLINE void XmlWriteArrayContent(const T *arr, Int_t arrsize);
309 
310  template <typename T>
311  R__ALWAYS_INLINE void XmlWriteArray(const T *arr, Int_t arrsize);
312 
313  template <typename T>
314  R__ALWAYS_INLINE void XmlWriteFastArray(const T *arr, Int_t n);
315 
316  XMLNodePointer_t XmlWriteObject(const void *obj, const TClass *objClass, Bool_t cacheReuse);
317  void *XmlReadObject(void *obj, TClass **cl = nullptr);
318 
319  void BeforeIOoperation();
320  void CheckVersionBuf();
321 
322  TXMLEngine *fXML{nullptr}; ///<! instance of TXMLEngine for working with XML structures
323  std::deque<std::unique_ptr<TXMLStackObj>> fStack; ///<! Stack of processed objects
324  Version_t fVersionBuf{-111}; ///<! Current version buffer
325  TString fValueBuf; ///<! Current value buffer
326  Int_t fErrorFlag{0}; ///<! Error flag
327  Bool_t fCanUseCompact{kFALSE}; ///<! Flag indicate that basic type (like Int_t) can be placed in the same tag
328  TClass *fExpectedBaseClass{nullptr}; ///<! Pointer to class, which should be stored as parent of current
329  Int_t fCompressLevel{0}; ///<! Compression level and algorithm
330  Int_t fIOVersion{3}; ///<! Indicates format of ROOT xml file
331 
332  ClassDefOverride(TBufferXML, 0); // a specialized TBuffer to read/write to XML files
333 };
334 
335 //______________________________________________________________________________
337 {
338  return (fCompressLevel < 0) ? -1 : fCompressLevel / 100;
339 }
340 
341 //______________________________________________________________________________
343 {
344  return (fCompressLevel < 0) ? -1 : fCompressLevel % 100;
345 }
346 
347 //______________________________________________________________________________
349 {
350  return (fCompressLevel < 0) ? -1 : fCompressLevel;
351 }
352 
353 #endif
TBufferXML::BeforeIOoperation
void BeforeIOoperation()
Function is called before any IO operation of TBuffer Now is used to store version value if no proper...
Definition: TBufferXML.cxx:1393
c
#define c(i)
Definition: RSha256.hxx:101
l
auto * l
Definition: textangle.C:4
TBufferXML::GetCompressionLevel
Int_t GetCompressionLevel() const
Definition: TBufferXML.h:342
TBufferXML::fStack
std::deque< std::unique_ptr< TXMLStackObj > > fStack
! Stack of processed objects
Definition: TBufferXML.h:323
TBufferXML::WriteBool
void WriteBool(Bool_t b) final
Writes Bool_t value to buffer.
Definition: TBufferXML.cxx:2628
TBufferXML::XmlWriteValue
XMLNodePointer_t XmlWriteValue(const char *value, const char *name)
Create xml node with specified name and adds it to stack node.
Definition: TBufferXML.cxx:2949
Compression.h
TBufferXML::ReadStdString
virtual void ReadStdString(std::string *s)=0
n
const Int_t n
Definition: legend1.C:16
TBufferXML::VerifyItemNode
Bool_t VerifyItemNode(const char *name, const char *errinfo=nullptr)
Checks, if stack node is item and has specified name.
Definition: TBufferXML.cxx:687
TBufferXML::ClassMember
void ClassMember(const char *name, const char *typeName=nullptr, Int_t arrsize1=-1, Int_t arrsize2=-1) final
Method indicates name and typename of class member, which should be now streamed in custom streamer.
Definition: TBufferXML.cxx:1100
TBufferXML::ReadULong64
void ReadULong64(ULong64_t &l) final
Reads ULong64_t value from buffer.
Definition: TBufferXML.cxx:2503
TBufferXML::ReadObjectAny
void * ReadObjectAny(const TClass *clCast) final
Read object from buffer. Only used from TBuffer.
Definition: TBufferXML.cxx:1493
TBufferXML::XmlWriteArrayContent
R__ALWAYS_INLINE void XmlWriteArrayContent(const T *arr, Int_t arrsize)
Definition: TBufferXML.cxx:2015
Version_t
short Version_t
Definition: RtypesCore.h:65
TBufferXML::WriteULong64
void WriteULong64(ULong64_t l) final
Writes ULong64_t value to buffer.
Definition: TBufferXML.cxx:2718
TBufferXML::WriteClass
void WriteClass(const TClass *cl) final
Function to write class into buffer, used in old-style streamers.
Definition: TBufferXML.cxx:1417
f
#define f(i)
Definition: RSha256.hxx:104
TBufferXML::ReadULong
void ReadULong(ULong_t &l) final
Reads ULong_t value from buffer.
Definition: TBufferXML.cxx:2485
TBufferXML::GetCompressionAlgorithm
Int_t GetCompressionAlgorithm() const
Definition: TBufferXML.h:336
TBufferXML::GetInfo
TVirtualStreamerInfo * GetInfo() final
Return current streamer info element.
Definition: TBufferXML.cxx:3161
UShort_t
unsigned short UShort_t
Definition: RtypesCore.h:40
TBufferXML::ClassEnd
void ClassEnd(const TClass *) final
Should be called at the end of custom streamer See TBufferXML::ClassBegin for more details.
Definition: TBufferXML.cxx:1057
TBufferXML::SetCompressionLevel
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
See comments for function SetCompressionSettings.
Definition: TBufferXML.cxx:358
TBufferXML::ReadUInt
void ReadUInt(UInt_t &i) final
Reads UInt_t value from buffer.
Definition: TBufferXML.cxx:2467
TBufferXML::ReadFloat
void ReadFloat(Float_t &f) final
Reads Float_t value from buffer.
Definition: TBufferXML.cxx:2512
TBufferXML::XmlWriteBasic
XMLNodePointer_t XmlWriteBasic(Char_t value)
Converts Char_t to string and add xml node to buffer.
Definition: TBufferXML.cxx:2823
TBufferXML::DecrementLevel
void DecrementLevel(TVirtualStreamerInfo *) final
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and decrease level in xml ...
Definition: TBufferXML.cxx:927
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TBufferXML::ReadBool
void ReadBool(Bool_t &b) final
Reads Bool_t value from buffer.
Definition: TBufferXML.cxx:2413
TBufferXML::GetIOVersion
Int_t GetIOVersion() const
Definition: TBufferXML.h:65
TBufferXML::StackNode
XMLNodePointer_t StackNode()
Return pointer on current xml node.
Definition: TBufferXML.cxx:321
Float_t
float Float_t
Definition: RtypesCore.h:57
TBufferXML::WriteUChar
void WriteUChar(UChar_t c) final
Writes UChar_t value to buffer.
Definition: TBufferXML.cxx:2646
TBufferXML::XmlReadArray
R__ALWAYS_INLINE Int_t XmlReadArray(T *&arr, bool is_static=false)
Template method to read array with size attribute If necessary, array is created.
Definition: TBufferXML.cxx:1545
TKeyXML
Definition: TKeyXML.h:20
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TBufferXML::XmlReadValue
const char * XmlReadValue(const char *name)
read string value from current stack node
Definition: TBufferXML.cxx:3128
TBufferXML::WriteFloat
void WriteFloat(Float_t f) final
Writes Float_t value to buffer.
Definition: TBufferXML.cxx:2727
TBufferXML::VerifyStackAttr
Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo=nullptr)
Checks stack attribute.
Definition: TBufferXML.cxx:665
Int_t
int Int_t
Definition: RtypesCore.h:45
TBufferXML::WriteFastArray
void WriteFastArray(const Bool_t *b, Int_t n) final
Write array of Bool_t to buffer.
Definition: TBufferXML.cxx:2172
TBufferXML::ClassDefOverride
ClassDefOverride(TBufferXML, 0)
TBufferXML::ReadTString
void ReadTString(TString &s) final
Reads a TString.
Definition: TBufferXML.cxx:2541
TBufferXML::WriteChar
void WriteChar(Char_t c) final
Writes Char_t value to buffer.
Definition: TBufferXML.cxx:2637
TBufferXML::ReadFastArray
void ReadFastArray(Bool_t *b, Int_t n) final
Read array of Bool_t from buffer.
Definition: TBufferXML.cxx:1795
TBufferXML::SetXML
void SetXML(TXMLEngine *xml)
Definition: TBufferXML.h:229
TBufferXML::VerifyStackNode
Bool_t VerifyStackNode(const char *name, const char *errinfo=nullptr)
Check, if stack node has specified name.
Definition: TBufferXML.cxx:638
TBufferXML::StreamObject
void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=nullptr) override
stream object to/from buffer
Definition: TBufferText.cxx:465
TBufferXML::XmlReadBlock
void XmlReadBlock(XMLNodePointer_t node)
Read binary block of data from xml.
Definition: TBufferXML.cxx:450
TBufferXML::VerifyElemNode
Bool_t VerifyElemNode(const TStreamerElement *elem)
Checks if stack node correspond to TStreamerElement object.
Definition: TBufferXML.cxx:728
TBufferXML::PushStack
TXMLStackObj * PushStack(XMLNodePointer_t current, Bool_t simple=kFALSE)
Add new level to xml stack.
Definition: TBufferXML.cxx:297
TBufferXML::XmlReadObject
void * XmlReadObject(void *obj, TClass **cl=nullptr)
Read object from the buffer.
Definition: TBufferXML.cxx:786
TBuffer
Buffer base class used for serializing objects.
Definition: TBuffer.h:43
TBufferXML::PerformPreProcessing
void PerformPreProcessing(const TStreamerElement *elem, XMLNodePointer_t elemnode)
Function is unpack TObject and TString structures to be able read them from custom streamers of this ...
Definition: TBufferXML.cxx:1319
TBufferXML::XmlReadBasic
void XmlReadBasic(Char_t &value)
Reads string from current xml node and convert it to Char_t value.
Definition: TBufferXML.cxx:2968
TXMLFile
Definition: TXMLFile.h:25
TBufferXML::WriteShort
void WriteShort(Short_t s) final
Writes Short_t value to buffer.
Definition: TBufferXML.cxx:2655
TBufferXML::ReadCharStar
void ReadCharStar(char *&s) final
Read a char* string.
Definition: TBufferXML.cxx:2611
TBufferXML::WriteUInt
void WriteUInt(UInt_t i) final
Writes UInt_t value to buffer.
Definition: TBufferXML.cxx:2682
TBufferXML::WriteCharStar
void WriteCharStar(char *s) final
Write a char* string.
Definition: TBufferXML.cxx:2808
TBufferXML::IncrementLevel
void IncrementLevel(TVirtualStreamerInfo *) final
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and indent new level in xm...
Definition: TBufferXML.cxx:853
TString
Basic string class.
Definition: TString.h:136
TBufferXML::XmlWriteBlock
void XmlWriteBlock(XMLNodePointer_t node)
Write binary data block from buffer to xml.
Definition: TBufferXML.cxx:389
TBufferXML::ReadCharP
void ReadCharP(Char_t *c) final
Reads array of characters from buffer.
Definition: TBufferXML.cxx:2530
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TXMLSetup
Definition: TXMLSetup.h:82
TBufferXML::ProcessPointer
Bool_t ProcessPointer(const void *ptr, XMLNodePointer_t node)
Add "ptr" attribute to node, if ptr is null or if ptr is pointer on object, which is already saved in...
Definition: TBufferXML.cxx:521
TBufferXML::WriteTString
void WriteTString(const TString &s) final
Writes a TString.
Definition: TBufferXML.cxx:2754
v
@ v
Definition: rootcling_impl.cxx:3635
TBufferXML::ReadClass
TClass * ReadClass(const TClass *cl=nullptr, UInt_t *objTag=nullptr) final
Function to read class from buffer, used in old-style streamers.
Definition: TBufferXML.cxx:1401
b
#define b(i)
Definition: RSha256.hxx:100
TString.h
TBufferXML::CreateItemNode
XMLNodePointer_t CreateItemNode(const char *name)
Create item node of specified name.
Definition: TBufferXML.cxx:673
TBufferXML::fCompressLevel
Int_t fCompressLevel
! Compression level and algorithm
Definition: TBufferXML.h:329
TBufferXML::ConvertToXML
static TString ConvertToXML(const TObject *obj, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Converts object, inherited from TObject class, to XML string GenericLayout defines layout choice for ...
Definition: TBufferXML.cxx:104
TVirtualStreamerInfo
Abstract Interface class describing Streamer information for one class.
Definition: TVirtualStreamerInfo.h:37
bool
TBufferXML::SetCompressionSettings
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Used to specify the compression level and algorithm.
Definition: TBufferXML.cxx:380
TBufferText
Base class for text-based streamers like TBufferJSON or TBufferXML Special actions list will use meth...
Definition: TBufferText.h:20
TBufferXML::GetCompressionSettings
Int_t GetCompressionSettings() const
Definition: TBufferXML.h:348
TBufferXML::Stack
TXMLStackObj * Stack(UInt_t depth=0)
Definition: TBufferXML.h:242
TBufferXML::CheckVersionBuf
void CheckVersionBuf()
Checks buffer, filled by WriteVersion if next data is arriving, version should be stored in buffer.
Definition: TBufferXML.cxx:1460
TBufferXML::ReadStaticArray
Int_t ReadStaticArray(Bool_t *b) final
Read array of Bool_t from buffer.
Definition: TBufferXML.cxx:1672
TBufferXML::ReadVersion
Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr) final
Read version value from buffer.
Definition: TBufferXML.cxx:1428
TBufferXML::ReadFastArrayString
void ReadFastArrayString(Char_t *c, Int_t n) final
Read array of n characters from the I/O buffer.
Definition: TBufferXML.cxx:1823
TBufferXML::fValueBuf
TString fValueBuf
! Current value buffer
Definition: TBufferXML.h:325
TBufferXML::ExtractPointer
Bool_t ExtractPointer(XMLNodePointer_t node, void *&ptr, TClass *&cl)
Searches for "ptr" attribute and returns pointer to object and class, if "ptr" attribute reference to...
Definition: TBufferXML.cxx:558
TBufferXML::XmlReadFastArray
R__ALWAYS_INLINE void XmlReadFastArray(T *arr, Int_t n)
Template method to read content of array, which not include size of array Also treated situation,...
Definition: TBufferXML.cxx:1779
TXMLEngine.h
TXMLSetup.h
TBufferXML::fErrorFlag
Int_t fErrorFlag
! Error flag
Definition: TBufferXML.h:326
TBufferXML::ReadChar
void ReadChar(Char_t &c) final
Reads Char_t value from buffer.
Definition: TBufferXML.cxx:2422
TBufferXML::ReadInt
void ReadInt(Int_t &i) final
Reads Int_t value from buffer.
Definition: TBufferXML.cxx:2458
TBuffer::EMode
EMode
Definition: TBuffer.h:73
TStreamerInfo
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:44
h
#define h(i)
Definition: RSha256.hxx:106
TBufferXML::ClassBegin
void ClassBegin(const TClass *, Version_t=-1) final
Should be called at the beginning of custom class streamer.
Definition: TBufferXML.cxx:1048
TXMLEngine
Definition: TXMLEngine.h:26
TBufferXML::PerformPostProcessing
void PerformPostProcessing()
Function is converts TObject and TString structures to more compact representation.
Definition: TBufferXML.cxx:1201
TBufferXML::WriteUShort
void WriteUShort(UShort_t s) final
Writes UShort_t value to buffer.
Definition: TBufferXML.cxx:2664
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TBufferXML::ReadShort
void ReadShort(Short_t &s) final
Reads Short_t value from buffer.
Definition: TBufferXML.cxx:2440
TBufferXML::ReadUChar
void ReadUChar(UChar_t &c) final
Reads UChar_t value from buffer.
Definition: TBufferXML.cxx:2431
Long_t
long Long_t
Definition: RtypesCore.h:54
TBufferXML::SkipObjectAny
void SkipObjectAny() final
Skip any kind of object from buffer Actually skip only one node on current level of xml structure.
Definition: TBufferXML.cxx:1506
TBufferXML::ReadUShort
void ReadUShort(UShort_t &s) final
Reads UShort_t value from buffer.
Definition: TBufferXML.cxx:2449
TBufferXML::SetStreamerElementNumber
void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type) final
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and add/verify next elemen...
Definition: TBufferXML.cxx:959
TBufferXML::CreateElemNode
void CreateElemNode(const TStreamerElement *elem)
Create xml node correspondent to TStreamerElement object.
Definition: TBufferXML.cxx:700
TBufferXML::XmlReadArrayContent
R__ALWAYS_INLINE void XmlReadArrayContent(T *arr, Int_t arrsize)
Template method to read array content.
Definition: TBufferXML.cxx:1526
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
XMLNodePointer_t
void * XMLNodePointer_t
Definition: TXMLEngine.h:17
TBufferXML::TBufferXML
TBufferXML(TBuffer::EMode mode)
Creates buffer object to serialize/deserialize data to/from xml.
Definition: TBufferXML.cxx:58
TBufferXML::VerifyNode
Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo=nullptr)
Check if node has specified name.
Definition: TBufferXML.cxx:620
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
Short_t
short Short_t
Definition: RtypesCore.h:39
TBufferXML::SetIOVersion
void SetIOVersion(Int_t v)
Definition: TBufferXML.h:66
TBufferXML::XmlWriteObject
XMLNodePointer_t XmlWriteObject(const void *obj, const TClass *objClass, Bool_t cacheReuse)
Write object to buffer If object was written before, only pointer will be stored Return pointer to to...
Definition: TBufferXML.cxx:754
TBufferXML::~TBufferXML
virtual ~TBufferXML()
Destroy xml buffer.
Definition: TBufferXML.cxx:85
unsigned int
TBufferXML::ShiftStack
void ShiftStack(const char *info=nullptr)
Shift stack node to next.
Definition: TBufferXML.cxx:330
TBufferXML::fXML
TXMLEngine * fXML
! instance of TXMLEngine for working with XML structures
Definition: TBufferXML.h:322
TBufferXML::ConvertFromXMLAny
static void * ConvertFromXMLAny(const char *str, TClass **cl=nullptr, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object of any class from XML, produced by ConvertToXML() method.
Definition: TBufferXML.cxx:176
TBufferXML::VerifyAttr
Bool_t VerifyAttr(XMLNodePointer_t node, const char *name, const char *value, const char *errinfo=nullptr)
Checks, that attribute of specified name exists and has specified value.
Definition: TBufferXML.cxx:646
TBufferXML::PopStack
TXMLStackObj * PopStack()
Remove one level from xml stack.
Definition: TBufferXML.cxx:311
TBufferXML::XmlWriteFastArray
R__ALWAYS_INLINE void XmlWriteFastArray(const T *arr, Int_t n)
Write array without size attribute Also treat situation, when instead of one single array chain of se...
Definition: TBufferXML.cxx:2158
ULong64_t
unsigned long long ULong64_t
Definition: RtypesCore.h:74
TBufferXML
Class for serializing/deserializing object to/from xml.
Definition: TBufferXML.h:33
TBufferXML::WriteArray
void WriteArray(const Bool_t *b, Int_t n) final
Write array of Bool_t to buffer.
Definition: TBufferXML.cxx:2051
TBufferXML::WorkWithElement
void WorkWithElement(TStreamerElement *elem, Int_t comp_type)
This function is a part of SetStreamerElementNumber method.
Definition: TBufferXML.cxx:970
TBufferText.h
TBufferXML::ReadLong64
void ReadLong64(Long64_t &l) final
Reads Long64_t value from buffer.
Definition: TBufferXML.cxx:2494
TBufferXML::XmlReadAny
void * XmlReadAny(XMLNodePointer_t node, void *obj, TClass **cl)
Recreate object from xml structure.
Definition: TBufferXML.cxx:244
Double_t
double Double_t
Definition: RtypesCore.h:59
TBufferXML::WriteLong64
void WriteLong64(Long64_t l) final
Writes Long64_t value to buffer.
Definition: TBufferXML.cxx:2709
TBufferXML::FromXML
static Bool_t FromXML(T *&obj, const char *xml, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Definition: TBufferXML.h:57
TBufferXML::XmlWriteArray
R__ALWAYS_INLINE void XmlWriteArray(const T *arr, Int_t arrsize)
Write array, including it size Content may be compressed.
Definition: TBufferXML.cxx:2038
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
file
Definition: file.py:1
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TBufferXML::WorkWithClass
void WorkWithClass(TStreamerInfo *info, const TClass *cl=nullptr)
Prepares buffer to stream data of specified class.
Definition: TBufferXML.cxx:861
name
char name[80]
Definition: TGX11.cxx:110
TBufferXML::ConvertFromXMLChecked
static void * ConvertFromXMLChecked(const char *xml, const TClass *expectedClass, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Convert from XML and check if object derived from specified class When possible, cast to given class.
Definition: TBufferXML.cxx:200
ROOT::Math::Chebyshev::T
double T(double x)
Definition: ChebyshevPol.h:34
d
#define d(i)
Definition: RSha256.hxx:102
TBufferXML::WriteInt
void WriteInt(Int_t i) final
Writes Int_t value to buffer.
Definition: TBufferXML.cxx:2673
TBufferXML::SetCompressionAlgorithm
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
See comments for function SetCompressionSettings.
Definition: TBufferXML.cxx:343
TExMap
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:33
TBufferXML::WriteDouble
void WriteDouble(Double_t d) final
Writes Double_t value to buffer.
Definition: TBufferXML.cxx:2736
TBufferXML::fIOVersion
Int_t fIOVersion
! Indicates format of ROOT xml file
Definition: TBufferXML.h:330
TBufferXML::XmlWriteAny
XMLNodePointer_t XmlWriteAny(const void *obj, const TClass *cl)
Convert object of any class to xml structures Return pointer on top xml element.
Definition: TBufferXML.cxx:227
TBufferXML::fExpectedBaseClass
TClass * fExpectedBaseClass
! Pointer to class, which should be stored as parent of current
Definition: TBufferXML.h:328
TBufferXML::fCanUseCompact
Bool_t fCanUseCompact
! Flag indicate that basic type (like Int_t) can be placed in the same tag
Definition: TBufferXML.h:327
TBufferXML::ReadLong
void ReadLong(Long_t &l) final
Reads Long_t value from buffer.
Definition: TBufferXML.cxx:2476
TMemberStreamer
Definition: TMemberStreamer.h:26
TBufferXML::WriteULong
void WriteULong(ULong_t l) final
Writes ULong_t value to buffer.
Definition: TBufferXML.cxx:2700
TBufferXML::ReadArray
Int_t ReadArray(Bool_t *&b) final
Read array of Bool_t from buffer.
Definition: TBufferXML.cxx:1568
TBufferXML::WriteLong
void WriteLong(Long_t l) final
Writes Long_t value to buffer.
Definition: TBufferXML.cxx:2691
TBufferXML::ExtractReference
void ExtractReference(XMLNodePointer_t node, const void *ptr, const TClass *cl)
Analyze if node has "ref" attribute and register it to object map.
Definition: TBufferXML.cxx:594
TBufferXML::ReadDouble
void ReadDouble(Double_t &d) final
Reads Double_t value from buffer.
Definition: TBufferXML.cxx:2521
TBufferXML::WriteCharP
void WriteCharP(const Char_t *c) final
Writes array of characters to buffer.
Definition: TBufferXML.cxx:2745
TBufferXML::WriteObjectClass
void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) final
Write object to buffer. Only used from TBuffer.
Definition: TBufferXML.cxx:1514
Char_t
char Char_t
Definition: RtypesCore.h:33
TBufferXML::fVersionBuf
Version_t fVersionBuf
! Current version buffer
Definition: TBufferXML.h:324
TBufferXML::ToXML
static TString ToXML(const T *obj, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Definition: TBufferXML.h:47
ROOT
VSD Structures.
Definition: StringConv.hxx:21
TStreamerElement
Definition: TStreamerElement.h:33
TBufferXML::ConvertFromXML
static TObject * ConvertFromXML(const char *str, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object from XML, produced by ConvertToXML() method.
Definition: TBufferXML.cxx:153
TBufferXML::XmlFile
TXMLFile * XmlFile()
Returns pointer to TXMLFile object.
Definition: TBufferXML.cxx:93
TBufferXML::WriteFastArrayString
void WriteFastArrayString(const Char_t *c, Int_t n) final
Write array of n characters into the I/O buffer.
Definition: TBufferXML.cxx:2297
int
TBufferXML::WriteStdString
virtual void WriteStdString(const std::string *s)=0
R__ALWAYS_INLINE
#define R__ALWAYS_INLINE
Definition: RConfig.hxx:570
TBufferXML::WriteVersion
UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE) final
Copies class version to buffer, but not writes it to xml Version will be written with next I/O operat...
Definition: TBufferXML.cxx:1475