Direct subclass of TBuffer, implements common methods for TBufferFile and TBufferText classes.
Definition at line 30 of file TBufferIO.h.
Public Types | |
enum | { kMapSize = 503 } |
enum | EStatusBits { kNotDecompressed = (1ULL << ( 15 )) , kTextBasedStreaming = (1ULL << ( 18 )) , kUser1 = (1ULL << ( 21 )) , kUser2 = (1ULL << ( 22 )) , kUser3 = (1ULL << ( 23 )) } |
Public Types inherited from TBuffer | |
enum | { kInitialSize = 1024 , kMinimalSize = 128 } |
enum | EMode { kRead = 0 , kWrite = 1 } |
enum | EStatusBits { kIsOwner = (1ULL << ( 16 )) , kCannotHandleMemberWiseStreaming = (1ULL << ( 17 )) } |
Public Types inherited from TObject | |
enum | { kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 , kBitMask = 0x00ffffff } |
enum | { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) } |
enum | EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) } |
enum | EStatusBits { kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) , kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 )) } |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Int_t | GetGlobalReadParam () |
Get default read map size. | |
static Int_t | GetGlobalWriteParam () |
Get default write map size. | |
static void | SetGlobalReadParam (Int_t mapsize) |
Set the initial size of the map used to store object and class references during reading. | |
static void | SetGlobalWriteParam (Int_t mapsize) |
Set the initial size of the map used to store object and class references during reading. | |
Static Public Member Functions inherited from TBuffer | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static TClass * | GetClass (const char *className) |
Forward to TROOT::GetClass(). | |
static TClass * | GetClass (const std::type_info &typeinfo) |
Forward to TROOT::GetClass(). | |
Static Public Member Functions inherited from TObject | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Longptr_t | GetDtorOnly () |
Return destructor only flag. | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. | |
Protected Types | |
enum | { kNullTag = 0 } |
Protected Types inherited from TBuffer | |
typedef std::vector< TVirtualArray * > | CacheList_t |
Protected Types inherited from TObject | |
enum | { kOnlyPrepStep = (1ULL << ( 3 )) } |
Protected Member Functions | |
TBufferIO () | |
TBufferIO (TBuffer::EMode mode) | |
constructor | |
TBufferIO (TBuffer::EMode mode, Int_t bufsiz) | |
constructor | |
TBufferIO (TBuffer::EMode mode, Int_t bufsiz, void *buf, Bool_t adopt=kTRUE, ReAllocCharFun_t reallocfunc=nullptr) | |
constructor | |
virtual void | CheckCount (UInt_t) |
Long64_t | GetObjectTag (const void *obj) |
Returns tag for specified object from objects map (if exists) Returns 0 if object not included into objects map. | |
virtual void | WriteObjectClass (const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse)=0 |
Protected Member Functions inherited from TBuffer | |
TBuffer () | |
TBuffer (const TBuffer &)=delete | |
void | operator= (const TBuffer &)=delete |
Int_t | Read (const char *name) override |
Read contents of object with specified name from the current directory. | |
Int_t | Write (const char *name, Int_t opt, Int_t bufs) const override |
Write this object to the current directory. | |
Int_t | Write (const char *name, Int_t opt, Int_t bufs) override |
Write this object to the current directory. | |
Protected Member Functions inherited from TObject | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). | |
void | MakeZombie () |
Static Protected Member Functions | |
static R__ALWAYS_INLINE ULong_t | Void_Hash (const void *ptr) |
Return hash value for provided object. | |
Protected Attributes | |
TExMap * | fClassMap {nullptr} |
Map containing object,class pairs for reading. | |
Int_t | fDisplacement {0} |
Value to be added to the map offsets. | |
TExMap * | fMap {nullptr} |
Map containing object,offset pairs for reading/writing. | |
Int_t | fMapCount {0} |
Number of objects or classes in map. | |
Int_t | fMapSize {0} |
Default size of map. | |
UShort_t | fPidOffset {0} |
Offset to be added to the pid index in this key/buffer. | |
Protected Attributes inherited from TBuffer | |
char * | fBufCur |
char * | fBuffer |
char * | fBufMax |
Int_t | fBufSize |
CacheList_t | fCacheStack |
Realloc function to be used when extending the buffer. | |
Bool_t | fMode |
TObject * | fParent |
ReAllocCharFun_t | fReAllocFunc |
Int_t | fVersion |
Static Protected Attributes | |
static Int_t | fgMapSize = kMapSize |
Default map size for all TBuffer objects. | |
#include <TBufferIO.h>
Enumerator | |
---|---|
kNullTag |
Definition at line 33 of file TBufferIO.h.
Enumerator | |
---|---|
kMapSize |
Definition at line 63 of file TBufferIO.h.
Enumerator | |
---|---|
kNotDecompressed | |
kTextBasedStreaming | |
kUser1 | |
kUser2 | |
kUser3 |
Definition at line 65 of file TBufferIO.h.
|
inlineprotected |
Definition at line 44 of file TBufferIO.h.
|
protected |
constructor
Definition at line 43 of file TBufferIO.cxx.
|
protected |
constructor
Definition at line 51 of file TBufferIO.cxx.
|
protected |
constructor
Definition at line 59 of file TBufferIO.cxx.
|
override |
destructor
Definition at line 68 of file TBufferIO.cxx.
Reimplemented in TBufferFile.
Definition at line 56 of file TBufferIO.h.
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).
Implements TBuffer.
Definition at line 225 of file TBufferIO.cxx.
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 ).
Implements TBuffer.
Definition at line 235 of file TBufferIO.cxx.
Definition at line 120 of file TBufferIO.h.
Definition at line 120 of file TBufferIO.h.
|
overridevirtual |
force writing the TStreamerInfo to the file
Implements TBuffer.
Reimplemented in TMessage.
Definition at line 329 of file TBufferIO.cxx.
|
overridevirtual |
Make sure TStreamerInfo is not optimized, otherwise it will not be possible to support schema evolution in read mode.
In case the StreamerInfo has already been computed and optimized, one must disable the option BypassStreamer.
Implements TBuffer.
Definition at line 341 of file TBufferIO.cxx.
|
inlineoverridevirtual |
Implements TBuffer.
Definition at line 81 of file TBufferIO.h.
|
static |
Get default read map size.
Definition at line 572 of file TBufferIO.cxx.
|
static |
Get default write map size.
Definition at line 580 of file TBufferIO.cxx.
|
overridevirtual |
Return the last TProcessID in the file.
Implements TBuffer.
Definition at line 399 of file TBufferIO.cxx.
|
inlineoverridevirtual |
Implements TBuffer.
Definition at line 91 of file TBufferIO.h.
|
overridevirtual |
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.
Implements TBuffer.
Definition at line 260 of file TBufferIO.cxx.
Returns tag for specified object from objects map (if exists) Returns 0 if object not included into objects map.
Definition at line 277 of file TBufferIO.cxx.
|
inlineoverridevirtual |
Implements TBuffer.
Definition at line 79 of file TBufferIO.h.
|
overridevirtual |
Return the exec id stored in the current TStreamerInfo element.
The execid has been saved in the unique id of the TStreamerElement being read by TStreamerElement::Streamer. The current element (fgElement) is set as a static global by TStreamerInfo::ReadBuffer (Clones) when reading this TRef.
Implements TBuffer.
Definition at line 447 of file TBufferIO.cxx.
|
overridevirtual |
Return the version number of the owner file.
Implements TBuffer.
Definition at line 77 of file TBufferIO.cxx.
|
overridevirtual |
Create the fMap container and initialize them with the null object.
Implements TBuffer.
Definition at line 129 of file TBufferIO.cxx.
|
inlineoverridevirtual |
Reimplemented from TBuffer.
Reimplemented in TBufferJSON, TBufferText, TBufferSQL2, TBufferXML, TMessage, and TBufferSQL.
Definition at line 120 of file TBufferIO.h.
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).
Implements TBuffer.
Definition at line 163 of file TBufferIO.cxx.
|
overridevirtual |
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).
Implements TBuffer.
Definition at line 196 of file TBufferIO.cxx.
|
overridevirtual |
Interface to TStreamerInfo::ReadBufferClones.
Implements TBuffer.
Definition at line 372 of file TBufferIO.cxx.
|
overridevirtual |
The TProcessID with number pidf is read from file.
If the object is not already entered in the gROOT list, it is added.
Implements TBuffer.
Definition at line 422 of file TBufferIO.cxx.
|
overridevirtual |
Reset buffer object. Resets map and buffer offset.
Implements TBuffer.
Reimplemented in TMessage.
Definition at line 305 of file TBufferIO.cxx.
|
overridevirtual |
Delete existing fMap and reset map counter.
Implements TBuffer.
Definition at line 288 of file TBufferIO.cxx.
|
inlineoverridevirtual |
Implements TBuffer.
Definition at line 82 of file TBufferIO.h.
|
inlineoverridevirtual |
Implements TBuffer.
Definition at line 83 of file TBufferIO.h.
|
static |
Set the initial size of the map used to store object and class references during reading.
The default size is kMapSize. 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().
Definition at line 548 of file TBufferIO.cxx.
|
static |
Set the initial size of the map used to store object and class references during reading.
The default size is kMapSize. 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().
Definition at line 564 of file TBufferIO.cxx.
|
overridevirtual |
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 referred 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.
Implements TBuffer.
Definition at line 319 of file TBufferIO.cxx.
|
overridevirtual |
Set the initial size of the map used to store object and class references during reading.
The default size is TBufferFile::kMapSize. 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().
Implements TBuffer.
Definition at line 97 of file TBufferIO.cxx.
|
overridevirtual |
Set the initial size of the hashtable used to store object and class references during writing.
The default size is TBufferFile::kMapSize. 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().
Implements TBuffer.
Definition at line 117 of file TBufferIO.cxx.
|
overridevirtual |
Stream an object of class TObject.
Reimplemented from TBuffer.
Reimplemented in TBufferJSON, TBufferText, TBufferSQL2, TBufferXML, TMessage, and TBufferSQL.
|
inline |
Definition at line 120 of file TBufferIO.h.
|
overridevirtual |
Mark the classindex of the current file as using this TStreamerInfo.
Implements TBuffer.
Reimplemented in TMessage.
Definition at line 350 of file TBufferIO.cxx.
|
inlinestaticprotected |
Return hash value for provided object.
Definition at line 53 of file TBufferIO.h.
|
overridevirtual |
Interface to TStreamerInfo::WriteBufferClones.
Implements TBuffer.
Definition at line 385 of file TBufferIO.cxx.
Implements TBuffer.
|
overridevirtual |
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:
If 'cacheReuse' is true (default) upon seeing an object address a second time, we record the offset where its was written the first time rather than streaming the object a second time. If 'cacheReuse' is false, we always stream the object. This allows the (re)use of temporary object to store different data in the same buffer.
Implements TBuffer.
Definition at line 492 of file TBufferIO.cxx.
|
protectedpure virtual |
Implemented in TBufferJSON, TBufferSQL2, TBufferXML, and TBufferFile.
|
overridevirtual |
Check if the ProcessID pid is already in the file.
If not, add it and return the index number in the local file list.
Implements TBuffer.
Reimplemented in TMessage.
Definition at line 456 of file TBufferIO.cxx.
|
protected |
Map containing object,class pairs for reading.
Definition at line 40 of file TBufferIO.h.
|
protected |
Value to be added to the map offsets.
Definition at line 37 of file TBufferIO.h.
Default map size for all TBuffer objects.
Definition at line 42 of file TBufferIO.h.
|
protected |
Map containing object,offset pairs for reading/writing.
Definition at line 39 of file TBufferIO.h.
|
protected |
Number of objects or classes in map.
Definition at line 35 of file TBufferIO.h.
|
protected |
Default size of map.
Definition at line 36 of file TBufferIO.h.
|
protected |
Offset to be added to the pid index in this key/buffer.
Definition at line 38 of file TBufferIO.h.