library: libCore
#include "TBuffer.h"

TBuffer


class description - header file - source file
viewCVS header - viewCVS source

class TBuffer: public TObject

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TBuffer(TBuffer::EMode mode)
TBuffer(TBuffer::EMode mode, Int_t bufsiz)
TBuffer(TBuffer::EMode mode, Int_t bufsiz, void* buf, Bool_t adopt = kTRUE)
virtual~TBuffer()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
char*Buffer() const
Int_tBufferSize() const
virtual Int_tCheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass* clss)
virtual Int_tCheckByteCount(UInt_t startpos, UInt_t bcnt, const char* classname)
Bool_tCheckObject(const TObject* obj)
Bool_tCheckObject(const void* obj, const TClass* ptrClass)
static TClass*Class()
virtual voidClassBegin(const TClass*, Version_t = -1)
virtual voidClassEnd(const TClass*)
virtual voidClassMember(const char*, const char* = "0", Int_t = -1, Int_t = -1)
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidDecrementLevel(TStreamerInfo*)
virtual voidTObject::Delete(Option_t* option = "")
voidDetachBuffer()
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tGetBufferDisplacement() const
Int_tGetBufferVersion() const
static TClass*GetClass(const type_info& typeinfo)
static TClass*GetClass(const char* className)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
static Int_tGetGlobalReadParam()
static Int_tGetGlobalWriteParam()
virtual const char*TObject::GetIconName() const
TStreamerInfo*GetInfo()
Int_tGetMapCount() const
voidGetMappedObject(UInt_t tag, void*& ptr, TClass*& ClassPtr) const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TObject*GetParent() const
UShort_tGetPidOffset() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidIncrementLevel(TStreamerInfo* info)
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
voidInitMap()
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsReading() const
virtual Bool_tTObject::IsSortable() const
Bool_tIsWriting() const
Bool_tTObject::IsZombie() const
Int_tLength() const
virtual voidTObject::ls(Option_t* option = "") const
voidMapObject(const TObject* obj, UInt_t offset = 1)
voidMapObject(const void* obj, const TClass* cl, UInt_t offset = 1)
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual TBuffer&operator<<(Bool_t b)
virtual TBuffer&operator<<(Char_t c)
virtual TBuffer&operator<<(UChar_t c)
virtual TBuffer&operator<<(Short_t h)
virtual TBuffer&operator<<(UShort_t h)
virtual TBuffer&operator<<(Int_t i)
virtual TBuffer&operator<<(UInt_t i)
virtual TBuffer&operator<<(Long_t l)
virtual TBuffer&operator<<(ULong_t l)
virtual TBuffer&operator<<(Long64_t ll)
virtual TBuffer&operator<<(ULong64_t ll)
virtual TBuffer&operator<<(Float_t f)
virtual TBuffer&operator<<(Double_t d)
virtual TBuffer&operator<<(const Char_t* c)
virtual TBuffer&operator>>(Bool_t& b)
virtual TBuffer&operator>>(Char_t& c)
virtual TBuffer&operator>>(UChar_t& c)
virtual TBuffer&operator>>(Short_t& h)
virtual TBuffer&operator>>(UShort_t& h)
virtual TBuffer&operator>>(Int_t& i)
virtual TBuffer&operator>>(UInt_t& i)
virtual TBuffer&operator>>(Long_t& l)
virtual TBuffer&operator>>(ULong_t& l)
virtual TBuffer&operator>>(Long64_t& ll)
virtual TBuffer&operator>>(ULong64_t& ll)
virtual TBuffer&operator>>(Float_t& f)
virtual TBuffer&operator>>(Double_t& d)
virtual TBuffer&operator>>(Char_t* c)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tReadArray(Bool_t*& b)
virtual Int_tReadArray(Char_t*& c)
virtual Int_tReadArray(UChar_t*& c)
virtual Int_tReadArray(Short_t*& h)
virtual Int_tReadArray(UShort_t*& h)
virtual Int_tReadArray(Int_t*& i)
virtual Int_tReadArray(UInt_t*& i)
virtual Int_tReadArray(Long_t*& l)
virtual Int_tReadArray(ULong_t*& l)
virtual Int_tReadArray(Long64_t*& l)
virtual Int_tReadArray(ULong64_t*& ll)
virtual Int_tReadArray(Float_t*& f)
virtual Int_tReadArray(Double_t*& d)
virtual Int_tReadArrayDouble32(Double_t*& d, TStreamerElement* ele = 0)
Int_tReadBuf(void* buf, Int_t max)
virtual TClass*ReadClass(const TClass* cl = 0, UInt_t* objTag = 0)
virtual voidReadDouble32(Double_t* d, TStreamerElement* ele = 0)
virtual voidReadFastArray(Bool_t* b, Int_t n)
virtual voidReadFastArray(Char_t* c, Int_t n)
virtual voidReadFastArray(UChar_t* c, Int_t n)
virtual voidReadFastArray(Short_t* h, Int_t n)
virtual voidReadFastArray(UShort_t* h, Int_t n)
virtual voidReadFastArray(Int_t* i, Int_t n)
virtual voidReadFastArray(UInt_t* i, Int_t n)
virtual voidReadFastArray(Long_t* l, Int_t n)
virtual voidReadFastArray(ULong_t* l, Int_t n)
virtual voidReadFastArray(Long64_t* l, Int_t n)
virtual voidReadFastArray(ULong64_t* ll, Int_t n)
virtual voidReadFastArray(Float_t* f, Int_t n)
virtual voidReadFastArray(Double_t* d, Int_t n)
virtual voidReadFastArray(void* start, const TClass* cl, Int_t n = 1, TMemberStreamer* s = 0)
virtual voidReadFastArray(void** startp, const TClass* cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE, TMemberStreamer* s = 0)
virtual voidReadFastArrayDouble32(Double_t* d, Int_t n, TStreamerElement* ele = 0)
virtual voidReadFastArrayString(Char_t* c, Int_t n)
virtual TObject*ReadObject(const TClass* cl)
virtual void*ReadObjectAny(const TClass* cast)
virtual Int_tReadStaticArray(Bool_t* b)
virtual Int_tReadStaticArray(Char_t* c)
virtual Int_tReadStaticArray(UChar_t* c)
virtual Int_tReadStaticArray(Short_t* h)
virtual Int_tReadStaticArray(UShort_t* h)
virtual Int_tReadStaticArray(Int_t* i)
virtual Int_tReadStaticArray(UInt_t* i)
virtual Int_tReadStaticArray(Long_t* l)
virtual Int_tReadStaticArray(ULong_t* l)
virtual Int_tReadStaticArray(Long64_t* l)
virtual Int_tReadStaticArray(ULong64_t* ll)
virtual Int_tReadStaticArray(Float_t* f)
virtual Int_tReadStaticArray(Double_t* d)
virtual Int_tReadStaticArrayDouble32(Double_t* d, TStreamerElement* ele = 0)
char*ReadString(char* s, Int_t max)
virtual Version_tReadVersion(UInt_t* start = 0, UInt_t* bcnt = 0, const TClass* cl = 0)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReset()
voidTObject::ResetBit(UInt_t f)
voidResetMap()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetBuffer(void* buf, UInt_t bufsiz = 0, Bool_t adopt = kTRUE)
voidSetBufferDisplacement()
voidSetBufferDisplacement(Int_t skipped)
voidSetBufferOffset(Int_t offset = 0)
virtual voidSetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
static voidSetGlobalReadParam(Int_t mapsize)
static voidSetGlobalWriteParam(Int_t mapsize)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetParent(TObject* parent)
voidSetPidOffset(UShort_t offset)
voidSetReadMode()
voidSetReadParam(Int_t mapsize)
virtual voidSetStreamerElementNumber(Int_t)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetWriteMode()
voidSetWriteParam(Int_t mapsize)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidSkipObjectAny()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidStreamObject(TObject* obj)
virtual voidStreamObject(void* obj, const type_info& typeinfo)
virtual voidStreamObject(void* obj, const char* className)
virtual voidStreamObject(void* obj, const TClass* cl)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual voidWriteArray(const Bool_t* b, Int_t n)
virtual voidWriteArray(const Char_t* c, Int_t n)
virtual voidWriteArray(const UChar_t* c, Int_t n)
virtual voidWriteArray(const Short_t* h, Int_t n)
virtual voidWriteArray(const UShort_t* h, Int_t n)
virtual voidWriteArray(const Int_t* i, Int_t n)
virtual voidWriteArray(const UInt_t* i, Int_t n)
virtual voidWriteArray(const Long_t* l, Int_t n)
virtual voidWriteArray(const ULong_t* l, Int_t n)
virtual voidWriteArray(const Long64_t* l, Int_t n)
virtual voidWriteArray(const ULong64_t* ll, Int_t n)
virtual voidWriteArray(const Float_t* f, Int_t n)
virtual voidWriteArray(const Double_t* d, Int_t n)
virtual voidWriteArrayDouble32(const Double_t* d, Int_t n, TStreamerElement* ele = 0)
voidWriteBuf(const void* buf, Int_t max)
virtual voidWriteClass(const TClass* cl)
virtual voidWriteDouble32(Double_t* d, TStreamerElement* ele = 0)
virtual voidWriteFastArray(const Bool_t* b, Int_t n)
virtual voidWriteFastArray(const Char_t* c, Int_t n)
virtual voidWriteFastArray(const UChar_t* c, Int_t n)
virtual voidWriteFastArray(const Short_t* h, Int_t n)
virtual voidWriteFastArray(const UShort_t* h, Int_t n)
virtual voidWriteFastArray(const Int_t* i, Int_t n)
virtual voidWriteFastArray(const UInt_t* i, Int_t n)
virtual voidWriteFastArray(const Long_t* l, Int_t n)
virtual voidWriteFastArray(const ULong_t* l, Int_t n)
virtual voidWriteFastArray(const Long64_t* l, Int_t n)
virtual voidWriteFastArray(const ULong64_t* ll, Int_t n)
virtual voidWriteFastArray(const Float_t* f, Int_t n)
virtual voidWriteFastArray(const Double_t* d, Int_t n)
virtual voidWriteFastArray(void* start, const TClass* cl, Int_t n = 1, TMemberStreamer* s = 0)
virtual Int_tWriteFastArray(void** startp, const TClass* cl, Int_t n = 1, Bool_t isPreAlloc = kFALSE, TMemberStreamer* s = 0)
virtual voidWriteFastArrayDouble32(const Double_t* d, Int_t n, TStreamerElement* ele = 0)
virtual voidWriteFastArrayString(const Char_t* c, Int_t n)
virtual voidWriteObject(const TObject* obj)
virtual Int_tWriteObjectAny(const void* obj, const TClass* ptrClass)
voidWriteString(const char* s)
virtual UInt_tWriteVersion(const TClass* cl, Bool_t useBcnt = kFALSE)
virtual UInt_tWriteVersionMemberWise(const TClass* cl, Bool_t useBcnt = kFALSE)
protected:
TBuffer()
TBuffer(const TBuffer&)
Int_tCheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass* clss, const char* classname)
voidCheckCount(UInt_t offset)
UInt_tCheckObject(UInt_t offset, const TClass* cl, Bool_t readClass = kFALSE)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidExpand(Int_t newsize)
voidTObject::MakeZombie()
voidoperator=(const TBuffer&)
virtual Int_tRead(const char* name)
virtual Int_tWrite(const char* name, Int_t opt, Int_t bufs)
virtual Int_tWrite(const char* name, Int_t opt, Int_t bufs) const
virtual voidWriteObject(const void* actualObjStart, const TClass* actualClass)

