12 #ifndef ROOT_TBufferJSON 13 #define ROOT_TBufferJSON 21 #ifndef ROOT_TObjArray 184 virtual void StreamObject(
void *obj,
const std::type_info &typeinfo,
const TClass *onFileClass = 0);
185 virtual void StreamObject(
void *obj,
const char *className,
const TClass *onFileClass = 0);
244 Error(
"ReadBuf",
"useless");
249 Error(
"WriteBuf",
"useless");
254 Error(
"ReadString",
"useless");
259 Error(
"WriteString",
"useless");
264 Error(
"GetVersionOwner",
"useless");
269 Error(
"GetMapCount",
"useless");
274 Error(
"GetMappedObject",
"useless");
278 Error(
"MapObject",
"useless");
282 Error(
"MapObject",
"useless");
286 Error(
"Reset",
"useless");
290 Error(
"InitMap",
"useless");
294 Error(
"ResetMap",
"useless");
298 Error(
"SetReadParam",
"useless");
302 Error(
"SetWriteParam",
"useless");
307 Error(
"ReadVersionForMemberWise",
"useless");
312 Error(
"WriteVersionMemberWise",
"useless");
318 Error(
"GetInfo",
"useless");
324 Error(
"ReadObject",
"useless");
330 Error(
"GetPidOffset",
"useless");
335 Error(
"SetPidOffset",
"useless");
339 Error(
"GetBufferDisplacement",
"useless");
344 Error(
"SetBufferDisplacement",
"useless");
348 Error(
"SetBufferDisplacement",
"useless");
353 Error(
"GetLastProcessID",
"useless");
358 Error(
"GetTRefExecId",
"useless");
363 Error(
"ReadProcessID",
"useless");
368 Error(
"WriteProcessID",
"useless");
375 Error(
"ForceWriteInfo",
"useless");
379 Error(
"ForceWriteInfoClones",
"useless");
383 Error(
"ReadClones",
"useless");
390 Error(
"ReadClassEmulated",
"useless");
395 Error(
"ReadClassBuffer",
"useless");
400 Error(
"ReadClassBuffer",
"useless");
458 void AppendOutput(
const char *line0,
const char *line1 = 0);
Describe Streamer information for one class version.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)
Ignored in TBufferJSON.
TString JsonWriteMember(const void *ptr, TDataMember *member, TClass *memberClass, Int_t arraylen)
Convert single data member to JSON structures Returns string with converted member.
virtual void WriteUChar(UChar_t c)
Writes UChar_t value to buffer.
virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)
Write array of Float16_t to buffer.
virtual Int_t WriteClones(TClonesArray *a, Int_t nobjects)
Interface to TStreamerInfo::WriteBufferClones.
void WorkWithElement(TStreamerElement *elem, Int_t comp_type)
This is call-back from streamer which indicates that class member will be streamed Name of element us...
virtual TClass * ReadClass(const TClass *cl=0, UInt_t *objTag=0)
suppressed function of TBuffer
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of Bool_t from buffer.
virtual UShort_t GetPidOffset() const
virtual TProcessID * ReadProcessID(UShort_t)
Return the current Process-ID.
virtual Int_t ReadArray(Bool_t *&b)
Read array of Bool_t from buffer.
void JsonDisablePostprocessing()
virtual void ReadShort(Short_t &s)
Reads Short_t value from buffer.
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)
Write object to I/O buffer.
virtual Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
virtual void WriteLong64(Long64_t l)
Writes Long64_t value to buffer.
virtual void ReadFloat(Float_t &f)
Reads Float_t value from buffer.
virtual void WriteBuf(const void *, Int_t)
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 ...
All ROOT classes may have RTTI (run time type identification) support added.
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...
TString fSemicolon
0 - no any compression, 1 - no spaces in the begin, 2 - no new lines, 3 - no spaces at all ...
virtual void SkipObjectAny()
Skip any kind of object from buffer.
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
virtual void DecrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and decrease level in json...
virtual void ForceWriteInfo(TVirtualStreamerInfo *, Bool_t)
TString fArraySepar
depending from compression level, " : " or ":"
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)
read array of Float16_t from buffer
virtual void ReadBool(Bool_t &b)
Reads Bool_t value from buffer.
Int_t fCompact
flag to resolve situation when several elements of same basic type stored as FastArray ...
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
virtual void ReadLong64(Long64_t &l)
Reads Long64_t value from buffer.
virtual void ReadStdString(std::string *s)
Reads a std::string.
Buffer base class used for serializing objects.
void JsonWriteBasic(Char_t value)
converts Char_t to string and add to json value buffer
static void SetDoubleFormat(const char *fmt="%.14e")
set printf format for double members, default "%.14e" use it after SetFloatFormat, which also overwrites format for doubles
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)
read array of Float16_t from buffer
virtual void WriteULong64(ULong64_t l)
Writes ULong64_t value to buffer.
Int_t JsonSpecialClass(const TClass *cl) const
return non-zero value when class has special handling in JSON it is TCollection (-130), TArray (100), TString (110), std::string (120) and STL containers (1..6)
virtual void ReadFastArray(Bool_t *b, Int_t n)
read array of Bool_t from buffer
static const char * fgDoubleFmt
printf argument for floats, either "%f" or "%e" or "%10f" and so on
virtual void ReadLong(Long_t &l)
Reads Long_t value from buffer.
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
virtual void WriteFastArrayString(const Char_t *c, Int_t n)
Write array of Char_t to buffer.
virtual Int_t ReadBuf(void *, Int_t)
virtual void WriteInt(Int_t i)
Writes Int_t value to buffer.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)
suppressed function of TBuffer
virtual void WriteString(const char *)
virtual void ReadChar(Char_t &c)
Reads Char_t value from buffer.
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)
read array of Double32_t from buffer
virtual Int_t GetBufferDisplacement() const
#define ClassDef(name, id)
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
virtual void ReadUShort(UShort_t &s)
Reads UShort_t value from buffer.
virtual void ReadDouble(Double_t &d)
Reads Double_t value from buffer.
virtual TObject * ReadObject(const TClass *)
virtual void WriteObject(const TObject *obj)
Convert object into json structures.
TJSONStackObj * Stack(Int_t depth=0)
return stack object of specified depth
virtual void ReadStdString(std::string *s)=0
virtual UInt_t WriteVersionMemberWise(const TClass *, Bool_t=kFALSE)
std::map< const void *, unsigned > fJsonrMap
buffer for current value
unsigned fJsonrCnt
map of recorded objects, used in JsonR to restore references
virtual void SetWriteParam(Int_t)
TObjArray fStack
counter for all objects and arrays
virtual void ReadUChar(UChar_t &c)
Reads UChar_t value from buffer.
A TProcessID identifies a ROOT job in a unique way in time and space.
virtual TVirtualStreamerInfo * GetInfo()
void SetCompact(int level)
Set level of space/newline compression 0 - no any compression 1 - exclude spaces in the begin 2 - rem...
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
virtual Version_t ReadVersionForMemberWise(const TClass *=0)
void JsonWriteConstChar(const char *value, Int_t len=-1)
writes string value, processing all kind of special characters
virtual void ForceWriteInfoClones(TClonesArray *)
virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
TString fNumericLocale
depending from compression level, ", " or ","
virtual void ReadInt(Int_t &i)
Reads Int_t value from buffer.
TString fValue
current output buffer for json code
virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type)
Function is called from TStreamerInfo WriteBuffer and Readbuffer functions and add/verify next elemen...
virtual void WriteStdString(const std::string *s)
Writes a std::string.
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and indent new level in js...
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)
suppressed function of TBuffer
static Int_t ExportToFile(const char *filename, const TObject *obj, const char *option=0)
Convert object into JSON and store in text file Returns size of the produce file Used in TObject::Sav...
virtual char * ReadString(char *, Int_t)
virtual void TagStreamerInfo(TVirtualStreamerInfo *)
virtual void ReadULong(ULong_t &l)
Reads ULong_t value from buffer.
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass)
Write object to buffer. Only used from TBuffer.
static const char * GetDoubleFormat()
return current printf format for double members, default "%.14e"
virtual void ClassBegin(const TClass *, Version_t=-1)
Should be called in the beginning of custom class streamer.
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.
TString * fOutput
main output buffer for json code
Collection abstract base class.
void AppendOutput(const char *line0, const char *line1=0)
Info("AppendOutput"," '%s' '%s'", line0, line1?line1 : "---");.
virtual void ReadDouble32(Double_t *d, TStreamerElement *ele=0)
read a Double32_t from the buffer
virtual Int_t ReadClassBuffer(const TClass *, void *, const TClass *=0)
virtual void MapObject(const TObject *, UInt_t=1)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SkipVersion(const TClass *cl=0)
Skip class version from I/O buffer.
The ROOT global object gROOT contains a list of all defined classes.
virtual void SetBufferDisplacement()
static const char * fgFloatFmt
stored value of setlocale(LC_NUMERIC), which should be recovered at the end
virtual void WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
virtual void WriteBool(Bool_t b)
Writes Bool_t value to buffer.
virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0)
write a Double32_t to the buffer
void WorkWithClass(TStreamerInfo *info, const TClass *cl=0)
Prepares buffer to stream data of specified class.
void JsonStartElement(const TStreamerElement *elem, const TClass *base_class=0)
virtual void ReadTString(TString &s)
Reads a TString.
virtual void WriteFloat(Float_t f)
Writes Float_t value to buffer.
void PerformPostProcessing(TJSONStackObj *stack, const TStreamerElement *elem=0)
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 WriteTString(const TString &s)
Writes a TString.
static const char * GetFloatFormat()
return current printf format for float members, default "%e"
virtual void WriteShort(Short_t s)
Writes Short_t value to buffer.
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)
read a Float16_t from the buffer
virtual Bool_t CheckObject(const TObject *)
Check that object already stored in the buffer.
virtual void WriteUInt(UInt_t i)
Writes UInt_t value to buffer.
virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0)
write a Float16_t to the buffer
virtual void WriteULong(ULong_t l)
Writes ULong_t value to buffer.
virtual UShort_t WriteProcessID(TProcessID *)
Always return 0 (current processID).
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
virtual void SetReadParam(Int_t)
unsigned long long ULong64_t
Bool_t fExpectedChain
stack of streamer infos
A TRefTable maintains the association between a referenced object and the parent object supporting th...
virtual void SetPidOffset(UShort_t)
static TString ConvertToJSON(const TObject *obj, Int_t compact=0, const char *member_name=0)
converts object, inherited from TObject class, to JSON string
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
TBufferJSON()
Creates buffer object to serialize data into json.
void JsonWriteObject(const void *obj, const TClass *objClass, Bool_t check_map=kTRUE)
Write object to buffer If object was written before, only pointer will be stored If check_map==kFALSE...
virtual void ReadULong64(ULong64_t &l)
Reads ULong64_t value from buffer.
virtual TProcessID * GetLastProcessID(TRefTable *) const
virtual void ClassEnd(const TClass *)
Should be called at the end of custom streamer See TBufferJSON::ClassBegin for more details...
virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
virtual Int_t GetVersionOwner() const
virtual Version_t ReadVersionNoCheckSum(UInt_t *, UInt_t *)
Mother of all ROOT objects.
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e" to change format only for doubles...
TJSONStackObj * PopStack()
remove one level from stack
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)
stream object to/from buffer
virtual void WriteChar(Char_t c)
Writes Char_t value to buffer.
An array of clone (identical) objects.
virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
virtual void WriteCharP(const Char_t *c)
Writes array of characters to buffer.
static void CompactFloatString(char *buf, unsigned len)
method compress float string, excluding exp and/or move float point 1.000000e-01 -> 0...
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
TJSONStackObj * PushStack(Int_t inclevel=0)
add new level to the structures stack
virtual Int_t GetMapCount() const
virtual void MapObject(const void *, const TClass *, UInt_t=1)
virtual void SetBufferDisplacement(Int_t)
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)
Function called by the Streamer functions to serialize object at p to buffer b.
void JsonStreamCollection(TCollection *obj, const TClass *objClass)
store content of collection
virtual void GetMappedObject(UInt_t, void *&, TClass *&) const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)
read version value from buffer
virtual ~TBufferJSON()
destroy buffer
virtual void WriteClass(const TClass *cl)
suppressed function of TBuffer
virtual Int_t ReadClassEmulated(const TClass *, void *, const TClass *=0)
virtual void ReadFastArrayString(Char_t *c, Int_t n)
read array of Char_t from buffer
Abstract Interface class describing Streamer information for one class.
virtual void WriteStdString(const std::string *s)=0
virtual Int_t ReadClones(TClonesArray *, Int_t, Version_t)
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)
read array of Float16_t from buffer
virtual UInt_t GetTRefExecId()
virtual Int_t ReadClassBuffer(const TClass *, void *, Int_t, UInt_t, UInt_t, const TClass *=0)
virtual void ReadUInt(UInt_t &i)
Reads UInt_t value from buffer.
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 F...