12 #ifndef ROOT_TBufferFile 13 #define ROOT_TBufferFile 48 class TActionSequence;
69 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
70 fInfo(0), fInfoStack() {}
77 void CheckCount(
UInt_t offset);
80 virtual void WriteObjectClass(
const void *actualObjStart,
const TClass *actualClass);
83 enum { kMapSize = 503 };
84 enum { kStreamedMemberWise =
BIT(14) };
85 enum { kNotDecompressed =
BIT(15) };
86 enum { kTextBasedStreaming =
BIT(18) };
87 enum { kUser1 =
BIT(21), kUser2 =
BIT(22), kUser3 =
BIT(23)};
95 void GetMappedObject(
UInt_t tag,
void* &ptr,
TClass* &ClassPtr)
const;
97 void MapObject(
const void *obj,
const TClass *cl,
UInt_t offset = 1);
98 void Reset() { SetBufferOffset(); ResetMap(); }
101 void SetReadParam(
Int_t mapsize);
102 void SetWriteParam(
Int_t mapsize);
105 Bool_t CheckObject(
const void *obj,
const TClass *ptrClass);
107 virtual Int_t GetVersionOwner()
const;
109 virtual Int_t CheckByteCount(
UInt_t startpos,
UInt_t bcnt,
const char *classname);
112 virtual void SkipVersion(
const TClass *cl = 0);
119 virtual void *ReadObjectAny(
const TClass* cast);
120 virtual void SkipObjectAny();
132 virtual void WriteBuf(
const void *buf,
Int_t max);
134 virtual char *ReadString(
char *s,
Int_t max);
135 virtual void WriteString(
const char *s);
138 virtual void WriteClass(
const TClass *cl);
141 virtual void WriteObject(
const TObject *obj);
143 virtual Int_t WriteObjectAny(
const void *obj,
const TClass *ptrClass);
153 { fDisplacement = (
Int_t)(Length() - skipped); }
199 virtual void ReadFastArrayString(
Char_t *c,
Int_t n);
203 virtual void ReadFastArray(
Int_t *i,
Int_t n);
225 virtual void WriteArray(
const Int_t *i,
Int_t n);
236 virtual void WriteFastArray(
const Bool_t *b,
Int_t n);
237 virtual void WriteFastArray(
const Char_t *c,
Int_t n);
238 virtual void WriteFastArrayString(
const Char_t *c,
Int_t n);
242 virtual void WriteFastArray(
const Int_t *i,
Int_t n);
243 virtual void WriteFastArray(
const UInt_t *i,
Int_t n);
244 virtual void WriteFastArray(
const Long_t *l,
Int_t n);
255 virtual void StreamObject(
void *obj,
const std::type_info &typeinfo,
const TClass* onFileClass = 0 );
256 virtual void StreamObject(
void *obj,
const char *className,
const TClass* onFileClass = 0 );
257 virtual void StreamObject(
void *obj,
const TClass *cl,
const TClass* onFileClass = 0 );
258 virtual void StreamObject(
TObject *obj);
260 virtual void ReadBool(
Bool_t &b);
261 virtual void ReadChar(
Char_t &c);
262 virtual void ReadUChar(
UChar_t &c);
263 virtual void ReadShort(
Short_t &s);
264 virtual void ReadUShort(
UShort_t &s);
265 virtual void ReadInt(
Int_t &i);
266 virtual void ReadUInt(
UInt_t &i);
267 virtual void ReadLong(
Long_t &l);
268 virtual void ReadULong(
ULong_t &l);
269 virtual void ReadLong64(
Long64_t &l);
271 virtual void ReadFloat(
Float_t &f);
272 virtual void ReadDouble(
Double_t &d);
273 virtual void ReadCharP(
Char_t *c);
275 virtual void ReadStdString(std::string *s);
278 virtual void WriteBool(
Bool_t b);
279 virtual void WriteChar(
Char_t c);
280 virtual void WriteUChar(
UChar_t c);
281 virtual void WriteShort(
Short_t s);
282 virtual void WriteUShort(
UShort_t s);
283 virtual void WriteInt(
Int_t i);
284 virtual void WriteUInt(
UInt_t i);
285 virtual void WriteLong(
Long_t l);
286 virtual void WriteULong(
ULong_t l);
287 virtual void WriteLong64(
Long64_t l);
289 virtual void WriteFloat(
Float_t f);
290 virtual void WriteDouble(
Double_t d);
291 virtual void WriteCharP(
const Char_t *c);
292 virtual void WriteTString(
const TString &s);
294 virtual void WriteStdString(
const std::string *s);
298 virtual UInt_t GetTRefExecId();
309 virtual Int_t ReadClassEmulated(
const TClass *cl,
void *
object,
const TClass *onfile_class);
310 virtual Int_t ReadClassBuffer(
const TClass *cl,
void *pointer,
const TClass *onfile_class);
312 virtual Int_t WriteClassBuffer(
const TClass *cl,
void *pointer);
319 static void SetGlobalReadParam(
Int_t mapsize);
320 static void SetGlobalWriteParam(
Int_t mapsize);
321 static Int_t GetGlobalReadParam();
322 static Int_t GetGlobalWriteParam();
333 if (fBufCur +
sizeof(
UChar_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UChar_t));
340 if (fBufCur +
sizeof(
Char_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Char_t));
347 if (fBufCur +
sizeof(
UChar_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UChar_t));
354 if (fBufCur +
sizeof(
Short_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Short_t));
361 if (fBufCur +
sizeof(
UShort_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UShort_t));
368 if (fBufCur +
sizeof(
Int_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Int_t));
375 if (fBufCur +
sizeof(
UInt_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UInt_t));
382 if (fBufCur +
sizeof(
Long_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Long_t));
389 if (fBufCur +
sizeof(
ULong_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
ULong_t));
396 if (fBufCur +
sizeof(
Long64_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Long64_t));
410 if (fBufCur +
sizeof(
Float_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Float_t));
417 if (fBufCur +
sizeof(
Double_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Double_t));
Describe Streamer information for one class version.
void frombuf(char *&buf, Bool_t *x)
virtual Int_t ReadArray(Bool_t *&b)
Read array of bools from the I/O buffer.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
void SetBufferDisplacement()
Int_t GetBufferDisplacement() const
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
static Int_t fgMapSize
Default map size for all TBuffer objects.
Buffer base class used for serializing objects.
std::vector< TStreamerInfo * > InfoList_t
virtual void ReadChar(Char_t &c)
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)
virtual void ReadUInt(UInt_t &i)
virtual void ReadLong(Long_t &l)
Read Long from TBuffer.
virtual void WriteBool(Bool_t b)
INLINE_TEMPLATE_ARGS Int_t ReadTString(TBuffer &buf, void *addr, const TConfiguration *config)
virtual void WriteULong(ULong_t l)
virtual void WriteULong64(ULong64_t l)
virtual void ReadFloat(Float_t &f)
virtual void WriteUChar(UChar_t c)
Int_t fDisplacement
Value to be added to the map offsets.
virtual void WriteUShort(UShort_t s)
virtual void ReadLong64(Long64_t &l)
TExMap * fMap
Map containing object,offset pairs for reading/writing.
virtual void ReadInt(Int_t &i)
#define ClassDef(name, id)
virtual void ReadStdString(std::string *s)=0
virtual void SetStreamerElementNumber(TStreamerElement *, Int_t)
virtual void ReadUChar(UChar_t &c)
void tobuf(char *&buf, Bool_t x)
A TProcessID identifies a ROOT job in a unique way in time and space.
virtual void WriteShort(Short_t s)
UShort_t GetPidOffset() const
virtual void ReadULong64(ULong64_t &l)
Int_t fMapCount
Number of objects or classes in map.
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
virtual void WriteUInt(UInt_t i)
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of bools from the I/O buffer.
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
The ROOT global object gROOT contains a list of all defined classes.
virtual void WriteInt(Int_t i)
virtual void ReadCharP(Char_t *c)
virtual void ClassEnd(const TClass *)
virtual void WriteFloat(Float_t f)
UShort_t fPidOffset
Offset to be added to the pid index in this key/buffer.
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
TExMap * fClassMap
Map containing object,class pairs for reading.
Int_t fMapSize
Default size of map.
virtual void WriteLong(Long_t l)
unsigned long long ULong64_t
A TRefTable maintains the association between a referenced object and the parent object supporting th...
virtual void WriteDouble(Double_t d)
void SetBufferDisplacement(Int_t skipped)
Mother of all ROOT objects.
virtual void ReadBool(Bool_t &b)
virtual void WriteCharP(const Char_t *c)
An array of clone (identical) objects.
virtual void WriteLong64(Long64_t l)
virtual void ClassBegin(const TClass *, Version_t=-1)
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
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 ReadUShort(UShort_t &s)
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
Int_t GetMapCount() const
virtual void ReadShort(Short_t &s)
Abstract Interface class describing Streamer information for one class.
TVirtualStreamerInfo * GetInfo()
virtual void ReadULong(ULong_t &l)
virtual void WriteStdString(const std::string *s)=0
virtual void WriteChar(Char_t c)
This class stores a (key,value) pair using an external hash.
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of n bools from the I/O buffer.
virtual void ReadDouble(Double_t &d)