Data Members

public:
enum EMode { kRead
kWrite
};
enum { kInitialSize
kMinimalSize
kMapSize
kStreamedMemberWise
kNotDecompressed
kIsOwner
kCannotHandleMemberWiseStreaming
kTextBasedStreaming
kUser1
kUser2
kUser3
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Bool_tfModeRead or write mode
Int_tfVersionBuffer format version
Int_tfBufSizeSize of buffer
char*fBufferBuffer used to store objects
char*fBufCurCurrent position in buffer
char*fBufMaxEnd of buffer
Int_tfMapCountNumber of objects or classes in map
Int_tfMapSizeDefault size of map
Int_tfDisplacementValue to be added to the map offsets
TExMap*fMapMap containing object,offset pairs for reading/writing
TExMap*fClassMapMap containing object,class pairs for reading
TObject*fParentPointer to the buffer parent (file) where buffer is read/written
TStreamerInfo*fInfoPointer to TStreamerInfo object writing/reading the buffer
vector<TStreamerInfo*,allocator<TStreamerInfo*> >fInfosStack of pointers to the TStreamerInfos
UShort_tfPidOffsetOffset to be added to the pid index in this key/buffer.
static Int_tfgMapSizeDefault map size for all TBuffer objects

Class Description

                                                                      
 TBuffer                                                              
                                                                      
