Logo ROOT   6.12/07
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 "TBufferFile.h"
16 #include "TXMLSetup.h"
17 #include "TXMLEngine.h"
18 #include "TString.h"
19 #include "TObjArray.h"
20 
21 #include <string>
22 
23 class TExMap;
25 class TStreamerInfo;
26 class TStreamerElement;
27 class TObjArray;
28 class TMemberStreamer;
29 class TXMLFile;
30 class TXMLStackObj;
31 
32 class TBufferXML : public TBufferFile, public TXMLSetup {
33 
34  friend class TKeyXML;
35 
36 public:
39  virtual ~TBufferXML();
40 
41  static TString ConvertToXML(const TObject *obj, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
42  static TString
43  ConvertToXML(const void *obj, const TClass *cl, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
44 
45  static TObject *ConvertFromXML(const char *str, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
46  static void *
47  ConvertFromXMLAny(const char *str, TClass **cl = 0, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
48 
49  Int_t GetIOVersion() const { return fIOVersion; }
51 
52  // suppress class writing/reading
53 
54  virtual TClass *ReadClass(const TClass *cl = 0, UInt_t *objTag = 0);
55  virtual void WriteClass(const TClass *cl);
56 
57  // redefined virtual functions of TBuffer
58 
59  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); // SL
60  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); // SL
61  virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); // SL
62 
63  virtual void SkipVersion(const TClass *cl = 0);
64  virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0); // SL
65  virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE); // SL
66 
67  virtual void *ReadObjectAny(const TClass *clCast);
68  virtual void SkipObjectAny();
69 
70  virtual void IncrementLevel(TVirtualStreamerInfo *);
71  virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type);
72  virtual void DecrementLevel(TVirtualStreamerInfo *);
73 
74  virtual void ClassBegin(const TClass *, Version_t = -1);
75  virtual void ClassEnd(const TClass *);
76  virtual void ClassMember(const char *name, const char *typeName = 0, Int_t arrsize1 = -1, Int_t arrsize2 = -1);
77 
78  virtual void ReadFloat16(Float_t *f, TStreamerElement *ele = 0);
79  virtual void WriteFloat16(Float_t *f, TStreamerElement *ele = 0);
80  virtual void ReadDouble32(Double_t *d, TStreamerElement *ele = 0);
81  virtual void WriteDouble32(Double_t *d, TStreamerElement *ele = 0);
82  virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue);
83  virtual void ReadWithNbits(Float_t *ptr, Int_t nbits);
84  virtual void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue);
85  virtual void ReadWithNbits(Double_t *ptr, Int_t nbits);
86 
87  virtual Int_t ReadArray(Bool_t *&b);
88  virtual Int_t ReadArray(Char_t *&c);
89  virtual Int_t ReadArray(UChar_t *&c);
90  virtual Int_t ReadArray(Short_t *&h);
91  virtual Int_t ReadArray(UShort_t *&h);
92  virtual Int_t ReadArray(Int_t *&i);
93  virtual Int_t ReadArray(UInt_t *&i);
94  virtual Int_t ReadArray(Long_t *&l);
95  virtual Int_t ReadArray(ULong_t *&l);
96  virtual Int_t ReadArray(Long64_t *&l);
97  virtual Int_t ReadArray(ULong64_t *&l);
98  virtual Int_t ReadArray(Float_t *&f);
99  virtual Int_t ReadArray(Double_t *&d);
100  virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele = 0);
101  virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele = 0);
102 
103  virtual Int_t ReadStaticArray(Bool_t *b);
104  virtual Int_t ReadStaticArray(Char_t *c);
105  virtual Int_t ReadStaticArray(UChar_t *c);
106  virtual Int_t ReadStaticArray(Short_t *h);
107  virtual Int_t ReadStaticArray(UShort_t *h);
108  virtual Int_t ReadStaticArray(Int_t *i);
109  virtual Int_t ReadStaticArray(UInt_t *i);
110  virtual Int_t ReadStaticArray(Long_t *l);
111  virtual Int_t ReadStaticArray(ULong_t *l);
112  virtual Int_t ReadStaticArray(Long64_t *l);
113  virtual Int_t ReadStaticArray(ULong64_t *l);
114  virtual Int_t ReadStaticArray(Float_t *f);
115  virtual Int_t ReadStaticArray(Double_t *d);
118 
119  virtual void ReadFastArray(Bool_t *b, Int_t n);
120  virtual void ReadFastArray(Char_t *c, Int_t n);
121  virtual void ReadFastArray(UChar_t *c, Int_t n);
122  virtual void ReadFastArray(Short_t *h, Int_t n);
123  virtual void ReadFastArray(UShort_t *h, Int_t n);
124  virtual void ReadFastArray(Int_t *i, Int_t n);
125  virtual void ReadFastArray(UInt_t *i, Int_t n);
126  virtual void ReadFastArray(Long_t *l, Int_t n);
127  virtual void ReadFastArray(ULong_t *l, Int_t n);
128  virtual void ReadFastArray(Long64_t *l, Int_t n);
129  virtual void ReadFastArray(ULong64_t *l, Int_t n);
130  virtual void ReadFastArray(Float_t *f, Int_t n);
131  virtual void ReadFastArray(Double_t *d, Int_t n);
132  virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele = 0);
133  virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele = 0);
134  virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue);
135  virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits);
136  virtual void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue);
137  virtual void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits);
138 
139  virtual void WriteArray(const Bool_t *b, Int_t n);
140  virtual void WriteArray(const Char_t *c, Int_t n);
141  virtual void WriteArray(const UChar_t *c, Int_t n);
142  virtual void WriteArray(const Short_t *h, Int_t n);
143  virtual void WriteArray(const UShort_t *h, Int_t n);
144  virtual void WriteArray(const Int_t *i, Int_t n);
145  virtual void WriteArray(const UInt_t *i, Int_t n);
146  virtual void WriteArray(const Long_t *l, Int_t n);
147  virtual void WriteArray(const ULong_t *l, Int_t n);
148  virtual void WriteArray(const Long64_t *l, Int_t n);
149  virtual void WriteArray(const ULong64_t *l, Int_t n);
150  virtual void WriteArray(const Float_t *f, Int_t n);
151  virtual void WriteArray(const Double_t *d, Int_t n);
152  virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele = 0);
153  virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele = 0);
154  virtual void
155  ReadFastArray(void *start, const TClass *cl, Int_t n = 1, TMemberStreamer *s = 0, const TClass *onFileClass = 0);
156  virtual void ReadFastArray(void **startp, const TClass *cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE,
157  TMemberStreamer *s = 0, const TClass *onFileClass = 0);
158 
159  virtual void WriteFastArray(const Bool_t *b, Int_t n);
160  virtual void WriteFastArray(const Char_t *c, Int_t n);
161  virtual void WriteFastArray(const UChar_t *c, Int_t n);
162  virtual void WriteFastArray(const Short_t *h, Int_t n);
163  virtual void WriteFastArray(const UShort_t *h, Int_t n);
164  virtual void WriteFastArray(const Int_t *i, Int_t n);
165  virtual void WriteFastArray(const UInt_t *i, Int_t n);
166  virtual void WriteFastArray(const Long_t *l, Int_t n);
167  virtual void WriteFastArray(const ULong_t *l, Int_t n);
168  virtual void WriteFastArray(const Long64_t *l, Int_t n);
169  virtual void WriteFastArray(const ULong64_t *l, Int_t n);
170  virtual void WriteFastArray(const Float_t *f, Int_t n);
171  virtual void WriteFastArray(const Double_t *d, Int_t n);
172  virtual void WriteFastArrayFloat16(const Float_t *d, Int_t n, TStreamerElement *ele = 0);
173  virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele = 0);
174  virtual void WriteFastArray(void *start, const TClass *cl, Int_t n = 1, TMemberStreamer *s = 0);
175  virtual Int_t
176  WriteFastArray(void **startp, const TClass *cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE, TMemberStreamer *s = 0);
177 
178  virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass = 0);
179  virtual void StreamObject(void *obj, const char *className, const TClass *onFileClass = 0);
180  virtual void StreamObject(void *obj, const TClass *cl, const TClass *onFileClass = 0);
181  virtual void StreamObject(TObject *obj);
182 
183  virtual void ReadBool(Bool_t &b);
184  virtual void ReadChar(Char_t &c);
185  virtual void ReadUChar(UChar_t &c);
186  virtual void ReadShort(Short_t &s);
187  virtual void ReadUShort(UShort_t &s);
188  virtual void ReadInt(Int_t &i);
189  virtual void ReadUInt(UInt_t &i);
190  virtual void ReadLong(Long_t &l);
191  virtual void ReadULong(ULong_t &l);
192  virtual void ReadLong64(Long64_t &l);
193  virtual void ReadULong64(ULong64_t &l);
194  virtual void ReadFloat(Float_t &f);
195  virtual void ReadDouble(Double_t &d);
196  virtual void ReadCharP(Char_t *c);
197  virtual void ReadTString(TString &s);
198  virtual void ReadStdString(std::string *s);
200  virtual void ReadCharStar(char *&s);
201 
202  virtual void WriteBool(Bool_t b);
203  virtual void WriteChar(Char_t c);
204  virtual void WriteUChar(UChar_t c);
205  virtual void WriteShort(Short_t s);
206  virtual void WriteUShort(UShort_t s);
207  virtual void WriteInt(Int_t i);
208  virtual void WriteUInt(UInt_t i);
209  virtual void WriteLong(Long_t l);
210  virtual void WriteULong(ULong_t l);
211  virtual void WriteLong64(Long64_t l);
212  virtual void WriteULong64(ULong64_t l);
213  virtual void WriteFloat(Float_t f);
214  virtual void WriteDouble(Double_t d);
215  virtual void WriteCharP(const Char_t *c);
216  virtual void WriteTString(const TString &s);
217  virtual void WriteStdString(const std::string *s);
219  virtual void WriteCharStar(char *s);
220 
221  virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);
222  virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection,
223  void *end_collection);
224  virtual Int_t
225  ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
226 
227  // end of redefined virtual functions
228 
229  static void SetFloatFormat(const char *fmt = "%e");
230  static const char *GetFloatFormat();
231 
232 protected:
233  TBufferXML();
234 
235  // redefined protected virtual functions
236 
237  virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse);
238 
239  // end redefined protected virtual functions
240 
241  TXMLFile *XmlFile();
242 
244  Int_t GetCompressionLevel() const;
246  void SetCompressionAlgorithm(Int_t algorithm = 0);
247  void SetCompressionLevel(Int_t level = 1);
248  void SetCompressionSettings(Int_t settings = 1);
249  void SetXML(TXMLEngine *xml) { fXML = xml; }
250 
251  void XmlWriteBlock(XMLNodePointer_t node);
252  XMLNodePointer_t XmlWriteAny(const void *obj, const TClass *cl);
253 
254  void XmlReadBlock(XMLNodePointer_t node);
255  void *XmlReadAny(XMLNodePointer_t node, void *obj, TClass **cl);
256 
257  TXMLStackObj *PushStack(XMLNodePointer_t current, Bool_t simple = kFALSE);
258  TXMLStackObj *PopStack();
259  void ShiftStack(const char *info = 0);
260 
262  TXMLStackObj *Stack(Int_t depth = 0);
263 
264  void WorkWithClass(TStreamerInfo *info, const TClass *cl = 0);
265  void WorkWithElement(TStreamerElement *elem, Int_t comp_type);
266  Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo = 0);
267  Bool_t VerifyStackNode(const char *name, const char *errinfo = 0);
268 
269  Bool_t VerifyAttr(XMLNodePointer_t node, const char *name, const char *value, const char *errinfo = 0);
270  Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo = 0);
271 
272  Bool_t ProcessPointer(const void *ptr, XMLNodePointer_t node);
273  void RegisterPointer(const void *ptr, XMLNodePointer_t node);
274  Bool_t ExtractPointer(XMLNodePointer_t node, void *&ptr, TClass *&cl);
275  void ExtractReference(XMLNodePointer_t node, const void *ptr, const TClass *cl);
276 
277  XMLNodePointer_t CreateItemNode(const char *name);
278  Bool_t VerifyItemNode(const char *name, const char *errinfo = 0);
279 
280  void CreateElemNode(const TStreamerElement *elem);
282 
283  void PerformPreProcessing(const TStreamerElement *elem, XMLNodePointer_t elemnode);
284  void PerformPostProcessing();
285 
299  XMLNodePointer_t XmlWriteValue(const char *value, const char *name);
300 
301  void XmlReadBasic(Char_t &value);
302  void XmlReadBasic(Short_t &value);
303  void XmlReadBasic(Int_t &value);
304  void XmlReadBasic(Long_t &value);
305  void XmlReadBasic(Long64_t &value);
306  void XmlReadBasic(Float_t &value);
307  void XmlReadBasic(Double_t &value);
308  void XmlReadBasic(Bool_t &value);
309  void XmlReadBasic(UChar_t &value);
310  void XmlReadBasic(UShort_t &value);
311  void XmlReadBasic(UInt_t &value);
312  void XmlReadBasic(ULong_t &value);
313  void XmlReadBasic(ULong64_t &value);
314  const char *XmlReadValue(const char *name);
315 
316  XMLNodePointer_t XmlWriteObject(const void *obj, const TClass *objClass, Bool_t cacheReuse);
317  void *XmlReadObject(void *obj, TClass **cl = 0);
318 
319  void BeforeIOoperation();
320  void CheckVersionBuf();
321 
323 
325 
327 
330 
332 
334 
335  Bool_t fCanUseCompact; ///<! Flag indicate that basic type (like Int_t) can be placed in the same tag
336  Bool_t fExpectedChain; ///<! Flag to resolve situation when several elements of same basic type stored as FastArray
337  TClass *fExpectedBaseClass; ///<! Pointer to class, which should be stored as parent of current
338  Int_t fCompressLevel; ///<! Compression level and algorithm
339  Int_t fIOVersion; ///<! Indicates format of ROOT xml file
340 
341  static std::string
342  fgFloatFmt; ///<! Printf argument for floats and doubles, either "%f" or "%e" or "%10f" and so on
343 
344  ClassDef(TBufferXML, 0); // a specialized TBuffer to read/write to XML files
345 };
346 
347 //______________________________________________________________________________
349 {
350  return (fCompressLevel < 0) ? -1 : fCompressLevel / 100;
351 }
352 
353 //______________________________________________________________________________
355 {
356  return (fCompressLevel < 0) ? -1 : fCompressLevel % 100;
357 }
358 
359 //______________________________________________________________________________
361 {
362  return (fCompressLevel < 0) ? -1 : fCompressLevel;
363 }
364 
365 #endif
Int_t fCompressLevel
! Compression level and algorithm
Definition: TBufferXML.h:338
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:43
XMLNodePointer_t CreateItemNode(const char *name)
Create item node of specified name.
Definition: TBufferXML.cxx:716
virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
virtual ~TBufferXML()
Destroy xml buffer.
Definition: TBufferXML.cxx:111
void XmlReadBlock(XMLNodePointer_t node)
Read binary block of data from xml.
Definition: TBufferXML.cxx:470
TXMLStackObj * PushStack(XMLNodePointer_t current, Bool_t simple=kFALSE)
Add new level to xml stack.
Definition: TBufferXML.cxx:300
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of Bool_t from buffer.
virtual Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
An array of TObjects.
Definition: TObjArray.h:37
Int_t GetCompressionSettings() const
Definition: TBufferXML.h:360
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)
Read a Float16_t from the buffer.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Definition: TBufferFile.h:47
virtual void WriteLong64(Long64_t l)
Writes Long64_t value to buffer.
void SetCompressionAlgorithm(Int_t algorithm=0)
See comments for function SetCompressionSettings.
Definition: TBufferXML.cxx:362
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
long long Long64_t
Definition: RtypesCore.h:69
void WorkWithElement(TStreamerElement *elem, Int_t comp_type)
This function is a part of SetStreamerElementNumber method.
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:542
void XmlWriteBlock(XMLNodePointer_t node)
Write binary data block from buffer to xml.
Definition: TBufferXML.cxx:409
virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue)
Read a Double32_t from the buffer when the factor and minimun value have been specified see comments ...
virtual void ReadLong(Long_t &l)
Reads Long_t value from buffer.
short Version_t
Definition: RtypesCore.h:61
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
virtual Int_t ReadArray(Bool_t *&b)
Read array of Bool_t from buffer.
TString fValueBuf
Definition: TBufferXML.h:331
static void * ConvertFromXMLAny(const char *str, TClass **cl=0, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object of any class from XML, produced by ConvertToXML() method.
Definition: TBufferXML.cxx:206
float Float_t
Definition: RtypesCore.h:53
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
void SetCompressionSettings(Int_t settings=1)
Used to specify the compression level and algorithm.
Definition: TBufferXML.cxx:400
void SetCompressionLevel(Int_t level=1)
See comments for function SetCompressionSettings.
Definition: TBufferXML.cxx:378
unsigned short UShort_t
Definition: RtypesCore.h:36
virtual void ClassMember(const char *name, const char *typeName=0, Int_t arrsize1=-1, Int_t arrsize2=-1)
Method indicates name and typename of class member, which should be now streamed in custom streamer...
TH1 * h
Definition: legend2.C:5
virtual void WriteULong64(ULong64_t l)
Writes ULong64_t value to buffer.
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of Bool_t from buffer.
virtual void SkipVersion(const TClass *cl=0)
Skip class version from I/O buffer.
Version_t fVersionBuf
Definition: TBufferXML.h:326
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)
Suppressed function of TBuffer.
virtual void WriteCharStar(char *s)
Write a char* string.
void RegisterPointer(const void *ptr, XMLNodePointer_t node)
Register pair of object pointer and node, where this object is saved, in object map.
Definition: TBufferXML.cxx:584
Basic string class.
Definition: TString.h:125
virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
virtual void WriteChar(Char_t c)
Writes Char_t value to buffer.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual TClass * ReadClass(const TClass *cl=0, UInt_t *objTag=0)
Function to read class from buffer, used in old-style streamers.
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:229
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)
Read array of Float16_t from buffer.
void CreateElemNode(const TStreamerElement *elem)
Create xml node correspondent to TStreamerElement object.
Definition: TBufferXML.cxx:743
virtual void WriteTString(const TString &s)
Writes a TString.
virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0)
Write a Double32_t to the buffer.
XMLNodePointer_t XmlWriteValue(const char *value, const char *name)
Create xml node with specified name and adds it to stack node.
virtual void WriteULong(ULong_t l)
Writes ULong_t value to buffer.
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:797
virtual void WriteStdString(const std::string *s)
Writes a TString.
TXMLEngine * fXML
Definition: TBufferXML.h:322
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
TXMLFile * XmlFile()
Returns pointer to TXMLFile object.
Definition: TBufferXML.cxx:124
virtual void WriteInt(Int_t i)
Writes Int_t value to buffer.
Bool_t VerifyAttr(XMLNodePointer_t node, const char *name, const char *value, const char *errinfo=0)
Checks, that attribute of specified name exists and has specified value.
Definition: TBufferXML.cxx:690
virtual void WriteShort(Short_t s)
Writes Short_t value to buffer.
TExMap * fObjMap
Definition: TBufferXML.h:328
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
virtual void DecrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and decrease level in xml ...
Definition: TBufferXML.cxx:969
Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo=0)
Check if node has specified name.
Definition: TBufferXML.cxx:664
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
virtual void WriteUChar(UChar_t c)
Writes UChar_t value to buffer.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)
Read version value from buffer.
virtual void ReadCharStar(char *&s)
Read a char* string.
void BeforeIOoperation()
Function is called before any IO operation of TBuffer Now is used to store version value if no proper...
virtual void ReadShort(Short_t &s)
Reads Short_t value from buffer.
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)
steram object to/from buffer
virtual void WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
virtual void WriteUInt(UInt_t i)
Writes UInt_t value to buffer.
virtual void ReadStdString(std::string *s)=0
void SetIOVersion(Int_t v)
Definition: TBufferXML.h:50
virtual void ReadStdString(std::string *s)
Reads a std::string.
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
virtual void WriteCharP(const Char_t *c)
Writes array of characters to buffer.
virtual void ReadULong64(ULong64_t &l)
Reads ULong64_t value from buffer.
virtual void ReadBool(Bool_t &b)
Reads Bool_t value from buffer.
XMLNodePointer_t StackNode()
Return pointer on current xml node.
Definition: TBufferXML.cxx:340
virtual void ReadUChar(UChar_t &c)
Reads UChar_t value from buffer.
virtual void ReadDouble32(Double_t *d, TStreamerElement *ele=0)
Read a Double32_t from the buffer.
TObjArray fStack
Definition: TBufferXML.h:324
Int_t fIOVersion
! Indicates format of ROOT xml file
Definition: TBufferXML.h:339
virtual void ReadUInt(UInt_t &i)
Reads UInt_t value from buffer.
TClass * fExpectedBaseClass
! Pointer to class, which should be stored as parent of current
Definition: TBufferXML.h:337
void ShiftStack(const char *info=0)
Shift stack node to next.
Definition: TBufferXML.cxx:349
Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo=0)
Checks stack attribute.
Definition: TBufferXML.cxx:708
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
void SetXML(TXMLEngine *xml)
Definition: TBufferXML.h:249
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and indent new level in xm...
Definition: TBufferXML.cxx:894
SVector< double, 2 > v
Definition: Dict.h:5
virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
TBufferXML()
Default constructor.
Definition: TBufferXML.cxx:62
virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0)
Write a Float16_t to the buffer.
static std::string fgFloatFmt
! Printf argument for floats and doubles, either "%f" or "%e" or "%10f" and so on ...
Definition: TBufferXML.h:342
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void ClassEnd(const TClass *)
Should be called at the end of custom streamer See TBufferXML::ClassBegin for more details...
short Short_t
Definition: RtypesCore.h:35
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
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:135
Bool_t fCanUseCompact
! Flag indicate that basic type (like Int_t) can be placed in the same tag
Definition: TBufferXML.h:335
virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)
Write array of Float16_t to buffer.
Bool_t VerifyStackNode(const char *name, const char *errinfo=0)
Check, if stack node has specified name.
Definition: TBufferXML.cxx:682
void * XMLNodePointer_t
Definition: TXMLEngine.h:17
Bool_t VerifyElemNode(const TStreamerElement *elem)
Checks if stack node correspond to TStreamerElement object.
Definition: TBufferXML.cxx:771
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:635
static void SetFloatFormat(const char *fmt="%e")
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 ...
virtual void WriteFloat(Float_t f)
Writes Float_t value to buffer.
void CheckVersionBuf()
Checks buffer, filled by WriteVersion if next data is arriving, version should be stored in buffer...
const Bool_t kFALSE
Definition: RtypesCore.h:88
static const char * GetFloatFormat()
long Long_t
Definition: RtypesCore.h:50
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
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:183
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)
Copies class version to buffer, but not writes it to xml Version will be written with next I/O operat...
TObjArray * fIdArray
Definition: TBufferXML.h:329
virtual void ReadWithNbits(Float_t *ptr, Int_t nbits)
Read a Float16_t from the buffer when the number of bits is specified (explicitly or not) see comment...
virtual void ReadDouble(Double_t &d)
Reads Double_t value from buffer.
double Double_t
Definition: RtypesCore.h:55
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
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:602
virtual void ReadInt(Int_t &i)
Reads Int_t value from buffer.
virtual void ReadUShort(UShort_t &s)
Reads UShort_t value from buffer.
unsigned long long ULong64_t
Definition: RtypesCore.h:70
unsigned long ULong_t
Definition: RtypesCore.h:51
virtual void ReadULong(ULong_t &l)
Reads ULong_t value from buffer.
static constexpr double s
Bool_t fExpectedChain
! Flag to resolve situation when several elements of same basic type stored as FastArray ...
Definition: TBufferXML.h:336
void WorkWithClass(TStreamerInfo *info, const TClass *cl=0)
Prepares buffer to stream data of specified class.
Definition: TBufferXML.cxx:902
Int_t GetCompressionLevel() const
Definition: TBufferXML.h:354
virtual void ReadTString(TString &s)
Reads a TString.
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
Bool_t VerifyItemNode(const char *name, const char *errinfo=0)
Checks, if stack node is item and has specified name.
Definition: TBufferXML.cxx:730
TXMLStackObj * Stack(Int_t depth=0)
Return xml stack object of specified depth.
Definition: TBufferXML.cxx:329
virtual void WriteBool(Bool_t b)
Writes Bool_t value to buffer.
Mother of all ROOT objects.
Definition: TObject.h:37
XMLNodePointer_t XmlWriteBasic(Char_t value)
Converts Char_t to string and add xml node to buffer.
char Char_t
Definition: RtypesCore.h:29
Class for serializing/deserializing object to/from xml.
Definition: TBufferXML.h:32
virtual void ReadLong64(Long64_t &l)
Reads Long64_t value from buffer.
auto * l
Definition: textangle.C:4
void * XmlReadObject(void *obj, TClass **cl=0)
Read object from the buffer.
Definition: TBufferXML.cxx:827
Definition: file.py:1
Int_t fErrorFlag
Definition: TBufferXML.h:333
Int_t GetIOVersion() const
Definition: TBufferXML.h:49
Int_t GetCompressionAlgorithm() const
Definition: TBufferXML.h:348
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)
Suppressed function of TBuffer.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)
Read array of Float16_t from buffer.
virtual void SkipObjectAny()
Skip any kind of object from buffer Actually skip only one node on current level of xml structure...
virtual void WriteClass(const TClass *cl)
Function to write class into buffer, used in old-style streamers.
virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and add/verify next elemen...
unsigned char UChar_t
Definition: RtypesCore.h:34
void PerformPostProcessing()
Function is converts TObject and TString structures to more compact representation.
virtual void WriteFastArrayFloat16(const Float_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Float16_t to buffer.
virtual void ReadChar(Char_t &c)
Reads Char_t value from buffer.
virtual void ClassBegin(const TClass *, Version_t=-1)
Should be called at the beginning of custom class streamer.
Abstract Interface class describing Streamer information for one class.
virtual void WriteStdString(const std::string *s)=0
virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
const Int_t n
Definition: legend1.C:16
virtual void ReadFloat(Float_t &f)
Reads Float_t value from buffer.
TXMLStackObj * PopStack()
Remove one level from xml stack.
Definition: TBufferXML.cxx:315
void XmlReadBasic(Char_t &value)
Reads string from current xml node and convert it to Char_t value.
char name[80]
Definition: TGX11.cxx:109
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:33
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse)
Write object to buffer. Only used from TBuffer.
const char * XmlReadValue(const char *name)
read string value from current stack node
void * XmlReadAny(XMLNodePointer_t node, void *obj, TClass **cl)
Recreate object from xml structure.
Definition: TBufferXML.cxx:246