12 #ifndef ROOT_TBufferFile 13 #define ROOT_TBufferFile 44 class TActionSequence;
65 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
66 fInfo(0), fInfoStack() {}
73 void CheckCount(
UInt_t offset);
76 virtual void WriteObjectClass(
const void *actualObjStart,
const TClass *actualClass);
79 enum { kMapSize = 503 };
80 enum { kStreamedMemberWise =
BIT(14) };
81 enum { kNotDecompressed =
BIT(15) };
82 enum { kTextBasedStreaming =
BIT(18) };
83 enum { kUser1 =
BIT(21), kUser2 =
BIT(22), kUser3 =
BIT(23)};
91 void GetMappedObject(
UInt_t tag,
void* &ptr,
TClass* &ClassPtr)
const;
93 void MapObject(
const void *obj,
const TClass *cl,
UInt_t offset = 1);
94 void Reset() { SetBufferOffset(); ResetMap(); }
97 void SetReadParam(
Int_t mapsize);
98 void SetWriteParam(
Int_t mapsize);
101 Bool_t CheckObject(
const void *obj,
const TClass *ptrClass);
103 virtual Int_t GetVersionOwner()
const;
105 virtual Int_t CheckByteCount(
UInt_t startpos,
UInt_t bcnt,
const char *classname);
108 virtual void SkipVersion(
const TClass *cl = 0);
115 virtual void *ReadObjectAny(
const TClass* cast);
116 virtual void SkipObjectAny();
128 virtual void WriteBuf(
const void *buf,
Int_t max);
130 virtual char *ReadString(
char *s,
Int_t max);
131 virtual void WriteString(
const char *s);
134 virtual void WriteClass(
const TClass *cl);
137 virtual void WriteObject(
const TObject *obj);
139 virtual Int_t WriteObjectAny(
const void *obj,
const TClass *ptrClass);
149 { fDisplacement = (
Int_t)(Length() - skipped); }
195 virtual void ReadFastArrayString(
Char_t *c,
Int_t n);
199 virtual void ReadFastArray(
Int_t *i,
Int_t n);
221 virtual void WriteArray(
const Int_t *i,
Int_t n);
232 virtual void WriteFastArray(
const Bool_t *b,
Int_t n);
233 virtual void WriteFastArray(
const Char_t *c,
Int_t n);
234 virtual void WriteFastArrayString(
const Char_t *c,
Int_t n);
238 virtual void WriteFastArray(
const Int_t *i,
Int_t n);
239 virtual void WriteFastArray(
const UInt_t *i,
Int_t n);
240 virtual void WriteFastArray(
const Long_t *l,
Int_t n);
251 virtual void StreamObject(
void *obj,
const std::type_info &typeinfo,
const TClass* onFileClass = 0 );
252 virtual void StreamObject(
void *obj,
const char *className,
const TClass* onFileClass = 0 );
253 virtual void StreamObject(
void *obj,
const TClass *cl,
const TClass* onFileClass = 0 );
254 virtual void StreamObject(
TObject *obj);
256 virtual void ReadBool(
Bool_t &b);
257 virtual void ReadChar(
Char_t &c);
258 virtual void ReadUChar(
UChar_t &c);
259 virtual void ReadShort(
Short_t &s);
260 virtual void ReadUShort(
UShort_t &s);
261 virtual void ReadInt(
Int_t &i);
262 virtual void ReadUInt(
UInt_t &i);
263 virtual void ReadLong(
Long_t &l);
264 virtual void ReadULong(
ULong_t &l);
265 virtual void ReadLong64(
Long64_t &l);
267 virtual void ReadFloat(
Float_t &f);
268 virtual void ReadDouble(
Double_t &d);
269 virtual void ReadCharP(
Char_t *c);
271 virtual void ReadStdString(std::string *s);
273 virtual void ReadCharStar(
char* &s);
275 virtual void WriteBool(
Bool_t b);
276 virtual void WriteChar(
Char_t c);
277 virtual void WriteUChar(
UChar_t c);
278 virtual void WriteShort(
Short_t s);
279 virtual void WriteUShort(
UShort_t s);
280 virtual void WriteInt(
Int_t i);
281 virtual void WriteUInt(
UInt_t i);
282 virtual void WriteLong(
Long_t l);
283 virtual void WriteULong(
ULong_t l);
284 virtual void WriteLong64(
Long64_t l);
286 virtual void WriteFloat(
Float_t f);
287 virtual void WriteDouble(
Double_t d);
288 virtual void WriteCharP(
const Char_t *c);
289 virtual void WriteTString(
const TString &s);
291 virtual void WriteStdString(
const std::string *s);
292 virtual void WriteCharStar(
char *s);
296 virtual UInt_t GetTRefExecId();
307 virtual Int_t ReadClassEmulated(
const TClass *cl,
void *
object,
const TClass *onfile_class);
308 virtual Int_t ReadClassBuffer(
const TClass *cl,
void *pointer,
const TClass *onfile_class);
310 virtual Int_t WriteClassBuffer(
const TClass *cl,
void *pointer);
317 static void SetGlobalReadParam(
Int_t mapsize);
318 static void SetGlobalWriteParam(
Int_t mapsize);
319 static Int_t GetGlobalReadParam();
320 static Int_t GetGlobalWriteParam();
331 if (fBufCur +
sizeof(
UChar_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UChar_t));
338 if (fBufCur +
sizeof(
Char_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Char_t));
345 if (fBufCur +
sizeof(
UChar_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UChar_t));
352 if (fBufCur +
sizeof(
Short_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Short_t));
359 if (fBufCur +
sizeof(
UShort_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UShort_t));
366 if (fBufCur +
sizeof(
Int_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Int_t));
373 if (fBufCur +
sizeof(
UInt_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UInt_t));
380 if (fBufCur +
sizeof(
Long_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Long_t));
387 if (fBufCur +
sizeof(
ULong_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
ULong_t));
394 if (fBufCur +
sizeof(
Long64_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Long64_t));
408 if (fBufCur +
sizeof(
Float_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Float_t));
415 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)
Binding & operator=(OUT(*fun)(void))
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)