 Buffer base class used for serializing objects.                      
                                                                      

TBuffer(EMode mode)
 Create an I/O buffer object. Mode should be either TBuffer::kRead or
 TBuffer::kWrite. By default the I/O buffer has a size of
 TBuffer::kInitialSize (1024) bytes.
TBuffer(EMode mode, Int_t bufsiz)
 Create an I/O buffer object. Mode should be either TBuffer::kRead or
 TBuffer::kWrite.
TBuffer(EMode mode, Int_t bufsiz, void *buf, Bool_t adopt)
 Create an I/O buffer object. Mode should be either TBuffer::kRead or
 TBuffer::kWrite. By default the I/O buffer has a size of
 TBuffer::kInitialSize (1024) bytes. An external buffer can be passed
 to TBuffer via the buf argument. By default this buffer will be adopted
 unless adopt is false.
TBuffer(const TBuffer &b)
 TBuffer copy ctor.
void operator=(const TBuffer&)
 TBuffer assignment operator.
return *this;
~TBuffer()
 Delete an I/O buffer object.
TBuffer & operator>>(Long_t &l)
operator >>
void SetBuffer(void *buf, UInt_t newsiz, Bool_t adopt)
 Sets a new buffer in an existing TBuffer object. If newsiz=0 then the
 new buffer is expected to have the same size as the previous buffer.
 The current buffer position is reset to the start of the buffer.
 If the TBuffer owned the previous buffer, it will be deleted prior
 to accepting the new buffer. By default the new buffer will be
 adopted unless adopt is false.
void CheckCount(UInt_t offset)
 Check if offset is not too large (< kMaxMapCount) when writing.
UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass)
 Check for object in the read map. If the object is 0 it still has to be
 read. Try to read it from the buffer starting at location offset. If the
 object is -1 then it really does not exist and we return 0. If the object
 exists just return the offset.
