Logo ROOT   6.10/09
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 
24 class TExMap;
26 class TStreamerInfo;
27 class TStreamerElement;
28 class TObjArray;
29 class TMemberStreamer;
30 class TXMLFile;
31 class TXMLStackObj;
32 
33 
34 class TBufferXML : public TBufferFile, public TXMLSetup {
35 
36 friend class TKeyXML;
37 
38 public:
39 
42  virtual ~TBufferXML();
43 
44  static TString ConvertToXML(const TObject* obj, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
45  static TString ConvertToXML(const void* obj, const TClass* cl, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
46 
47  static TObject* ConvertFromXML(const char* str, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
48  static void* ConvertFromXMLAny(const char* str, TClass** cl = 0, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
49 
50  Int_t GetIOVersion() const { return fIOVersion; }
52 
53  // suppress class writing/reading
54 
55  virtual TClass* ReadClass(const TClass* cl = 0, UInt_t* objTag = 0);
56  virtual void WriteClass(const TClass* cl);
57 
58  // redefined virtual functions of TBuffer
59 
60  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); // SL
61  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); // SL
62  virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); // SL
63 
64  virtual void SkipVersion(const TClass *cl = 0);
65  virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0); // SL
66  virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE); // SL
67 
68  virtual void* ReadObjectAny(const TClass* clCast);
69  virtual void SkipObjectAny();
70 
71  virtual void IncrementLevel(TVirtualStreamerInfo*);
72  virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type);
73  virtual void DecrementLevel(TVirtualStreamerInfo*);
74 
75  virtual void ClassBegin(const TClass*, Version_t = -1);
76  virtual void ClassEnd(const TClass*);
77  virtual void ClassMember(const char* name, const char* typeName = 0, Int_t arrsize1 = -1, Int_t arrsize2 = -1);
78 
79  virtual void WriteObject(const TObject *obj);
80 
81  virtual void ReadFloat16 (Float_t *f, TStreamerElement *ele=0);
82  virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0);
83  virtual void ReadDouble32 (Double_t *d, TStreamerElement *ele=0);
84  virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0);
85  virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue);
86  virtual void ReadWithNbits(Float_t *ptr, Int_t nbits);
87  virtual void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue);
88  virtual void ReadWithNbits(Double_t *ptr, Int_t nbits);
89 
90  virtual Int_t ReadArray(Bool_t *&b);
91  virtual Int_t ReadArray(Char_t *&c);
92  virtual Int_t ReadArray(UChar_t *&c);
93  virtual Int_t ReadArray(Short_t *&h);
94  virtual Int_t ReadArray(UShort_t *&h);
95  virtual Int_t ReadArray(Int_t *&i);
96  virtual Int_t ReadArray(UInt_t *&i);
97  virtual Int_t ReadArray(Long_t *&l);
98  virtual Int_t ReadArray(ULong_t *&l);
99  virtual Int_t ReadArray(Long64_t *&l);
100  virtual Int_t ReadArray(ULong64_t *&l);
101  virtual Int_t ReadArray(Float_t *&f);
102  virtual Int_t ReadArray(Double_t *&d);
103  virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0);
104  virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0);
105 
106  virtual Int_t ReadStaticArray(Bool_t *b);
107  virtual Int_t ReadStaticArray(Char_t *c);
108  virtual Int_t ReadStaticArray(UChar_t *c);
109  virtual Int_t ReadStaticArray(Short_t *h);
110  virtual Int_t ReadStaticArray(UShort_t *h);
111  virtual Int_t ReadStaticArray(Int_t *i);
112  virtual Int_t ReadStaticArray(UInt_t *i);
113  virtual Int_t ReadStaticArray(Long_t *l);
114  virtual Int_t ReadStaticArray(ULong_t *l);
115  virtual Int_t ReadStaticArray(Long64_t *l);
116  virtual Int_t ReadStaticArray(ULong64_t *l);
117  virtual Int_t ReadStaticArray(Float_t *f);
118  virtual Int_t ReadStaticArray(Double_t *d);
121 
122  virtual void ReadFastArray(Bool_t *b, Int_t n);
123  virtual void ReadFastArray(Char_t *c, Int_t n);
124  virtual void ReadFastArray(UChar_t *c, Int_t n);
125  virtual void ReadFastArray(Short_t *h, Int_t n);
126  virtual void ReadFastArray(UShort_t *h, Int_t n);
127  virtual void ReadFastArray(Int_t *i, Int_t n);
128  virtual void ReadFastArray(UInt_t *i, Int_t n);
129  virtual void ReadFastArray(Long_t *l, Int_t n);
130  virtual void ReadFastArray(ULong_t *l, Int_t n);
131  virtual void ReadFastArray(Long64_t *l, Int_t n);
132  virtual void ReadFastArray(ULong64_t *l, Int_t n);
133  virtual void ReadFastArray(Float_t *f, Int_t n);
134  virtual void ReadFastArray(Double_t *d, Int_t n);
135  virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0);
136  virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0);
137  virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) ;
138  virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits);
139  virtual void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue);
140  virtual void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) ;
141 
142  virtual void WriteArray(const Bool_t *b, Int_t n);
143  virtual void WriteArray(const Char_t *c, Int_t n);
144  virtual void WriteArray(const UChar_t *c, Int_t n);
145  virtual void WriteArray(const Short_t *h, Int_t n);
146  virtual void WriteArray(const UShort_t *h, Int_t n);
147  virtual void WriteArray(const Int_t *i, Int_t n);
148  virtual void WriteArray(const UInt_t *i, Int_t n);
149  virtual void WriteArray(const Long_t *l, Int_t n);
150  virtual void WriteArray(const ULong_t *l, Int_t n);
151  virtual void WriteArray(const Long64_t *l, Int_t n);
152  virtual void WriteArray(const ULong64_t *l, Int_t n);
153  virtual void WriteArray(const Float_t *f, Int_t n);
154  virtual void WriteArray(const Double_t *d, Int_t n);
155  virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0);
156  virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0);
157  virtual void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s=0, const TClass* onFileClass = 0);
158  virtual void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0, const TClass* onFileClass = 0);
159 
160  virtual void WriteFastArray(const Bool_t *b, Int_t n);
161  virtual void WriteFastArray(const Char_t *c, Int_t n);
162  virtual void WriteFastArray(const UChar_t *c, Int_t n);
163  virtual void WriteFastArray(const Short_t *h, Int_t n);
164  virtual void WriteFastArray(const UShort_t *h, Int_t n);
165  virtual void WriteFastArray(const Int_t *i, Int_t n);
166  virtual void WriteFastArray(const UInt_t *i, Int_t n);
167  virtual void WriteFastArray(const Long_t *l, Int_t n);
168  virtual void WriteFastArray(const ULong_t *l, Int_t n);
169  virtual void WriteFastArray(const Long64_t *l, Int_t n);
170  virtual void WriteFastArray(const ULong64_t *l, Int_t n);
171  virtual void WriteFastArray(const Float_t *f, Int_t n);
172  virtual void WriteFastArray(const Double_t *d, Int_t n);
173  virtual void WriteFastArrayFloat16(const Float_t *d, Int_t n, TStreamerElement *ele=0);
174  virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0);
175  virtual void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
176  virtual Int_t 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, void *end_collection);
223  virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
224 
225  // end of redefined virtual functions
226 
227  static void SetFloatFormat(const char* fmt = "%e");
228  static const char* GetFloatFormat();
229 
230 
231 protected:
232  TBufferXML();
233 
234  // redefined protected virtual functions
235 
236  virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass);
237 
238  // end redefined protected virtual functions
239 
240  TXMLFile* XmlFile();
241 
243  Int_t GetCompressionLevel() const;
245  void SetCompressionAlgorithm(Int_t algorithm=0);
246  void SetCompressionLevel(Int_t level=1);
247  void SetCompressionSettings(Int_t settings=1);
248  void SetXML(TXMLEngine* xml) { fXML = xml; }
249 
250  void XmlWriteBlock(XMLNodePointer_t node);
251  XMLNodePointer_t XmlWriteAny(const void* obj, const TClass* cl);
252 
253  void XmlReadBlock(XMLNodePointer_t node);
254  void* XmlReadAny(XMLNodePointer_t node, void* obj, TClass** cl);
255 
256  TXMLStackObj* PushStack(XMLNodePointer_t current, Bool_t simple = kFALSE);
257  TXMLStackObj* PopStack();
258  void ShiftStack(const char* info = 0);
259 
261  TXMLStackObj* Stack(Int_t depth = 0);
262 
263  void WorkWithClass(TStreamerInfo* info, const TClass* cl = 0);
264  void WorkWithElement(TStreamerElement* elem, Int_t comp_type);
265  Bool_t VerifyNode(XMLNodePointer_t node, const char* name, const char* errinfo = 0);
266  Bool_t VerifyStackNode(const char* name, const char* errinfo = 0);
267 
268  Bool_t VerifyAttr(XMLNodePointer_t node, const char* name, const char* value, const char* errinfo = 0);
269  Bool_t VerifyStackAttr(const char* name, const char* value, const char* errinfo = 0);
270 
271  Bool_t ProcessPointer(const void* ptr, XMLNodePointer_t node);
272  void RegisterPointer(const void* ptr, XMLNodePointer_t node);
273  Bool_t ExtractPointer(XMLNodePointer_t node, void* &ptr, TClass* &cl);
274  void ExtractReference(XMLNodePointer_t node, const void* ptr, const TClass* cl);
275 
276  XMLNodePointer_t CreateItemNode(const char* name);
277  Bool_t VerifyItemNode(const char* name, const char* errinfo = 0);
278 
279  void CreateElemNode(const TStreamerElement* elem);
281 
282  void PerformPreProcessing(const TStreamerElement* elem, XMLNodePointer_t elemnode);
283  void PerformPostProcessing();
284 
298  XMLNodePointer_t XmlWriteValue(const char* value, const char* name);
299 
300  void XmlReadBasic(Char_t& value);
301  void XmlReadBasic(Short_t& value);
302  void XmlReadBasic(Int_t& value);
303  void XmlReadBasic(Long_t& value);
304  void XmlReadBasic(Long64_t& value);
305  void XmlReadBasic(Float_t& value);
306  void XmlReadBasic(Double_t& value);
307  void XmlReadBasic(Bool_t& value);
308  void XmlReadBasic(UChar_t& value);
309  void XmlReadBasic(UShort_t& value);
310  void XmlReadBasic(UInt_t& value);
311  void XmlReadBasic(ULong_t& value);
312  void XmlReadBasic(ULong64_t& value);
313  const char* XmlReadValue(const char* name);
314 
315  XMLNodePointer_t XmlWriteObject(const void* obj, const TClass* objClass);
316  void* XmlReadObject(void* obj, TClass** cl = 0);
317 
318  void BeforeIOoperation();
319  void CheckVersionBuf();
320 
322 
324 
326 
329 
331 
333 
334  Bool_t fCanUseCompact; ///<! Flag indicate that basic type (like Int_t) can be placed in the same tag
335  Bool_t fExpectedChain; ///<! Flag to resolve situation when several elements of same basic type stored as FastArray
336  TClass* fExpectedBaseClass; ///<! Pointer to class, which should be stored as parent of current
337  Int_t fCompressLevel; ///<! Compression level and algorithm
338  Int_t fIOVersion; ///<! Indicates format of ROOT xml file
339 
340  static std::string fgFloatFmt; ///<! Printf argument for floats and doubles, either "%f" or "%e" or "%10f" and so on
341 
342  ClassDef(TBufferXML, 0); //a specialized TBuffer to read/write to XML files
343 };
344 
345 //______________________________________________________________________________
347 {
348  return (fCompressLevel < 0) ? -1 : fCompressLevel / 100;
349 }
350 
351 //______________________________________________________________________________
353 {
354  return (fCompressLevel < 0) ? -1 : fCompressLevel % 100;
355 }
356 
357 //______________________________________________________________________________
359 {
360  return (fCompressLevel < 0) ? -1 : fCompressLevel;
361 }
362 
363 #endif
364 
365 
Int_t fCompressLevel
! Compression level and algorithm
Definition: TBufferXML.h:337
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:738
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:146
void XmlReadBlock(XMLNodePointer_t node)
Read binary block of data from xml.
Definition: TBufferXML.cxx:505
TXMLStackObj * PushStack(XMLNodePointer_t current, Bool_t simple=kFALSE)
Add new level to xml stack.
Definition: TBufferXML.cxx:343
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of Bool_t from buffer.
virtual void WriteObject(const TObject *obj)
Convert object into xml structures.
Definition: TBufferXML.cxx:300
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:358
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:404
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:575
void XmlWriteBlock(XMLNodePointer_t node)
Write binary data block from buffer to xml.
Definition: TBufferXML.cxx:447
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:330
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:237
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:438
void SetCompressionLevel(Int_t level=1)
See comments for function SetCompressionSettings.
Definition: TBufferXML.cxx:419
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
XMLNodePointer_t XmlWriteObject(const void *obj, const TClass *objClass)
Write object to buffer If object was written before, only pointer will be stored Return pointer to to...
Definition: TBufferXML.cxx:817
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:325
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:614
Basic string class.
Definition: TString.h:129
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:260
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:766
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.
virtual void WriteStdString(const std::string *s)
Writes a TString.
TXMLEngine * fXML
Definition: TBufferXML.h:321
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
TXMLFile * XmlFile()
Returns pointer to TXMLFile object.
Definition: TBufferXML.cxx:157
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:713
virtual void WriteShort(Short_t s)
Writes Short_t value to buffer.
TExMap * fObjMap
Definition: TBufferXML.h:327
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:973
Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo=0)
Check, if node has specified name.
Definition: TBufferXML.cxx:686
#define ClassDef(name, id)
Definition: Rtypes.h:297
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:51
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:383
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:323
Int_t fIOVersion
! Indicates format of ROOT xml file
Definition: TBufferXML.h:338
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:336
void ShiftStack(const char *info=0)
Shift stack node to next.
Definition: TBufferXML.cxx:392
Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo=0)
Checks stack attribute.
Definition: TBufferXML.cxx:730
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
void SetXML(TXMLEngine *xml)
Definition: TBufferXML.h:248
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and Readbuffer functions and indent new level in xm...
Definition: TBufferXML.cxx:904
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:64
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:340
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
TLine * l
Definition: textangle.C:4
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:71
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:168
Bool_t fCanUseCompact
! Flag indicate that basic type (like Int_t) can be placed in the same tag
Definition: TBufferXML.h:334
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:704
void * XMLNodePointer_t
Definition: TXMLEngine.h:17
Bool_t VerifyElemNode(const TStreamerElement *elem)
Checks, if stack node correspond to TStreamerElement object.
Definition: TBufferXML.cxx:794
void ExtractReference(XMLNodePointer_t node, const void *ptr, const TClass *cl)
Analyse, if node has "ref" attribute and register it to object map.
Definition: TBufferXML.cxx:660
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 WriteObjectClass(const void *actualObjStart, const TClass *actualClass)
Write object to buffer. Only used from TBuffer.
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:92
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:215
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:328
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 f(double x)
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:630
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.
Bool_t fExpectedChain
! Flag to resolve situation when several elements of same basic type stored as FastArray ...
Definition: TBufferXML.h:335
void WorkWithClass(TStreamerInfo *info, const TClass *cl=0)
Prepares buffer to stream data of specified class.
Definition: TBufferXML.cxx:912
Int_t GetCompressionLevel() const
Definition: TBufferXML.h:352
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:752
TXMLStackObj * Stack(Int_t depth=0)
Return xml stack object of specified depth.
Definition: TBufferXML.cxx:372
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:34
virtual void ReadLong64(Long64_t &l)
Reads Long64_t value from buffer.
void * XmlReadObject(void *obj, TClass **cl=0)
Read object from the buffer.
Definition: TBufferXML.cxx:845
Definition: file.py:1
Int_t fErrorFlag
Definition: TBufferXML.h:332
Int_t GetIOVersion() const
Definition: TBufferXML.h:50
Int_t GetCompressionAlgorithm() const
Definition: TBufferXML.h:346
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:358
void XmlReadBasic(Char_t &value)
Reads string from current xml node and convert it to Char_t value.
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:33
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:276