12 #ifndef ROOT_TBufferXML 13 #define ROOT_TBufferXML 64 return obj !=
nullptr;
134 const TClass *onFileClass =
nullptr);
302 template <
typename T>
305 template <
typename T>
308 template <
typename T>
311 template <
typename T>
314 template <
typename T>
317 template <
typename T>
Int_t fCompressLevel
! Compression level and algorithm
Describe Streamer information for one class version.
XMLNodePointer_t CreateItemNode(const char *name)
Create item node of specified name.
virtual ~TBufferXML()
Destroy xml buffer.
Bool_t VerifyStackNode(const char *name, const char *errinfo=nullptr)
Check, if stack node has specified name.
void XmlReadBlock(XMLNodePointer_t node)
Read binary block of data from xml.
TXMLStackObj * PushStack(XMLNodePointer_t current, Bool_t simple=kFALSE)
Add new level to xml stack.
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of Bool_t from buffer.
Int_t GetCompressionSettings() const
virtual void WriteLong64(Long64_t l)
Writes Long64_t value to buffer.
void SetCompressionAlgorithm(Int_t algorithm=0)
See comments for function SetCompressionSettings.
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...
void XmlWriteBlock(XMLNodePointer_t node)
Write binary data block from buffer to xml.
virtual void ReadLong(Long_t &l)
Reads Long_t value from buffer.
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
! Current value buffer
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
R__ALWAYS_INLINE void XmlWriteArray(const T *arr, Int_t arrsize)
Write array, including it size Content may be compressed.
void SetCompressionSettings(Int_t settings=1)
Used to specify the compression level and algorithm.
void SetCompressionLevel(Int_t level=1)
See comments for function SetCompressionSettings.
TXMLStackObj * Stack(UInt_t depth=0)
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.
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...
Version_t fVersionBuf
! Current version buffer
static TString ToXML(const T *obj, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
virtual void WriteCharStar(char *s)
Write a char* string.
virtual void WriteChar(Char_t c)
Writes Char_t value to buffer.
XMLNodePointer_t XmlWriteAny(const void *obj, const TClass *cl)
Convert object of any class to xml structures Return pointer on top xml element.
virtual void WriteFastArrayString(const Char_t *c, Int_t n)
Write array of n characters into the I/O buffer.
void CreateElemNode(const TStreamerElement *elem)
Create xml node correspondent to TStreamerElement object.
virtual void WriteTString(const TString &s)
Writes a TString.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)
Read version value from buffer.
Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo=nullptr)
Check if node has specified name.
R__ALWAYS_INLINE void XmlReadArrayContent(T *arr, Int_t arrsize)
Template method to read array content.
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...
virtual void WriteStdString(const std::string *s)
Writes a std::string.
Bool_t VerifyItemNode(const char *name, const char *errinfo=nullptr)
Checks, if stack node is item and has specified name.
TXMLEngine * fXML
! instance of TXMLEngine for working with XML structures
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=nullptr)
stream object to/from buffer
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
TXMLFile * XmlFile()
Returns pointer to TXMLFile object.
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=nullptr)
Checks, that attribute of specified name exists and has specified value.
virtual void WriteShort(Short_t s)
Writes Short_t value to buffer.
virtual void DecrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and decrease level in xml ...
#define ClassDef(name, id)
virtual void WriteUChar(UChar_t c)
Writes UChar_t value to 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 WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
virtual void ClassMember(const char *name, const char *typeName=nullptr, Int_t arrsize1=-1, Int_t arrsize2=-1)
Method indicates name and typename of class member, which should be now streamed in custom streamer...
static TClass * GetClass(const std::type_info &typeinfo)
Forward to TROOT::GetClass().
virtual void WriteUInt(UInt_t i)
Writes UInt_t value to buffer.
virtual void ReadStdString(std::string *s)=0
void SetIOVersion(Int_t v)
virtual void ReadStdString(std::string *s)
Reads a std::string.
virtual void StreamObject(void *obj, const TClass *cl, const TClass *onFileClass=nullptr)
Stream object to/from buffer.
R__ALWAYS_INLINE void XmlWriteArrayContent(const T *arr, Int_t arrsize)
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 TClass * ReadClass(const TClass *cl=nullptr, UInt_t *objTag=nullptr)
Function to read class from buffer, used in old-style streamers.
virtual void ReadBool(Bool_t &b)
Reads Bool_t value from buffer.
XMLNodePointer_t StackNode()
Return pointer on current xml node.
virtual void ReadUChar(UChar_t &c)
Reads UChar_t value from buffer.
static Bool_t FromXML(T *&obj, const char *xml, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo=nullptr)
Checks stack attribute.
Int_t fIOVersion
! Indicates format of ROOT xml file
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
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
void SetXML(TXMLEngine *xml)
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and indent new level in xm...
void * XmlReadObject(void *obj, TClass **cl=nullptr)
Read object from the buffer.
void WorkWithClass(TStreamerInfo *info, const TClass *cl=nullptr)
Prepares buffer to stream data of specified class.
TBufferXML()
Default constructor.
virtual TVirtualStreamerInfo * GetInfo()
Return current streamer info element.
virtual void ClassEnd(const TClass *)
Should be called at the end of custom streamer See TBufferXML::ClassBegin for more details...
The ROOT global object gROOT contains a list of all defined classes.
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 ...
Bool_t fCanUseCompact
! Flag indicate that basic type (like Int_t) can be placed in the same tag
Bool_t VerifyElemNode(const TStreamerElement *elem)
Checks if stack node correspond to TStreamerElement object.
void ExtractReference(XMLNodePointer_t node, const void *ptr, const TClass *cl)
Analyze if node has "ref" attribute and register it to object map.
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...
static TObject * ConvertFromXML(const char *str, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object from XML, produced by ConvertToXML() method.
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...
Base class for text-based streamers like TBufferJSON or TBufferXML Special actions list will use meth...
virtual void ReadDouble(Double_t &d)
Reads Double_t value from buffer.
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...
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
virtual void ReadULong(ULong_t &l)
Reads ULong_t value from buffer.
static constexpr double s
Int_t GetCompressionLevel() const
virtual void ReadTString(TString &s)
Reads a TString.
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
virtual void WriteBool(Bool_t b)
Writes Bool_t value to buffer.
Mother of all ROOT objects.
XMLNodePointer_t XmlWriteBasic(Char_t value)
Converts Char_t to string and add xml node to buffer.
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...
Class for serializing/deserializing object to/from xml.
virtual void ReadLong64(Long64_t &l)
Reads Long64_t value from buffer.
Int_t fErrorFlag
! Error flag
Int_t GetIOVersion() const
Int_t GetCompressionAlgorithm() const
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
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...
void PerformPostProcessing()
Function is converts TObject and TString structures to more compact representation.
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 void ReadFastArrayString(Char_t *c, Int_t n)
Read array of n characters from the I/O buffer.
void ShiftStack(const char *info=nullptr)
Shift stack node to next.
virtual void ReadFloat(Float_t &f)
Reads Float_t value from buffer.
TXMLStackObj * PopStack()
Remove one level from xml stack.
void XmlReadBasic(Char_t &value)
Reads string from current xml node and convert it to Char_t value.
std::deque< TXMLStackObj * > fStack
! Stack of processed objects
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.
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. ...
This class stores a (key,value) pair using an external hash.
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...
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.