Bool_t CheckObject(const TObject *obj)
 Check if the specified object is already in the buffer.
 Returns kTRUE if object already in the buffer, kFALSE otherwise
 (also if obj is 0 or TBuffer not in writing mode).
Bool_t CheckObject(const void *obj, const TClass *ptrClass)
 Check if the specified object of the specified class is already in
 the buffer. Returns kTRUE if object already in the buffer,
 kFALSE otherwise (also if obj is 0 ).
void Expand(Int_t newsize)
 Expand the I/O buffer to newsize bytes.
TObject * GetParent()
 Return pointer to parent of this buffer.
void SetParent(TObject *parent)
 Set parent owning this buffer.
void SetPidOffset(UShort_t offset)
 This offset is used when a key (or basket) is transfered from one
 file to the other.  In this case the TRef and TObject might have stored a
 pid index (to retrieve TProcessIDs) which refered to their order on the original
 file, the fPidOffset is to be added to those values to correctly find the
 TProcessID.  This fPidOffset needs to be increment if the key/basket is copied
 and need to be zero for new key/basket.
void GetMappedObject(UInt_t tag, void* &ptr, TClass* &ClassPtr)
 Retrieve the object stored in the buffer's object map at 'tag'
 Set ptr and ClassPtr respectively to the address of the object and
 a pointer to its TClass.
void MapObject(const TObject *obj, UInt_t offset)
 Add object to the fMap container.
 If obj is not 0 add object to the map (in read mode also add 0 objects to
 the map). This method may only be called outside this class just before
 calling obj->Streamer() to prevent self reference of obj, in case obj
 contains (via via) a pointer to itself. In that case offset must be 1
 (default value for offset).
void MapObject(const void *obj, const TClass* cl, UInt_t offset)
 Add object to the fMap container.
 If obj is not 0 add object to the map (in read mode also add 0 objects to
 the map). This method may only be called outside this class just before
 calling obj->Streamer() to prevent self reference of obj, in case obj
 contains (via via) a pointer to itself. In that case offset must be 1
 (default value for offset).
void SetReadParam(Int_t mapsize)
 Set the initial size of the map used to store object and class
 references during reading. The default size is kMapSize=503.
 Increasing the default has the benefit that when reading many
 small objects the map does not need to be resized too often
 (the system is always dynamic, even with the default everything
 will work, only the initial resizing will cost some time).
 This method can only be called directly after the creation of
 the TBuffer, before any reading is done. Globally this option
 can be changed using SetGlobalReadParam().
void SetWriteParam(Int_t mapsize)
 Set the initial size of the hashtable used to store object and class
 references during writing. The default size is kMapSize=503.
 Increasing the default has the benefit that when writing many
 small objects the hashtable does not get too many collisions
 (the system is always dynamic, even with the default everything
 will work, only a large number of collisions will cost performance).
 For optimal performance hashsize should always be a prime.
 This method can only be called directly after the creation of
 the TBuffer, before any writing is done. Globally this option
 can be changed using SetGlobalWriteParam().
void InitMap()
 Create the fMap container and initialize them
 with the null object.
void IncrementLevel(TStreamerInfo* info)
increment level
void DecrementLevel(TStreamerInfo* /*info*/)
decrement level
void ResetMap()
 Delete existing fMap and reset map counter.
void SetByteCount(UInt_t cntpos, Bool_t packInVersion)
 Set byte count at position cntpos in the buffer. Generate warning if
 count larger than kMaxMapCount. The count is excluded its own size.
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss, const char *classname)
 Check byte count with current buffer position. They should
 match. If not print warning and position buffer in correct
 place determined by the byte count. Startpos is position of
 first byte where the byte count is written in buffer.
 Returns 0 if everything is ok, otherwise the bytecount offset
 (< 0 when read too little, >0 when read too much).
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)
 Check byte count with current buffer position. They should
 match. If not print warning and position buffer in correct
 place determined by the byte count. Startpos is position of
 first byte where the byte count is written in buffer.
 Returns 0 if everything is ok, otherwise the bytecount offset
 (< 0 when read too little, >0 when read too much).
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname)
 Check byte count with current buffer position. They should
 match. If not print warning and position buffer in correct
 place determined by the byte count. Startpos is position of
 first byte where the byte count is written in buffer.
 Returns 0 if everything is ok, otherwise the bytecount offset
 (< 0 when read too little, >0 when read too much).
Int_t ReadBuf(void *buf, Int_t max)
 Read max bytes from the I/O buffer into buf. The function returns
 the actual number of bytes read.
void WriteBuf(const void *buf, Int_t max)
 Write max bytes from buf into the I/O buffer.
Text_t * ReadString(Text_t *s, Int_t max)
 Read string from I/O buffer. String is read till 0 character is
 found or till max-1 characters are read (i.e. string s has max
 bytes allocated). If max = -1 no check on number of character is
 made, reading continues till 0 character is found.
