Logo ROOT  
Reference Guide
TStreamerInfo.h
Go to the documentation of this file.
1// @(#)root/io:$Id$
2// Author: Rene Brun 12/10/2000
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TStreamerInfo
13#define ROOT_TStreamerInfo
14
15#include <atomic>
16#include <vector>
17
19
21
22#include "TObjArray.h"
23
24
25class TFile;
26class TClass;
27class TClonesArray;
28class TDataMember;
29class TMemberStreamer;
32class TClassStreamer;
33class TVirtualArray;
34namespace ROOT { namespace Detail { class TCollectionProxyInfo; } }
35namespace ROOT { class TSchemaRule; }
36
37namespace TStreamerInfoActions { class TActionSequence; }
38
40
41 class TCompInfo {
42 // Class used to cache information (see fComp)
43 private:
44 // TCompInfo(const TCompInfo&) = default;
45 // TCompInfo& operator=(const TCompInfo&) = default;
46 public:
51 TStreamerElement *fElem; ///< Not Owned
53 TClass *fClass; ///< Not Owned
54 TClass *fNewClass; ///< Not Owned
56 TMemberStreamer *fStreamer; ///< Not Owned
57 TCompInfo() : fType(-1), fNewType(0), fOffset(0), fLength(0), fElem(nullptr), fMethod(0),
58 fClass(nullptr), fNewClass(nullptr), fClassName(), fStreamer(nullptr) {}
60 void Update(const TClass *oldcl, TClass *newcl);
61 };
63
64public:
65 // make the opaque pointer public.
67
68protected:
69 //---------------------------------------------------------------------------
70 // Adapter class used to handle streaming collection of pointers
71 //---------------------------------------------------------------------------
73 {
74 public:
76 fProxy( proxy ) {}
77
78 char* operator[]( UInt_t idx ) const
79 {
80 char **el = (char**)fProxy->At(idx);
81 return *el;
82 }
83 private:
85 };
86
87private:
88 UInt_t fCheckSum; ///<Checksum of original class
89 Int_t fClassVersion; ///<Class version identifier
90 Int_t fOnFileClassVersion;///<!Class version identifier as stored on file.
91 Int_t fNumber; ///<!Unique identifier
92 Int_t fSize; ///<!size of the persistent class
93 Int_t fNdata; ///<!number of optimized elements
94 Int_t fNfulldata; ///<!number of elements
95 Int_t fNslots; ///<!total number of slots in fComp.
96 TCompInfo *fComp; ///<![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
97 TCompInfo **fCompOpt; ///<![fNdata]
98 TCompInfo **fCompFull; ///<![fElements->GetEntries()]
99 TClass *fClass; ///<!pointer to class
100 TObjArray *fElements; ///<Array of TStreamerElements
101 Version_t fOldVersion; ///<! Version of the TStreamerInfo object read from the file
102 Int_t fNVirtualInfoLoc; ///<! Number of virtual info location to update.
103 ULong_t *fVirtualInfoLoc; ///<![fNVirtualInfoLoc] Location of the pointer to the TStreamerInfo inside the object (when emulated)
104 TStreamerInfoActions::TActionSequence *fReadObjectWise; ///<! List of read action resulting from the compilation.
105 TStreamerInfoActions::TActionSequence *fReadMemberWise; ///<! List of read action resulting from the compilation for use in member wise streaming.
106 TStreamerInfoActions::TActionSequence *fReadMemberWiseVecPtr; ///<! List of read action resulting from the compilation for use in member wise streaming.
107 TStreamerInfoActions::TActionSequence *fReadText; ///<! List of text read action resulting from the compilation, used for JSON.
108 TStreamerInfoActions::TActionSequence *fWriteObjectWise; ///<! List of write action resulting from the compilation.
109 TStreamerInfoActions::TActionSequence *fWriteMemberWise; ///<! List of write action resulting from the compilation for use in member wise streaming.
110 TStreamerInfoActions::TActionSequence *fWriteMemberWiseVecPtr; ///<! List of write action resulting from the compilation for use in member wise streaming.
111 TStreamerInfoActions::TActionSequence *fWriteText; ///<! List of text write action resulting for the compilation, used for JSON.
112
113 static std::atomic<Int_t> fgCount; ///<Number of TStreamerInfo instances
114
115 template <typename T> static T GetTypedValueAux(Int_t type, void *ladd, int k, Int_t len);
116 static void PrintValueAux(char *ladd, Int_t atype, TStreamerElement * aElement, Int_t aleng, Int_t *count);
117
118 UInt_t GenerateIncludes(FILE *fp, char *inclist, const TList *extrainfos);
119 void GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subClasses, Bool_t top = kTRUE);
120 void InsertArtificialElements(std::vector<const ROOT::TSchemaRule*> &rules);
121 void DestructorImpl(void* p, Bool_t dtorOnly);
122
123private:
124 TStreamerInfo(const TStreamerInfo&) = delete; // TStreamerInfo are not copiable. Not Implemented.
125 TStreamerInfo& operator=(const TStreamerInfo&) = delete; // TStreamerInfo are not copiable. Not Implemented.
132
133public:
134
135 /// Status bits
136 /// See TVirtualStreamerInfo::EStatusBits for the values.
137
138 /// EReadWrite Enumerator
139 /// | Enum Constant | Description |
140 /// |-------------|--------------------|
141 /// | kBase | Base class element |
142 /// | kOffsetL | Fixed size array |
143 /// | kOffsetP | Pointer to object |
144 /// | kCounter | Counter for array size |
145 /// | kCharStar | Pointer to array of char |
146 /// | kLegacyChar | Equal to TDataType's kchar |
147 /// | kBits | TObject::fBits in case of a referenced object |
148 /// | kObject | Class derived from TObject, or for TStreamerSTL::fCtype non-pointer elements |
149 /// | kObjectp | Class* derived from TObject and with comment field //->Class, or for TStreamerSTL::fCtype: pointer elements |
150 /// | kObjectP | Class* derived from TObject and with NO comment field //->Class |
151 /// | kAny | Class not derived from TObject |
152 /// | kAnyp | Class* not derived from TObject with comment field //->Class |
153 /// | kAnyP | Class* not derived from TObject with NO comment field //->Class |
154 /// | kAnyPnoVT | Class* not derived from TObject with NO comment field //->Class and Class has NO virtual table |
155 /// | kSTLp | Pointer to STL container |
156 /// | kTString | TString, special case |
157 /// | kTObject | TObject, special case |
158 /// | kTNamed | TNamed , special case |
159 /// | kCache | Cache the value in memory than is not part of the object but is accessible via a SchemaRule |
161 kBase = 0, kOffsetL = 20, kOffsetP = 40, kCounter = 6, kCharStar = 7,
162 kChar = 1, kShort = 2, kInt = 3, kLong = 4, kFloat = 5,
164 kLegacyChar = 10, /// Equal to TDataType's kchar
165 kUChar = 11, kUShort = 12, kUInt = 13, kULong = 14, kBits = 15,
166 kLong64 = 16, kULong64 = 17, kBool = 18, kFloat16 = 19,
167 kObject = 61, kAny = 62, kObjectp = 63, kObjectP = 64, kTString = 65,
168 kTObject = 66, kTNamed = 67, kAnyp = 68, kAnyP = 69, kAnyPnoVT = 70,
169 kSTLp = 71,
170 kSkip = 100, kSkipL = 120, kSkipP = 140,
171 kConv = 200, kConvL = 220, kConvP = 240,
172 kSTL = 300, kSTLstring = 365,
173 kStreamer = 500, kStreamLoop = 501,
174 kCache = 600, /// Cache the value in memory than is not part of the object but is accessible via a SchemaRule
176 kCacheNew = 1001,
179 kMissing = 99999
180 };
181
184 virtual ~TStreamerInfo();
185 void Build(Bool_t isTransient = kFALSE) override;
186 void BuildCheck(TFile *file = nullptr, Bool_t load = kTRUE) override;
187 void BuildEmulated(TFile *file) override;
188 void BuildOld() override;
189 Bool_t BuildFor( const TClass *cl ) override;
190 void CallShowMembers(const void* obj, TMemberInspector &insp, Bool_t isTransient) const override;
191 void Clear(Option_t * = "") override;
192 TObject *Clone(const char *newname = "") const override;
193 Bool_t CompareContent(TClass *cl,TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file) override;
194 void Compile() override;
195 void ComputeSize();
196 void ForceWriteInfo(TFile *file, Bool_t force = kFALSE) override;
197 Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses = nullptr, const TList *extrainfos = nullptr) override;
198 TClass *GetActualClass(const void *obj) const override;
199 TClass *GetClass() const override { return fClass; }
200 UInt_t GetCheckSum() const override { return fCheckSum; }
202 Int_t GetClassVersion() const override { return fClassVersion; }
204 TObjArray *GetElements() const override {return fElements;}
205 TStreamerElement *GetElem(Int_t id) const override { return fComp[id].fElem; } // Return the element for the list of optimized elements (max GetNdata())
206 TStreamerElement *GetElement(Int_t id) const override {return (TStreamerElement*)fElements->At(id);} // Return the element for the complete list of elements (max GetElements()->GetEntries())
207 Int_t GetElementOffset(Int_t id) const override {return fCompFull[id]->fOffset;}
214 Int_t GetNdata() const {return fNdata;}
216 Int_t GetNumber() const override { return fNumber; }
217 Int_t GetLength(Int_t id) const {return fComp[id].fLength;}
219 Int_t GetNewType(Int_t id) const {return fComp[id].fNewType;}
220 Int_t GetOffset(const char *) const override;
221 Int_t GetOffset(Int_t id) const override {return fComp[id].fOffset;}
222 Version_t GetOldVersion() const override {return fOldVersion;}
224 Int_t GetSize() const override;
225 Int_t GetSizeElements() const;
226 TStreamerElement *GetStreamerElement(const char*datamember, Int_t& offset) const override;
228 Int_t GetType(Int_t id) const {return fComp[id].fType;}
229 template <typename T> T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const;
230 template <typename T> T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const;
231 template <typename T> T GetTypedValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const;
232 template <typename T> T GetTypedValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const;
233 Double_t GetValue(char *pointer, Int_t i, Int_t j, Int_t len) const { return GetTypedValue<Double_t>(pointer, i, j, len); }
234 Double_t GetValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const { return GetTypedValueClones<Double_t>(clones, i, j, k, eoffset); }
235 Double_t GetValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const { return GetTypedValueSTL<Double_t>(cont, i, j, k, eoffset); }
236 Double_t GetValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const { return GetTypedValueSTLP<Double_t>(cont, i, j, k, eoffset); }
237 void ls(Option_t *option="") const override;
238 Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
239 TVirtualStreamerInfo *NewInfo(TClass *cl) override { return new TStreamerInfo(cl); }
240 void *New(void *obj = nullptr) override;
241 void *NewArray(Long_t nElements, void* ary = nullptr) override;
242 void Destructor(void* p, Bool_t dtorOnly = kFALSE) override;
243 void DeleteArray(void* p, Bool_t dtorOnly = kFALSE) override;
244 void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax=1000) const;
245 void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax=1000) const;
246 void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax=1000) const;
247
248 template <class T>
249 Int_t ReadBuffer(TBuffer &b, const T &arrptr, TCompInfo *const*const compinfo, Int_t first, Int_t last, Int_t narr=1,Int_t eoffset=0,Int_t mode=0);
250 template <class T>
251 Int_t ReadBufferSkip(TBuffer &b, const T &arrptr, const TCompInfo *compinfo,Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset);
252 template <class T>
253 Int_t ReadBufferConv(TBuffer &b, const T &arrptr, const TCompInfo *compinfo,Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset);
254 template <class T>
255 Int_t ReadBufferArtificial(TBuffer &b, const T &arrptr, TStreamerElement *aElement, Int_t narr, Int_t eoffset);
256
259 void SetCheckSum(UInt_t checksum) override { fCheckSum = checksum; }
260 void SetClass(TClass *cl) override;
261 void SetClassVersion(Int_t vers) override { fClassVersion = vers; }
263 void TagFile(TFile *fFile) override;
264private:
265 // Try to remove those functions from the public interface.
266 Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first);
270public:
271 void Update(const TClass *oldClass, TClass *newClass) override;
272
273 /// \brief Generate the TClass and TStreamerInfo for the requested pair.
274 /// This creates a TVirtualStreamerInfo for the pair and trigger the BuildCheck/Old to
275 /// provokes the creation of the corresponding TClass. This relies on the dictionary for
276 /// std::pair<const int, int> to already exist (or the interpreter information being available)
277 /// as it is used as a template.
278 /// \note The returned object is owned by the caller.
279 TVirtualStreamerInfo *GenerateInfoForPair(const std::string &pairclassname, bool silent, size_t hint_pair_offset, size_t hint_pair_size) override;
280 TVirtualStreamerInfo *GenerateInfoForPair(const std::string &firstname, const std::string &secondname, bool silent, size_t hint_pair_offset, size_t hint_pair_size) override;
281
282 TVirtualCollectionProxy *GenEmulatedProxy(const char* class_name, Bool_t silent) override;
283 TClassStreamer *GenEmulatedClassStreamer(const char* class_name, Bool_t silent) override;
284 TVirtualCollectionProxy *GenExplicitProxy(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) override;
285 TClassStreamer *GenExplicitClassStreamer(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) override;
286
288
289public:
290 // For access by the StreamerInfoActions.
291 template <class T>
292 Int_t WriteBufferAux (TBuffer &b, const T &arr, TCompInfo *const*const compinfo, Int_t first, Int_t last, Int_t narr,Int_t eoffset,Int_t mode);
293
294 //WARNING this class version must be the same as TVirtualStreamerInfo
295 ClassDefOverride(TStreamerInfo,9) //Streamer information for one class version
296};
297
298
299#endif
bool Bool_t
Definition: RtypesCore.h:63
int Int_t
Definition: RtypesCore.h:45
short Version_t
Definition: RtypesCore.h:65
unsigned long ULongptr_t
Definition: RtypesCore.h:83
const Bool_t kFALSE
Definition: RtypesCore.h:101
long Long_t
Definition: RtypesCore.h:54
unsigned int UInt_t
Definition: RtypesCore.h:46
const Bool_t kTRUE
Definition: RtypesCore.h:100
unsigned long ULong_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition: TGX11.cxx:110
Buffer base class used for serializing objects.
Definition: TBuffer.h:43
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:81
ECheckSum
Definition: TClass.h:109
An array of clone (identical) objects.
Definition: TClonesArray.h:29
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
A doubly linked list.
Definition: TList.h:38
Abstract base class for accessing the data-members of a class.
An array of TObjects.
Definition: TObjArray.h:31
Int_t GetEntriesFast() const
Definition: TObjArray.h:58
TObject * At(Int_t idx) const override
Definition: TObjArray.h:164
Mother of all ROOT objects.
Definition: TObject.h:37
void Update(const TClass *oldcl, TClass *newcl)
Update the TClass pointer cached in this object.
TClass * fClass
Not Owned.
Definition: TStreamerInfo.h:53
TMemberStreamer * fStreamer
Not Owned.
Definition: TStreamerInfo.h:56
TStreamerElement * fElem
Not Owned.
Definition: TStreamerInfo.h:51
TClass * fNewClass
Not Owned.
Definition: TStreamerInfo.h:54
char * operator[](UInt_t idx) const
Definition: TStreamerInfo.h:78
TVirtualCollectionProxy * fProxy
Definition: TStreamerInfo.h:84
TPointerCollectionAdapter(TVirtualCollectionProxy *proxy)
Definition: TStreamerInfo.h:75
Describes a persistent version of a class.
Definition: TStreamerInfo.h:39
Int_t fNVirtualInfoLoc
! Number of virtual info location to update.
Int_t fOnFileClassVersion
!Class version identifier as stored on file.
Definition: TStreamerInfo.h:90
Int_t GetSize() const override
Return total size of all persistent elements of the class (with offsets).
Int_t GetClassVersion() const override
void Destructor(void *p, Bool_t dtorOnly=kFALSE) override
Emulated destructor for this class.
Int_t ReadBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t eoffset, Bool_t v7=kTRUE)
The STL vector/list is deserialized from the buffer b.
void AddWriteAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
TVirtualStreamerInfo * GenerateInfoForPair(const std::string &pairclassname, bool silent, size_t hint_pair_offset, size_t hint_pair_size) override
Generate the TClass and TStreamerInfo for the requested pair.
TClassStreamer * GenExplicitClassStreamer(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) override
Generate class streamer from static functions.
TVirtualCollectionProxy * GenEmulatedProxy(const char *class_name, Bool_t silent) override
Generate emulated collection proxy for a given class.
Int_t fNfulldata
!number of elements
Definition: TStreamerInfo.h:94
TStreamerElement * GetElement(Int_t id) const override
TCompInfo * fComp
![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
Definition: TStreamerInfo.h:96
TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions(Bool_t forCollection)
TVirtualCollectionProxy * GenExplicitProxy(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) override
Generate proxy from static functions.
Int_t WriteBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc)
Write for STL container. ('first' is an id between -1 and fNfulldata).
T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const
Return value of element i in object at pointer.
TStreamerInfoActions::TActionSequence * fWriteMemberWiseVecPtr
! List of write action resulting from the compilation for use in member wise streaming.
TClassStreamer * GenEmulatedClassStreamer(const char *class_name, Bool_t silent) override
Generate emulated class streamer for a given collection class.
Double_t GetValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses=nullptr, const TList *extrainfos=nullptr) override
Generate header file for the class described by this TStreamerInfo the function is called by TFile::M...
TStreamerInfoActions::TActionSequence * fReadText
! List of text read action resulting from the compilation, used for JSON.
Int_t GetNumber() const override
Double_t GetValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
void ls(Option_t *option="") const override
List the TStreamerElement list and also the precomputed tables if option contains the string "incOrig...
void AddReadTextAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read text action for the given element.
TCompInfo ** fCompFull
![fElements->GetEntries()]
Definition: TStreamerInfo.h:98
Int_t GetNelement() const
Int_t ReadBuffer(TBuffer &b, const T &arrptr, TCompInfo *const *const compinfo, Int_t first, Int_t last, Int_t narr=1, Int_t eoffset=0, Int_t mode=0)
Deserialize information from buffer b into object at pointer if (arrayMode & 1) ptr is a pointer to a...
TObjArray * fElements
Array of TStreamerElements.
void InsertArtificialElements(std::vector< const ROOT::TSchemaRule * > &rules)
Insert new members as expressed in the array of TSchemaRule(s).
Int_t GetOnFileClassVersion() const override
Int_t GetOffset(const char *) const override
Return the offset of the data member as indicated by this StreamerInfo.
TStreamerInfo & operator=(const TStreamerInfo &)=delete
void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax=1000) const
print value of element i in object at pointer The function may be called in two ways: -method1 len < ...
Int_t GetDataMemberOffset(TDataMember *dm, TMemberStreamer *&streamer) const
Compute data member offset.
@ kArtificial
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
@ kNeedObjectForVirtualBaseClass
@ kUChar
Equal to TDataType's kchar.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
T GetTypedValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a TClonesArray and eventually element k in a sub-arra...
void AddReadMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
T GetTypedValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a TClonesArray and eventually element k in a sub-arra...
void BuildEmulated(TFile *file) override
Create an Emulation TStreamerInfo object.
void DeleteArray(void *p, Bool_t dtorOnly=kFALSE) override
Destroy an array of emulated objects, with optional delete.
TVirtualStreamerInfo * NewInfo(TClass *cl) override
Bool_t BuildFor(const TClass *cl) override
Check if we can build this for foreign class - do we have some rules to do that.
void Build(Bool_t isTransient=kFALSE) override
Build the I/O data structure for the current class version.
void BuildOld() override
rebuild the TStreamerInfo structure
TStreamerInfoActions::TActionSequence * fReadMemberWise
! List of read action resulting from the compilation for use in member wise streaming.
TStreamerInfoActions::TActionSequence * GetReadObjectWiseActions()
Version_t GetOldVersion() const override
Int_t GetType(Int_t id) const
Int_t ReadBufferConv(TBuffer &b, const T &arrptr, const TCompInfo *compinfo, Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Convert elements of a TClonesArray.
TStreamerElement * GetElem(Int_t id) const override
Int_t fClassVersion
Class version identifier.
Definition: TStreamerInfo.h:89
Int_t fNdata
!number of optimized elements
Definition: TStreamerInfo.h:93
void * New(void *obj=nullptr) override
An emulated object is created at address obj, if obj is null we allocate memory for the object.
TStreamerInfo()
Default ctor.
TStreamerInfoActions::TActionSequence * fReadMemberWiseVecPtr
! List of read action resulting from the compilation for use in member wise streaming.
TStreamerInfoActions::TActionSequence * fReadObjectWise
! List of read action resulting from the compilation.
Int_t GetElementOffset(Int_t id) const override
Int_t GetLength(Int_t id) const
TStreamerInfo(const TStreamerInfo &)=delete
TClass * GetActualClass(const void *obj) const override
Assuming that obj points to (the part of) an object that is of the type described by this streamerInf...
Int_t ReadBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Read for TClonesArray.
TStreamerElement * GetStreamerElementReal(Int_t i, Int_t j) const
Obsolete: this routine is obsolete and should not longer be used.
TClass * fClass
!pointer to class
Definition: TStreamerInfo.h:99
Bool_t MatchLegacyCheckSum(UInt_t checksum) const
Return true if the checksum passed as argument is one of the checksum value produced by the older che...
TCompInfo ** fCompOpt
![fNdata]
Definition: TStreamerInfo.h:97
void SetClassVersion(Int_t vers) override
void TagFile(TFile *fFile) override
Mark the classindex of the current file as using this TStreamerInfo.
TStreamerInfoActions::TActionSequence * GetReadTextActions()
Int_t GetNewType(Int_t id) const
Int_t GetOffset(Int_t id) const override
void SetClass(TClass *cl) override
Replace the TClass this streamerInfo is pointing to (belongs to)
UInt_t fCheckSum
Checksum of original class.
Definition: TStreamerInfo.h:88
Int_t GetSizeElements() const
Return total size of all persistent elements of the class use GetSize if you want to get the real siz...
TClass * GetClass() const override
static std::atomic< Int_t > fgCount
Number of TStreamerInfo instances.
void AddWriteTextAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
TStreamerInfoActions::TActionSequence * GetWriteTextActions()
static TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement fgElement points to the current T...
T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
UInt_t GenerateIncludes(FILE *fp, char *inclist, const TList *extrainfos)
Add to the header file, the #include need for this class.
void ComputeSize()
Compute total size of all persistent elements of the class.
void AddReadAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
void AddWriteMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
This is for streaming via a TClonesArray (or a vector of pointers of this type).
Int_t fNumber
!Unique identifier
Definition: TStreamerInfo.h:91
void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first)
General Write.
TStreamerInfoActions::TActionSequence * fWriteObjectWise
! List of write action resulting from the compilation.
Int_t ReadBufferArtificial(TBuffer &b, const T &arrptr, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Handle Artificial StreamerElement.
void CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient) const override
Emulated a call ShowMembers() on the obj of this class type, passing insp and parent.
void SetOnFileClassVersion(Int_t vers)
void Clear(Option_t *="") override
If opt contains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (usef...
void SetCheckSum(UInt_t checksum) override
TObjArray * GetElements() const override
Int_t fSize
!size of the persistent class
Definition: TStreamerInfo.h:92
static T GetTypedValueAux(Int_t type, void *ladd, int k, Int_t len)
Get the value from inside a collection.
void GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subClasses, Bool_t top=kTRUE)
Write the Declaration of class.
static void PrintValueAux(char *ladd, Int_t atype, TStreamerElement *aElement, Int_t aleng, Int_t *count)
print value of element in object at pointer, type atype, leng aleng or *count The function may be cal...
ULongptr_t GetMethod(Int_t id) const
void * NewArray(Long_t nElements, void *ary=nullptr) override
An array of emulated objects is created at address ary, if ary is null, we allocate memory for the ar...
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const override
Return the StreamerElement of "datamember" inside our class or any of its base classes.
UInt_t GetCheckSum() const override
void Compile() override
loop on the TStreamerElement list regroup members with same type Store predigested information into l...
Int_t WriteBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Write for ClonesArray ('first' is an id between -1 and fNfulldata).
void BuildCheck(TFile *file=nullptr, Bool_t load=kTRUE) override
Check if built and consistent with the class dictionary.
TStreamerInfoActions::TActionSequence * GetWriteObjectWiseActions()
Bool_t CompareContent(TClass *cl, TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file) override
Return True if the current StreamerInfo in cl or info is equivalent to this TStreamerInfo.
Int_t ReadBufferSkip(TBuffer &b, const T &arrptr, const TCompInfo *compinfo, Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Skip an element.
TStreamerInfoActions::TActionSequence * fWriteMemberWise
! List of write action resulting from the compilation for use in member wise streaming.
Int_t fNslots
!total number of slots in fComp.
Definition: TStreamerInfo.h:95
Int_t WriteBufferAux(TBuffer &b, const T &arr, TCompInfo *const *const compinfo, Int_t first, Int_t last, Int_t narr, Int_t eoffset, Int_t mode)
The object at pointer is serialized to the buffer b if (arrayMode & 1) ptr is a pointer to array of p...
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE) override
Recursively mark streamer infos for writing to a file.
Version_t fOldVersion
! Version of the TStreamerInfo object read from the file
void DestructorImpl(void *p, Bool_t dtorOnly)
Internal part of the destructor.
virtual ~TStreamerInfo()
TStreamerInfo dtor.
Int_t GetNdata() const
TCompInfo TCompInfo_t
Definition: TStreamerInfo.h:66
TStreamerInfoActions::TActionSequence * fWriteText
! List of text write action resulting for the compilation, used for JSON.
Int_t WriteBufferSTLPtrs(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t first, Int_t eoffset)
Write for STL container.
ULong_t * fVirtualInfoLoc
![fNVirtualInfoLoc] Location of the pointer to the TStreamerInfo inside the object (when emulated)
void Update(const TClass *oldClass, TClass *newClass) override
function called by the TClass constructor when replacing an emulated class by the real class
TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Bool_t forCollection)
void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
Double_t GetValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Double_t GetValue(char *pointer, Int_t i, Int_t j, Int_t len) const
Basic string class.
Definition: TString.h:136
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Definition: TVirtualArray.h:27
virtual void * At(UInt_t idx)=0
Abstract Interface class describing Streamer information for one class.
double T(double x)
Definition: ChebyshevPol.h:34
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Definition: file.py:1
Definition: first.py:1