File indexing completed on 2025-01-18 10:12:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TStreamerElement
0013 #define ROOT_TStreamerElement
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "TNamed.h"
0024
0025 #include "ESTLType.h"
0026
0027 class TMethodCall;
0028 class TClass;
0029 class TStreamerBasicType;
0030 class TVirtualStreamerInfo;
0031
0032 class TStreamerElement : public TNamed {
0033
0034 private:
0035 TStreamerElement(const TStreamerElement &) = delete;
0036 TStreamerElement&operator=(const TStreamerElement&) = delete;
0037
0038 protected:
0039 Int_t fType;
0040 Int_t fSize;
0041 Int_t fArrayLength;
0042 Int_t fArrayDim;
0043 Int_t fMaxIndex[5];
0044 Int_t fOffset;
0045 Int_t fTObjectOffset;
0046 Int_t fNewType;
0047 TString fTypeName;
0048 TClass *fClassObject;
0049 TClass *fNewClass;
0050 TMemberStreamer *fStreamer;
0051 Double_t fXmin;
0052 Double_t fXmax;
0053 Double_t fFactor;
0054
0055 public:
0056
0057 enum ESTLtype {
0058 kSTL = ROOT::kSTLany,
0059 kSTLstring = ROOT::kSTLstring,
0060 kSTLvector = ROOT::kSTLvector,
0061 kSTLlist = ROOT::kSTLlist,
0062 kSTLforwardlist = ROOT::kSTLforwardlist,
0063 kSTLdeque = ROOT::kSTLdeque,
0064 kSTLmap = ROOT::kSTLmap,
0065 kSTLmultimap = ROOT::kSTLmultimap,
0066 kSTLset = ROOT::kSTLset,
0067 kSTLmultiset = ROOT::kSTLmultiset,
0068 kSTLunorderedset = ROOT::kSTLunorderedset,
0069 kSTLunorderedmultiset = ROOT::kSTLunorderedmultiset,
0070 kSTLunorderedmap = ROOT::kSTLunorderedmap,
0071 kSTLunorderedmultimap = ROOT::kSTLunorderedmultimap,
0072 kSTLbitset = ROOT::kSTLbitset
0073 };
0074
0075 enum EStatusBits {
0076 kHasRange = BIT(6),
0077 kCache = BIT(9),
0078 kRepeat = BIT(10),
0079 kRead = BIT(11),
0080 kWrite = BIT(12),
0081 kDoNotDelete = BIT(13),
0082 kWholeObject = BIT(14),
0083 kWarned = BIT(21)
0084 };
0085
0086 enum class EStatusBitsDupExceptions {
0087
0088
0089
0090
0091 kDoNotDelete = TStreamerElement::kDoNotDelete,
0092
0093
0094
0095
0096
0097 kHasRange = TStreamerElement::kHasRange
0098 };
0099
0100
0101 TStreamerElement();
0102 TStreamerElement(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName);
0103 virtual ~TStreamerElement();
0104 virtual Bool_t CannotSplit() const;
0105 Int_t GetArrayDim() const {return fArrayDim;}
0106 Int_t GetArrayLength() const {return fArrayLength;}
0107 virtual TClass *GetClassPointer() const;
0108 TClass *GetClass() const {return GetClassPointer();}
0109 virtual Int_t GetExecID() const;
0110 virtual const char *GetFullName() const;
0111 virtual const char *GetInclude() const {return "";}
0112 Int_t GetMaxIndex(Int_t i) const {return fMaxIndex[i];}
0113 virtual ULongptr_t GetMethod() const {return ULongptr_t(fStreamer);}
0114 TMemberStreamer *GetStreamer() const;
0115 virtual Int_t GetSize() const;
0116 Int_t GetNewType() const {return fNewType;}
0117 TClass* GetNewClass() const { return fNewClass; }
0118 Int_t GetType() const {return fType;}
0119 Int_t GetOffset() const {return fOffset;}
0120 void GetSequenceType(TString &type) const;
0121 Int_t GetTObjectOffset() const { return fTObjectOffset; }
0122 const char *GetTypeName() const {return fTypeName.Data();}
0123 const char *GetTypeNameBasic() const;
0124 Double_t GetFactor() const {return fFactor;}
0125 Double_t GetXmin() const {return fXmin;}
0126 Double_t GetXmax() const {return fXmax;}
0127 virtual void Init(TVirtualStreamerInfo *obj = nullptr);
0128 virtual Bool_t IsaPointer() const {return kFALSE;}
0129 virtual Bool_t HasCounter() const {return kFALSE;}
0130 virtual Bool_t IsOldFormat(const char *newTypeName);
0131 virtual Bool_t IsBase() const;
0132 virtual Bool_t IsTransient() const;
0133 void ls(Option_t *option="") const override;
0134 virtual void SetArrayDim(Int_t dim);
0135 virtual void SetMaxIndex(Int_t dim, Int_t max);
0136 virtual void SetOffset(Int_t offset) {fOffset=offset;}
0137 virtual void SetTObjectOffset(Int_t tobjoffset) {fTObjectOffset=tobjoffset;}
0138 virtual void SetStreamer(TMemberStreamer *streamer);
0139 virtual void SetSize(Int_t dsize) {fSize = dsize;}
0140 virtual void SetNewType(Int_t dtype) {fNewType = dtype;}
0141 virtual void SetNewClass( TClass* cl ) { fNewClass= cl; }
0142 virtual void SetType(Int_t dtype) {fType = dtype;}
0143 virtual void SetTypeName(const char *name) {fTypeName = name; fClassObject = (TClass*)-1; }
0144 virtual void Update(const TClass *oldClass, TClass *newClass);
0145
0146 ClassDefOverride(TStreamerElement,4)
0147 };
0148
0149
0150 class TStreamerBase : public TStreamerElement {
0151
0152 private:
0153 TStreamerBase(const TStreamerBase &) = delete;
0154 TStreamerBase&operator=(const TStreamerBase&) = delete;
0155
0156 protected:
0157 Int_t fBaseVersion;
0158 UInt_t &fBaseCheckSum;
0159 TClass *fBaseClass;
0160 TClass *fNewBaseClass;
0161 ClassStreamerFunc_t fStreamerFunc;
0162 ClassConvStreamerFunc_t fConvStreamerFunc;
0163 TVirtualStreamerInfo *fStreamerInfo;
0164 TString fErrorMsg;
0165
0166 void InitStreaming(Bool_t isTransient);
0167
0168 public:
0169
0170 TStreamerBase();
0171 TStreamerBase(const char *name, const char *title, Int_t offset, Bool_t isTransient = kFALSE);
0172 virtual ~TStreamerBase();
0173 Int_t GetBaseVersion() {return fBaseVersion;}
0174 UInt_t GetBaseCheckSum() {return fBaseCheckSum;}
0175 TClass *GetClassPointer() const override;
0176 const char *GetErrorMessage() const { return fErrorMsg; }
0177 const char *GetInclude() const override;
0178 TClass *GetNewBaseClass() { return fNewBaseClass; }
0179 ULongptr_t GetMethod() const override {return 0;}
0180 Int_t GetSize() const override;
0181 TVirtualStreamerInfo *GetBaseStreamerInfo() const { return fStreamerInfo; }
0182 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0183 void Init(Bool_t isTransient = kFALSE);
0184 Bool_t IsBase() const override;
0185 void ls(Option_t *option="") const override;
0186 Int_t ReadBuffer (TBuffer &b, char *pointer);
0187 void SetNewBaseClass( TClass* cl ) { fNewBaseClass = cl; InitStreaming(kFALSE); }
0188 void SetBaseVersion(Int_t v) {fBaseVersion = v;}
0189 void SetBaseCheckSum(UInt_t cs) {fBaseCheckSum = cs;}
0190 void SetErrorMessage(const char *msg) { fErrorMsg = msg; }
0191 void Update(const TClass *oldClass, TClass *newClass) override;
0192 Int_t WriteBuffer(TBuffer &b, char *pointer);
0193
0194 ClassDefOverride(TStreamerBase,3)
0195 };
0196
0197
0198 class TStreamerBasicPointer : public TStreamerElement {
0199
0200 private:
0201 TStreamerBasicPointer(const TStreamerBasicPointer &) = delete;
0202 TStreamerBasicPointer&operator=(const TStreamerBasicPointer&) = delete;
0203
0204 protected:
0205 Int_t fCountVersion;
0206 TString fCountName;
0207 TString fCountClass;
0208 TStreamerBasicType *fCounter;
0209
0210 public:
0211
0212 TStreamerBasicPointer();
0213 TStreamerBasicPointer(const char *name, const char *title, Int_t offset, Int_t dtype,
0214 const char *countName, const char *countClass, Int_t version, const char *typeName);
0215 virtual ~TStreamerBasicPointer();
0216 TClass *GetClassPointer() const override { return nullptr; }
0217 const char *GetCountClass() const {return fCountClass.Data();}
0218 const char *GetCountName() const {return fCountName.Data();}
0219 Int_t GetCountVersion() const {return fCountVersion;}
0220 ULongptr_t GetMethod() const override;
0221 Int_t GetSize() const override;
0222 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0223 Bool_t HasCounter() const override { return fCounter != nullptr; }
0224 Bool_t IsaPointer() const override { return kTRUE; }
0225 void SetArrayDim(Int_t dim) override;
0226 void SetCountClass(const char *clname) { fCountClass = clname; }
0227 void SetCountName(const char *name) { fCountName = name; }
0228 void SetCountVersion(Int_t count) { fCountVersion = count; }
0229 void Update(const TClass * , TClass * ) override {}
0230
0231 ClassDefOverride(TStreamerBasicPointer,2)
0232 };
0233
0234
0235 class TStreamerLoop : public TStreamerElement {
0236
0237 private:
0238 TStreamerLoop(const TStreamerLoop&) = delete;
0239 TStreamerLoop&operator=(const TStreamerLoop&) = delete;
0240
0241 protected:
0242 Int_t fCountVersion;
0243 TString fCountName;
0244 TString fCountClass;
0245 TStreamerBasicType *fCounter;
0246
0247 public:
0248
0249 TStreamerLoop();
0250 TStreamerLoop(const char *name, const char *title, Int_t offset, const char *countName, const char *countClass, Int_t version, const char *typeName);
0251 virtual ~TStreamerLoop();
0252 const char *GetCountClass() const {return fCountClass.Data();}
0253 const char *GetCountName() const {return fCountName.Data();}
0254 Int_t GetCountVersion() const {return fCountVersion;}
0255 const char *GetInclude() const override;
0256 ULongptr_t GetMethod() const override;
0257 Int_t GetSize() const override;
0258 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0259 Bool_t IsaPointer() const override {return kTRUE; }
0260 Bool_t HasCounter() const override { return fCounter != nullptr; }
0261 void SetCountClass(const char *clname) { fCountClass = clname; }
0262 void SetCountName(const char *name) { fCountName = name; }
0263 void SetCountVersion(Int_t count) { fCountVersion = count; }
0264
0265 ClassDefOverride(TStreamerLoop,2)
0266 };
0267
0268
0269 class TStreamerBasicType : public TStreamerElement {
0270
0271 private:
0272 TStreamerBasicType(const TStreamerBasicType&) = delete;
0273 TStreamerBasicType&operator=(const TStreamerBasicType&) = delete;
0274
0275 protected:
0276 Int_t fCounter;
0277
0278 public:
0279
0280 TStreamerBasicType();
0281 TStreamerBasicType(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName);
0282 virtual ~TStreamerBasicType();
0283 TClass *GetClassPointer() const override { return nullptr; }
0284 Int_t GetCounter() const { return fCounter; }
0285 ULongptr_t GetMethod() const override;
0286 Int_t GetSize() const override;
0287 void Update(const TClass * , TClass * ) override {}
0288
0289 ClassDefOverride(TStreamerBasicType,2)
0290 };
0291
0292
0293 class TStreamerObject : public TStreamerElement {
0294
0295 private:
0296 TStreamerObject(const TStreamerObject&) = delete;
0297 TStreamerObject&operator=(const TStreamerObject&) = delete;
0298
0299 public:
0300
0301 TStreamerObject();
0302 TStreamerObject(const char *name, const char *title, Int_t offset, const char *typeName);
0303 virtual ~TStreamerObject();
0304 const char *GetInclude() const override;
0305 Int_t GetSize() const override;
0306 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0307
0308 ClassDefOverride(TStreamerObject,2)
0309 };
0310
0311
0312 class TStreamerObjectAny : public TStreamerElement {
0313
0314 private:
0315 TStreamerObjectAny(const TStreamerObjectAny&) = delete;
0316 TStreamerObjectAny&operator=(const TStreamerObjectAny&) = delete;
0317
0318 public:
0319
0320 TStreamerObjectAny();
0321 TStreamerObjectAny(const char *name, const char *title, Int_t offset, const char *typeName);
0322 virtual ~TStreamerObjectAny();
0323 const char *GetInclude() const override;
0324 Int_t GetSize() const override;
0325 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0326
0327 ClassDefOverride(TStreamerObjectAny,2)
0328 };
0329
0330
0331 class TStreamerObjectPointer : public TStreamerElement {
0332
0333 private:
0334 TStreamerObjectPointer(const TStreamerObjectPointer&) = delete;
0335 TStreamerObjectPointer&operator=(const TStreamerObjectPointer&) = delete;
0336
0337 public:
0338
0339 TStreamerObjectPointer();
0340 TStreamerObjectPointer(const char *name, const char *title, Int_t offset, const char *typeName);
0341 virtual ~TStreamerObjectPointer();
0342 const char *GetInclude() const override;
0343 Int_t GetSize() const override;
0344 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0345 Bool_t IsaPointer() const override {return kTRUE;}
0346 void SetArrayDim(Int_t dim) override;
0347
0348 ClassDefOverride(TStreamerObjectPointer,2)
0349 };
0350
0351
0352 class TStreamerObjectAnyPointer : public TStreamerElement {
0353
0354 private:
0355 TStreamerObjectAnyPointer(const TStreamerObjectAnyPointer&) = delete;
0356 TStreamerObjectAnyPointer&operator=(const TStreamerObjectAnyPointer&) = delete;
0357
0358 public:
0359
0360 TStreamerObjectAnyPointer();
0361 TStreamerObjectAnyPointer(const char *name, const char *title, Int_t offset, const char *typeName);
0362 virtual ~TStreamerObjectAnyPointer();
0363 const char *GetInclude() const override;
0364 Int_t GetSize() const override;
0365 void Init(TVirtualStreamerInfo *obj = nullptr) override;
0366 Bool_t IsaPointer() const override { return kTRUE; }
0367 void SetArrayDim(Int_t dim) override;
0368
0369 ClassDefOverride(TStreamerObjectAnyPointer,1)
0370 };
0371
0372
0373 class TStreamerString : public TStreamerElement {
0374
0375 private:
0376 TStreamerString(const TStreamerString&) = delete;
0377 TStreamerString&operator=(const TStreamerString&) = delete;
0378
0379 public:
0380
0381 TStreamerString();
0382 TStreamerString(const char *name, const char *title, Int_t offset);
0383 virtual ~TStreamerString();
0384 const char *GetInclude() const override;
0385 Int_t GetSize() const override;
0386
0387 ClassDefOverride(TStreamerString,2)
0388 };
0389
0390
0391 class TStreamerSTL : public TStreamerElement {
0392
0393 private:
0394 TStreamerSTL(const TStreamerSTL&) = delete;
0395 TStreamerSTL&operator=(const TStreamerSTL&) = delete;
0396
0397 protected:
0398 Int_t fSTLtype;
0399 Int_t fCtype;
0400
0401 public:
0402
0403 TStreamerSTL();
0404 TStreamerSTL(const char *name, const char *title, Int_t offset,
0405 const char *typeName, const char *trueType, Bool_t dmPointer);
0406 TStreamerSTL(const char *name, const char *title, Int_t offset,
0407 const char *typeName, const TVirtualCollectionProxy &proxy , Bool_t dmPointer);
0408 virtual ~TStreamerSTL();
0409 Bool_t CannotSplit() const override;
0410 Bool_t IsaPointer() const override;
0411 Bool_t IsBase() const override;
0412 Int_t GetSTLtype() const {return fSTLtype;}
0413 Int_t GetCtype() const {return fCtype;}
0414 const char *GetInclude() const override;
0415 Int_t GetSize() const override;
0416 void ls(Option_t *option="") const override;
0417 void SetSTLtype(Int_t t) {fSTLtype = t;}
0418 void SetCtype(Int_t t) {fCtype = t;}
0419 void SetStreamer(TMemberStreamer *streamer) override;
0420
0421 ClassDefOverride(TStreamerSTL,3)
0422 };
0423
0424
0425 class TStreamerSTLstring : public TStreamerSTL {
0426
0427 private:
0428 TStreamerSTLstring(const TStreamerSTLstring&) = delete;
0429 TStreamerSTLstring&operator=(const TStreamerSTLstring&) = delete;
0430
0431 public:
0432
0433 TStreamerSTLstring();
0434 TStreamerSTLstring(const char *name, const char *title, Int_t offset,
0435 const char *typeName, Bool_t dmPointer);
0436 virtual ~TStreamerSTLstring();
0437 const char *GetInclude() const override;
0438 Int_t GetSize() const override;
0439
0440 ClassDefOverride(TStreamerSTLstring,2)
0441 };
0442
0443 class TVirtualObject;
0444 class TBuffer;
0445
0446 #include "TSchemaRule.h"
0447
0448
0449 class TStreamerArtificial : public TStreamerElement {
0450 private:
0451 TStreamerArtificial(const TStreamerArtificial&) = delete;
0452 TStreamerArtificial&operator=(const TStreamerArtificial&) = delete;
0453
0454 protected:
0455 ROOT::TSchemaRule::ReadFuncPtr_t fReadFunc;
0456 ROOT::TSchemaRule::ReadRawFuncPtr_t fReadRawFunc;
0457
0458 public:
0459
0460
0461
0462 TStreamerArtificial(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName) : TStreamerElement(name,title,offset,dtype,typeName), fReadFunc(nullptr), fReadRawFunc(nullptr) {}
0463
0464 void SetReadFunc( ROOT::TSchemaRule::ReadFuncPtr_t val ) { fReadFunc = val; };
0465 void SetReadRawFunc( ROOT::TSchemaRule::ReadRawFuncPtr_t val ) { fReadRawFunc = val; };
0466
0467 ROOT::TSchemaRule::ReadFuncPtr_t GetReadFunc();
0468 ROOT::TSchemaRule::ReadRawFuncPtr_t GetReadRawFunc();
0469
0470 ClassDefOverride(TStreamerArtificial, 0);
0471 };
0472
0473 #endif