void WriteString(const Text_t *s)
 Write string to I/O buffer. Writes string upto and including the
 terminating 0.
Int_t ReadArray(Bool_t *&b)
 Read array of bools from the I/O buffer. Returns the number of
 bools read. If argument is a 0 pointer then space will be
 allocated for the array.
Int_t ReadArray(Char_t *&c)
 Read array of characters from the I/O buffer. Returns the number of
 characters read. If argument is a 0 pointer then space will be
 allocated for the array.
Int_t ReadArray(Short_t *&h)
 Read array of shorts from the I/O buffer. Returns the number of shorts
 read. If argument is a 0 pointer then space will be allocated for the
 array.
Int_t ReadArray(Int_t *&ii)
 Read array of ints from the I/O buffer. Returns the number of ints
 read. If argument is a 0 pointer then space will be allocated for the
 array.
Int_t ReadArray(Long_t *&ll)
 Read array of longs from the I/O buffer. Returns the number of longs
 read. If argument is a 0 pointer then space will be allocated for the
 array.
Int_t ReadArray(Long64_t *&ll)
 Read array of long longs from the I/O buffer. Returns the number of
 long longs read. If argument is a 0 pointer then space will be
 allocated for the array.
Int_t ReadArray(Float_t *&f)
 Read array of floats from the I/O buffer. Returns the number of floats
 read. If argument is a 0 pointer then space will be allocated for the
 array.
Int_t ReadArray(Double_t *&d)
 Read array of doubles from the I/O buffer. Returns the number of doubles
 read. If argument is a 0 pointer then space will be allocated for the
 array.
Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele)
 Read array of doubles (written as float) from the I/O buffer.
 Returns the number of doubles read.
 If argument is a 0 pointer then space will be allocated for the array.
 see comments about Double32_t encoding at TBuffer::WriteDouble32
Int_t ReadStaticArray(Bool_t *b)
 Read array of bools from the I/O buffer. Returns the number of bools
 read.
Int_t ReadStaticArray(Char_t *c)
 Read array of characters from the I/O buffer. Returns the number of
 characters read.
Int_t ReadStaticArray(Short_t *h)
 Read array of shorts from the I/O buffer. Returns the number of shorts
 read.
Int_t ReadStaticArray(Int_t *ii)
 Read array of ints from the I/O buffer. Returns the number of ints
 read.
Int_t ReadStaticArray(Long_t *ll)
 Read array of longs from the I/O buffer. Returns the number of longs
 read.
Int_t ReadStaticArray(Long64_t *ll)
 Read array of long longs from the I/O buffer. Returns the number of
 long longs read.
Int_t ReadStaticArray(Float_t *f)
 Read array of floats from the I/O buffer. Returns the number of floats
 read.
Int_t ReadStaticArray(Double_t *d)
 Read array of doubles from the I/O buffer. Returns the number of doubles
 read.
Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele)
 Read array of doubles (written as float) from the I/O buffer.
 Returns the number of doubles read.
 see comments about Double32_t encoding at TBuffer::WriteDouble32
void ReadFastArray(Bool_t *b, Int_t n)
 Read array of n bools from the I/O buffer.
void ReadFastArray(Char_t *c, Int_t n)
 Read array of n characters from the I/O buffer.
void ReadFastArrayString(Char_t *c, Int_t n)
 Read array of n characters from the I/O buffer.
void ReadFastArray(Short_t *h, Int_t n)
 Read array of n shorts from the I/O buffer.
void ReadFastArray(Int_t *ii, Int_t n)
 Read array of n ints from the I/O buffer.
void ReadFastArray(Long_t *ll, Int_t n)
 Read array of n longs from the I/O buffer.
void ReadFastArray(Long64_t *ll, Int_t n)
 Read array of n long longs from the I/O buffer.
void ReadFastArray(Float_t *f, Int_t n)
 Read array of n floats from the I/O buffer.
void ReadFastArray(Double_t *d, Int_t n)
 Read array of n doubles from the I/O buffer.
void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele)
 Read array of n doubles (written as float) from the I/O buffer.
 see comments about Double32_t encoding at TBuffer::WriteDouble32
void ReadFastArray(void *start, const TClass *cl, Int_t n, TMemberStreamer *streamer)
 Read an array of 'n' objects from the I/O buffer.
 Stores the objects read starting at the address 'start'.
 The objects in the array are assume to be of class 'cl'.
void ReadFastArray(void **start, const TClass *cl, Int_t n, Bool_t isPreAlloc, TMemberStreamer *streamer)
 Read an array of 'n' objects from the I/O buffer.
 The objects read are stored starting at the address '*start'
 The objects in the array are assumed to be of class 'cl' or a derived class.
 'mode' indicates whether the data member is marked with '->'
void WriteArray(const Bool_t *b, Int_t n)
 Write array of n bools into the I/O buffer.
