Warning, file /include/root/TBufferIO.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TBufferIO
0013 #define ROOT_TBufferIO
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TBuffer.h"
0025
0026 #include "TString.h"
0027
0028 class TExMap;
0029
0030 class TBufferIO : public TBuffer {
0031
0032 protected:
0033 enum { kNullTag = 0 };
0034
0035 Int_t fMapCount{0};
0036 Int_t fMapSize{0};
0037 Int_t fDisplacement{0};
0038 UShort_t fPidOffset{0};
0039 TExMap *fMap{nullptr};
0040 TExMap *fClassMap{nullptr};
0041
0042 static Int_t fgMapSize;
0043
0044 TBufferIO() {}
0045
0046 TBufferIO(TBuffer::EMode mode);
0047 TBufferIO(TBuffer::EMode mode, Int_t bufsiz);
0048 TBufferIO(TBuffer::EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE,
0049 ReAllocCharFun_t reallocfunc = nullptr);
0050
0051
0052
0053 static R__ALWAYS_INLINE ULong_t Void_Hash(const void *ptr) { return TString::Hash(&ptr, sizeof(void *)); }
0054
0055
0056 virtual void CheckCount(UInt_t) {}
0057
0058 Long64_t GetObjectTag(const void *obj);
0059
0060 virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) = 0;
0061
0062 public:
0063 enum { kMapSize = 503 };
0064
0065 enum EStatusBits {
0066 kNotDecompressed = BIT(15),
0067 kTextBasedStreaming = BIT(18),
0068
0069 kUser1 = BIT(21),
0070 kUser2 = BIT(22),
0071 kUser3 = BIT(23)
0072 };
0073
0074 ~TBufferIO() override;
0075
0076 Int_t GetVersionOwner() const override;
0077
0078
0079 UShort_t GetPidOffset() const override { return fPidOffset; }
0080 void SetPidOffset(UShort_t offset) override;
0081 Int_t GetBufferDisplacement() const override { return fDisplacement; }
0082 void SetBufferDisplacement() override { fDisplacement = 0; }
0083 void SetBufferDisplacement(Int_t skipped) override { fDisplacement = (Int_t)(Length() - skipped); }
0084
0085
0086 void SetReadParam(Int_t mapsize) override;
0087 void SetWriteParam(Int_t mapsize) override;
0088 void InitMap() override;
0089 void ResetMap() override;
0090 void Reset() override;
0091 Int_t GetMapCount() const override { return fMapCount; }
0092 void MapObject(const TObject *obj, UInt_t offset = 1) override;
0093 void MapObject(const void *obj, const TClass *cl, UInt_t offset = 1) override;
0094 Bool_t CheckObject(const TObject *obj) override;
0095 Bool_t CheckObject(const void *obj, const TClass *ptrClass) override;
0096 void GetMappedObject(UInt_t tag, void *&ptr, TClass *&ClassPtr) const override;
0097
0098
0099 void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force) override;
0100 void ForceWriteInfoClones(TClonesArray *a) override;
0101 Int_t ReadClones(TClonesArray *a, Int_t nobjects, Version_t objvers) override;
0102 Int_t WriteClones(TClonesArray *a, Int_t nobjects) override;
0103 void TagStreamerInfo(TVirtualStreamerInfo *info) override;
0104
0105
0106 TProcessID *GetLastProcessID(TRefTable *reftable) const override;
0107 UInt_t GetTRefExecId() override;
0108 TProcessID *ReadProcessID(UShort_t pidf) override;
0109 UShort_t WriteProcessID(TProcessID *pid) override;
0110
0111 Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse = kTRUE) override;
0112 void WriteObject(const TObject *obj, Bool_t cacheReuse = kTRUE) override;
0113 using TBuffer::WriteObject;
0114
0115 static void SetGlobalReadParam(Int_t mapsize);
0116 static void SetGlobalWriteParam(Int_t mapsize);
0117 static Int_t GetGlobalReadParam();
0118 static Int_t GetGlobalWriteParam();
0119
0120 ClassDefOverride(TBufferIO, 0)
0121 };
0122
0123 #endif