void WriteArray(const Char_t *c, Int_t n)
 Write array of n characters into the I/O buffer.
void WriteArray(const Short_t *h, Int_t n)
 Write array of n shorts into the I/O buffer.
void WriteArray(const Int_t *ii, Int_t n)
 Write array of n ints into the I/O buffer.
void WriteArray(const Long_t *ll, Int_t n)
 Write array of n longs into the I/O buffer.
void WriteArray(const ULong_t *ll, Int_t n)
 Write array of n unsigned longs into the I/O buffer.
 This is an explicit case for unsigned longs since signed longs
 have a special tobuf().
void WriteArray(const Long64_t *ll, Int_t n)
 Write array of n long longs into the I/O buffer.
void WriteArray(const Float_t *f, Int_t n)
 Write array of n floats into the I/O buffer.
void WriteArray(const Double_t *d, Int_t n)
 Write array of n doubles into the I/O buffer.
void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele)
 Write array of n doubles (as float) into the I/O buffer.
 see comments about Double32_t encoding at TBuffer::WriteDouble32
void WriteFastArray(const Bool_t *b, Int_t n)
 Write array of n bools into the I/O buffer.
void WriteFastArray(const Char_t *c, Int_t n)
 Write array of n characters into the I/O buffer.
void WriteFastArrayString(const Char_t *c, Int_t n)
 Write array of n characters into the I/O buffer.
void WriteFastArray(const Short_t *h, Int_t n)
 Write array of n shorts into the I/O buffer.
void WriteFastArray(const Int_t *ii, Int_t n)
 Write array of n ints into the I/O buffer.
void WriteFastArray(const Long_t *ll, Int_t n)
 Write array of n longs into the I/O buffer.
void WriteFastArray(const ULong_t *ll, Int_t n)
 Write array of n unsigned longs into the I/O buffer.
 This is an explicit case for unsigned longs since signed longs
 have a special tobuf().
void WriteFastArray(const Long64_t *ll, Int_t n)
 Write array of n long longs into the I/O buffer.
void WriteFastArray(const Float_t *f, Int_t n)
 Write array of n floats into the I/O buffer.
void WriteFastArray(const Double_t *d, Int_t n)
 Write array of n doubles into the I/O buffer.
void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele)
 Write array of n doubles (as float) into the I/O buffer.
 see comments about Double32_t encoding at TBuffer::WriteDouble32
void WriteFastArray(void *start, const TClass *cl, Int_t n, TMemberStreamer *streamer)
 Write an array of object starting at the address 'start' and of length 'n'
 the objects in the array are assumed to be of class 'cl'
Int_t WriteFastArray(void **start, const TClass *cl, Int_t n, Bool_t isPreAlloc, TMemberStreamer *streamer)
 Write an array of object starting at the address '*start' and of length 'n'
 the objects in the array are of class 'cl'
 'isPreAlloc' indicates whether the data member is marked with '->'
 Return:
  0: success
  2: truncated success (i.e actual class is missing. Only ptrClass saved.)
TObject * ReadObject(const TClass * /*clReq*/)
 Read object from I/O buffer. clReq is NOT used.
 The value returned is the address of the actual start in memory of
 the object. Note that if the actual class of the object does not
 inherit first from TObject, the type of the pointer is NOT 'TObject*'.
 [More accurately, the class needs to start with the TObject part, for
 the pointer to be a real TOject*].
 We recommend using ReadObjectAny instead of ReadObject
void SkipObjectAny()
 Skip any kind of object from buffer
void * ReadObjectAny(const TClass *clCast)
 Read object from I/O buffer.
 A typical use for this function is:
    MyClass *ptr = (MyClass*)b.ReadObjectAny(MyClass::Class());
 I.e. clCast should point to a TClass object describing the class pointed
 to by your pointer.
 In case of multiple inheritance, the return value might not be the
 real beginning of the object in memory.  You will need to use a
 dynamic_cast later if you need to retrieve it.
void WriteObject(const TObject *obj)
 Write object to I/O buffer.
void WriteObject(const void *actualObjectStart, const TClass *actualClass)
 Write object to I/O buffer.
 This function assumes that the value of 'actualObjectStart' is the actual start of
 the object of class 'actualClass'
Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)
 Write object to I/O buffer.
 This function assumes that the value in 'obj' is the value stored in
 a pointer to a "ptrClass". The actual type of the object pointed to
 can be any class derived from "ptrClass".
 Return:
  0: failure
  1: success
  2: truncated success (i.e actual class is missing. Only ptrClass saved.)
TClass * ReadClass(const TClass *clReq, UInt_t *objTag)
 Read class definition from I/O buffer. clReq can be used to cross check
 if the actually read object is of the requested class. objTag is
 set in case the object is a reference to an already read object.
void WriteClass(const TClass *cl)
 Write class description to I/O buffer.
Version_t ReadVersion(UInt_t *startpos, UInt_t *bcnt, const TClass *cl)
 Read class version from I/O buffer.
UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt)
 Write class version to I/O buffer.
UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt)
 Write class version to I/O buffer after setting the kStreamedMemberWise
 bit in the version number.
void SetReadMode()
 Set buffer in read mode.
void SetWriteMode()
 Set buffer in write mode.
void StreamObject(void *obj, const type_info &typeinfo)
 Stream an object given its C++ typeinfo information.
void StreamObject(void *obj, const char *className)
 Stream an object given the name of its actual class.
void StreamObject(void *obj, const TClass *cl)
 Stream an object given a pointer to its actual class.
void StreamObject(TObject *obj)
 Stream an object inheriting from TObject using its streamer
TClass * GetClass(const type_info &typeinfo)
 Forward to TROOT::GetClass
TClass * GetClass(const char *className)
 Forward to TROOT::GetClass
void SetGlobalReadParam(Int_t mapsize)
 Set the initial size of the map used to store object and class
 references during reading. The default size is kMapSize=503.
 Increasing the default has the benefit that when reading many
 small objects the array does not need to be resized too often
 (the system is always dynamic, even with the default everything
 will work, only the initial resizing will cost some time).
 Per TBuffer object this option can be changed using SetReadParam().
void SetGlobalWriteParam(Int_t mapsize)
 Set the initial size of the hashtable used to store object and class
 references during writing. The default size is kMapSize=503.
 Increasing the default has the benefit that when writing many
 small objects the hashtable does not get too many collisions
 (the system is always dynamic, even with the default everything
 will work, only a large number of collisions will cost performance).
 For optimal performance hashsize should always be a prime.
 Per TBuffer object this option can be changed using SetWriteParam().
Int_t GetGlobalReadParam()
 Get default read map size.
Int_t GetGlobalWriteParam()
 Get default write map size.
TBuffer & operator<<(Bool_t b)
______________________________________________________________________________
TBuffer & operator<<(Char_t c)
______________________________________________________________________________
TBuffer & operator<<(Short_t h)
______________________________________________________________________________
TBuffer & operator<<(Int_t i)
______________________________________________________________________________
TBuffer & operator<<(Long_t l)
______________________________________________________________________________
TBuffer & operator<<(ULong_t l)
______________________________________________________________________________
TBuffer & operator<<(Long64_t ll)
______________________________________________________________________________
TBuffer & operator<<(Float_t f)
______________________________________________________________________________
TBuffer & operator<<(Double_t d)
______________________________________________________________________________
TBuffer & operator<<(const Char_t *c)
______________________________________________________________________________
TBuffer & operator>>(Bool_t &b)
______________________________________________________________________________
TBuffer & operator>>(Char_t &c)
______________________________________________________________________________
TBuffer & operator>>(Short_t &h)
______________________________________________________________________________
TBuffer & operator>>(Int_t &i)
______________________________________________________________________________
TBuffer & operator>>(Long64_t &ll)
______________________________________________________________________________
TBuffer & operator>>(Float_t &f)
______________________________________________________________________________
TBuffer & operator>>(Double_t &d)
______________________________________________________________________________
TBuffer & operator>>(Char_t *c)
______________________________________________________________________________
TBuffer & operator<<(UChar_t c)
______________________________________________________________________________
______________________________________________________________________________
{ return TBuffer::operator<<((Char_t)c); }
TBuffer & operator<<(UShort_t h)
______________________________________________________________________________
{ return TBuffer::operator<<((Short_t)h); }
TBuffer & operator<<(UInt_t i)
______________________________________________________________________________
{ return TBuffer::operator<<((Int_t)i); }
TBuffer & operator<<(ULong64_t ll)
{ return TBuffer::operator<<((Long64_t)ll); }
TBuffer & operator>>(UChar_t &c)
______________________________________________________________________________
______________________________________________________________________________
{ return TBuffer::operator>>((Char_t&)c); }
TBuffer & operator>>(UShort_t &h)
______________________________________________________________________________
{ return TBuffer::operator>>((Short_t&)h); }
TBuffer & operator>>(UInt_t &i)
______________________________________________________________________________
{ return TBuffer::operator>>((Int_t&)i); }
TBuffer & operator>>(ULong_t &l)
______________________________________________________________________________
{ return TBuffer::operator>>((Long_t&)l); }
TBuffer & operator>>(ULong64_t &ll)
{ return TBuffer::operator>>((Long64_t&)ll); }
Int_t ReadArray(UChar_t *&c)
______________________________________________________________________________
______________________________________________________________________________
{ return TBuffer::ReadArray((Char_t *&)c); }
Int_t ReadArray(UShort_t *&h)
______________________________________________________________________________
{ return TBuffer::ReadArray((Short_t *&)h); }
Int_t ReadArray(UInt_t *&i)
______________________________________________________________________________
{ return TBuffer::ReadArray((Int_t *&)i); }
Int_t ReadArray(ULong_t *&l)
______________________________________________________________________________
{ return TBuffer::ReadArray((Long_t *&)l); }
Int_t ReadArray(ULong64_t *&ll)
{ return TBuffer::ReadArray((Long64_t *&)ll); }
Int_t ReadStaticArray(UChar_t *c)
______________________________________________________________________________
______________________________________________________________________________
{ return TBuffer::ReadStaticArray((Char_t *)c); }
Int_t ReadStaticArray(UShort_t *h)
______________________________________________________________________________
{ return TBuffer::ReadStaticArray((Short_t *)h); }
Int_t ReadStaticArray(UInt_t *i)
______________________________________________________________________________
{ return TBuffer::ReadStaticArray((Int_t *)i); }
Int_t ReadStaticArray(ULong_t *l)
______________________________________________________________________________
{ return TBuffer::ReadStaticArray((Long_t *)l); }
Int_t ReadStaticArray(ULong64_t *ll)
{ return TBuffer::ReadStaticArray((Long64_t *)ll); }
void ReadFastArray(UChar_t *c, Int_t n)
______________________________________________________________________________
______________________________________________________________________________
{ TBuffer::ReadFastArray((Char_t *)c, n); }
void ReadFastArray(UShort_t *h, Int_t n)
______________________________________________________________________________
{ TBuffer::ReadFastArray((Short_t *)h, n); }
void ReadFastArray(UInt_t *i, Int_t n)
______________________________________________________________________________
{ TBuffer::ReadFastArray((Int_t *)i, n); }
void ReadFastArray(ULong_t *l, Int_t n)
______________________________________________________________________________
{ TBuffer::ReadFastArray((Long_t *)l, n); }
void ReadFastArray(ULong64_t *ll, Int_t n)
{ TBuffer::ReadFastArray((Long64_t *)ll, n); }
void WriteArray(const UChar_t *c, Int_t n)
______________________________________________________________________________
______________________________________________________________________________
{ TBuffer::WriteArray((const Char_t *)c, n); }
void WriteArray(const UShort_t *h, Int_t n)
______________________________________________________________________________
{ TBuffer::WriteArray((const Short_t *)h, n); }
void WriteArray(const UInt_t *i, Int_t n)
______________________________________________________________________________
{ TBuffer::WriteArray((const Int_t *)i, n); }
void WriteArray(const ULong64_t *ll, Int_t n)
{ TBuffer::WriteArray((const Long64_t *)ll, n); }
void WriteFastArray(const UChar_t *c, Int_t n)
______________________________________________________________________________
______________________________________________________________________________
{ TBuffer::WriteFastArray((const Char_t *)c, n); }
void WriteFastArray(const UShort_t *h, Int_t n)
______________________________________________________________________________
{ TBuffer::WriteFastArray((const Short_t *)h, n); }
void WriteFastArray(const UInt_t *i, Int_t n)
______________________________________________________________________________
{ TBuffer::WriteFastArray((const Int_t *)i, n); }
void WriteFastArray(const ULong64_t *ll, Int_t n)
{ TBuffer::WriteFastArray((const Long64_t *)ll, n); }
TBuffer()
 Default ctor
{}
Int_t Read(const char *name)
{ return TObject::Read(name); }
Int_t Write(const char *name, Int_t opt, Int_t bufs)
{ return TObject::Write(name, opt, bufs); }
Int_t Write(const char *name, Int_t opt, Int_t bufs)
{ return TObject::Write(name, opt, bufs); }
Int_t GetMapCount()
{ return fMapCount; }
Int_t GetBufferVersion()
{ return fVersion; }
void Reset()
{ SetBufferOffset(); ResetMap(); }
void SetBufferOffset(Int_t offset = 0)
{ fBufCur = fBuffer+offset; }
char * Buffer()
{ return fBuffer; }
Int_t BufferSize()
{ return fBufSize; }
void DetachBuffer()
{ fBuffer = 0; }
Int_t Length()
{ return (Int_t)(fBufCur - fBuffer); }
void SetStreamerElementNumber(Int_t)
{}
TStreamerInfo * GetInfo()
{return fInfo;}
void ClassBegin(const TClass*, Version_t = -1)
{}
void ClassEnd(const TClass*)
{}
void ClassMember(const char*, const char* = 0, Int_t = -1, Int_t = -1)
{}
Bool_t IsReading()
{ return (fMode & kWrite) == 0; }
Bool_t IsWriting()
{ return (fMode & kWrite) != 0; }
UShort_t GetPidOffset()
 See comment in TBuffer::SetPidOffset
Int_t GetBufferDisplacement()
{ return fDisplacement; }
void SetBufferDisplacement()
{ fDisplacement = 0; }
void SetBufferDisplacement(Int_t skipped)
{ fDisplacement = (Int_t)(Length() - skipped); }
void WriteDouble32(Double_t *d, TStreamerElement *ele=0)

Author: Fons Rademakers 04/05/96
Last update: root/base:$Name: $:$Id: TBuffer.cxx,v 1.97 2006/05/23 08:49:55 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.