ROOT  6.06/09
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 
17 #ifndef ROOT_TVirtualStreamerInfo
18 #include "TVirtualStreamerInfo.h"
19 #endif
20 
21 #ifndef ROOT_ThreadLocalStorage
22 #include "ThreadLocalStorage.h"
23 #endif
24 
26 
27 /**
28 \class TStreamerInfo
29 \ingroup IO
30 Describe Streamer information for one class version
31 */
32 
33 class TFile;
34 class TClass;
35 class TClonesArray;
36 class TDataMember;
37 class TMemberStreamer;
38 class TStreamerElement;
39 class TStreamerBasicType;
40 class TClassStreamer;
41 class TVirtualArray;
42 namespace ROOT { namespace Detail { class TCollectionProxyInfo; } }
43 namespace ROOT { class TSchemaRule; }
44 
45 namespace TStreamerInfoActions { class TActionSequence; }
46 
48 
49  class TCompInfo {
50  // Class used to cache information (see fComp)
51  private:
52  // TCompInfo(const TCompInfo&) = default;
53  // TCompInfo& operator=(const TCompInfo&) = default;
54  public:
59  TStreamerElement *fElem; ///< Not Owned
61  TClass *fClass; ///< Not Owned
62  TClass *fNewClass; ///< Not Owned
64  TMemberStreamer *fStreamer; ///< Not Owned
65  TCompInfo() : fType(-1), fNewType(0), fOffset(0), fLength(0), fElem(0), fMethod(0),
66  fClass(0), fNewClass(0), fClassName(), fStreamer(0) {};
67  ~TCompInfo() {};
68  void Update(const TClass *oldcl, TClass *newcl);
69  };
71 
72 public:
73  // make the opaque pointer public.
75 
76 protected:
77  //---------------------------------------------------------------------------
78  // Adapter class used to handle streaming collection of pointers
79  //---------------------------------------------------------------------------
81  {
82  public:
84  fProxy( proxy ) {}
85 
86  char* operator[]( UInt_t idx ) const
87  {
88  char **el = (char**)fProxy->At(idx);
89  return *el;
90  }
91  private:
93  };
94 
95 private:
96  UInt_t fCheckSum; ///<Checksum of original class
97  Int_t fClassVersion; ///<Class version identifier
98  Int_t fOnFileClassVersion;///<!Class version identifier as stored on file.
99  Int_t fNumber; ///<!Unique identifier
100  Int_t fSize; ///<!size of the persistent class
101  Int_t fNdata; ///<!number of optimized elements
102  Int_t fNfulldata; ///<!number of elements
103  Int_t fNslots; ///<!total numbrer of slots in fComp.
104  TCompInfo *fComp; ///<![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
105  TCompInfo **fCompOpt; ///<![fNdata]
106  TCompInfo **fCompFull; ///<![fElements->GetEntries()]
107  TClass *fClass; ///<!pointer to class
108  TObjArray *fElements; ///<Array of TStreamerElements
109  Version_t fOldVersion; ///<! Version of the TStreamerInfo object read from the file
110  Int_t fNVirtualInfoLoc; ///<! Number of virtual info location to update.
111  ULong_t *fVirtualInfoLoc; ///<![fNVirtualInfoLoc] Location of the pointer to the TStreamerInfo inside the object (when emulated)
112  std::atomic<ULong_t> fLiveCount; ///<! Number of outstanding pointer to this StreamerInfo.
113  TStreamerInfoActions::TActionSequence *fReadObjectWise; ///<! List of read action resulting from the compilation.
114  TStreamerInfoActions::TActionSequence *fReadMemberWise; ///<! List of read action resulting from the compilation for use in member wise streaming.
115  TStreamerInfoActions::TActionSequence *fReadMemberWiseVecPtr; ///<! List of read action resulting from the compilation for use in member wise streaming.
116  TStreamerInfoActions::TActionSequence *fWriteObjectWise; ///<! List of write action resulting from the compilation.
117  TStreamerInfoActions::TActionSequence *fWriteMemberWise; ///<! List of write action resulting from the compilation for use in member wise streaming.
118  TStreamerInfoActions::TActionSequence *fWriteMemberWiseVecPtr; ///<! List of write action resulting from the compilation for use in member wise streaming.
119 
120  static std::atomic<Int_t> fgCount; ///<Number of TStreamerInfo instances
121 
122  template <typename T> static T GetTypedValueAux(Int_t type, void *ladd, int k, Int_t len);
123  static void PrintValueAux(char *ladd, Int_t atype, TStreamerElement * aElement, Int_t aleng, Int_t *count);
124 
125  UInt_t GenerateIncludes(FILE *fp, char *inclist, const TList *extrainfos);
126  void GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subClasses, Bool_t top = kTRUE);
127  void InsertArtificialElements(std::vector<const ROOT::TSchemaRule*> &rules);
128  void DestructorImpl(void* p, Bool_t dtorOnly);
129 
130 private:
131  TStreamerInfo(const TStreamerInfo&); // TStreamerInfo are copiable. Not Implemented.
132  TStreamerInfo& operator=(const TStreamerInfo&); // TStreamerInfo are copiable. Not Implemented.
133  void AddReadAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo);
134  void AddWriteAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo);
137 
138 public:
139 
140  /// Status bits
141  enum { kCannotOptimize = BIT(12),
142  kIgnoreTObjectStreamer = BIT(13), ///< Eventhough BIT(13) is taken up by TObject (to preserverse forward compatibility)
147  };
148 
149 /// EReadWrite Enumerator
150 /// | Enum Constant | Description |
151 /// |----------|--------------------|
152 /// | kBase | Base class element |
153 /// | kOffsetL | Fixed size array |
154 /// | kOffsetP | Pointer to object |
155 /// | kCounter | Counter for array size |
156 /// | kCharStar| Pointer to array of char |
157 /// | kLegacyChar | Equal to TDataType's kchar |
158 /// | kBits | TObject::fBits in case of a referenced object |
159 /// | kObject | Class derived from TObject |
160 /// | kObjectp | Class* derived from TObject and with comment field //->Class |
161 /// | kObjectP | Class* derived from TObject and with NO comment field //->Class |
162 /// | kAny | Class not derived from TObject |
163 /// | kAnyp | Class* not derived from TObject with comment field //->Class |
164 /// | kAnyP | Class* not derived from TObject with NO comment field //->Class |
165 /// | kAnyPnoVT | Class* not derived from TObject with NO comment field //->Class and Class has NO virtual table |
166 /// | kSTLp | Pointer to STL container |
167 /// | kTString | TString, special case |
168 /// | kTObject | TObject, special case |
169 /// | kTNamed | TNamed , special case |
170 /// | kCache | Cache the value in memory than is not part of the object but is accessible via a SchemaRule |
171  enum EReadWrite {
172  kBase = 0, kOffsetL = 20, kOffsetP = 40, kCounter = 6, kCharStar = 7,
173  kChar = 1, kShort = 2, kInt = 3, kLong = 4, kFloat = 5,
175  kLegacyChar = 10, /// Equal to TDataType's kchar
176  kUChar = 11, kUShort = 12, kUInt = 13, kULong = 14, kBits = 15,
177  kLong64 = 16, kULong64 = 17, kBool = 18, kFloat16 = 19,
178  kObject = 61, kAny = 62, kObjectp = 63, kObjectP = 64, kTString = 65,
179  kTObject = 66, kTNamed = 67, kAnyp = 68, kAnyP = 69, kAnyPnoVT = 70,
180  kSTLp = 71,
181  kSkip = 100, kSkipL = 120, kSkipP = 140,
182  kConv = 200, kConvL = 220, kConvP = 240,
183  kSTL = 300, kSTLstring = 365,
184  kStreamer = 500, kStreamLoop = 501,
185  kCache = 600, /// Cache the value in memory than is not part of the object but is accessible via a SchemaRule
186  kArtificial = 1000,
187  kCacheNew = 1001,
188  kCacheDelete = 1002,
190  kMissing = 99999
191  };
192 
193  TStreamerInfo();
194  TStreamerInfo(TClass *cl);
195  virtual ~TStreamerInfo();
196  void Build();
197  void BuildCheck(TFile *file = 0);
198  void BuildEmulated(TFile *file);
199  void BuildOld();
200  virtual Bool_t BuildFor( const TClass *cl );
201  void CallShowMembers(const void* obj, TMemberInspector &insp, Bool_t isTransient) const;
202  void Clear(Option_t *);
203  TObject *Clone(const char *newname = "") const;
204  Bool_t CompareContent(TClass *cl,TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file);
205  void Compile();
206  void ComputeSize();
207  void ForceWriteInfo(TFile *file, Bool_t force=kFALSE);
208  Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses = 0, const TList *extrainfos = 0);
209  TClass *GetActualClass(const void *obj) const;
210  TClass *GetClass() const {return fClass;}
211  UInt_t GetCheckSum() const {return fCheckSum;}
214  Int_t GetDataMemberOffset(TDataMember *dm, TMemberStreamer *&streamer) const;
215  TObjArray *GetElements() const {return fElements;}
216  TStreamerElement *GetElem(Int_t id) const {return fComp[id].fElem;} // Return the element for the list of optimized elements (max GetNdata())
217  TStreamerElement *GetElement(Int_t id) const {return (TStreamerElement*)fElements->At(id);} // Return the element for the complete list of elements (max GetElements()->GetEntries())
218  Int_t GetElementOffset(Int_t id) const {return fCompFull[id]->fOffset;}
219  TStreamerInfoActions::TActionSequence *GetReadMemberWiseActions(Bool_t forCollection) { return forCollection ? fReadMemberWiseVecPtr : fReadMemberWise; }
221  TStreamerInfoActions::TActionSequence *GetWriteMemberWiseActions(Bool_t forCollection) { return forCollection ? fWriteMemberWiseVecPtr : fWriteMemberWise; }
223  Int_t GetNdata() const {return fNdata;}
224  Int_t GetNelement() const { return fElements->GetEntries(); }
225  Int_t GetNumber() const {return fNumber;}
226  Int_t GetLength(Int_t id) const {return fComp[id].fLength;}
227  ULong_t GetMethod(Int_t id) const {return fComp[id].fMethod;}
228  Int_t GetNewType(Int_t id) const {return fComp[id].fNewType;}
229  Int_t GetOffset(const char *) const;
230  Int_t GetOffset(Int_t id) const {return fComp[id].fOffset;}
233  Int_t GetSize() const;
234  Int_t GetSizeElements() const;
235  TStreamerElement *GetStreamerElement(const char*datamember, Int_t& offset) const;
237  Int_t GetType(Int_t id) const {return fComp[id].fType;}
238  template <typename T> T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const;
239  template <typename T> T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const;
240  template <typename T> T GetTypedValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const;
241  template <typename T> T GetTypedValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const;
242  Double_t GetValue(char *pointer, Int_t i, Int_t j, Int_t len) const { return GetTypedValue<Double_t>(pointer, i, j, len); }
243  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); }
244  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); }
245  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); }
246  void ls(Option_t *option="") const;
247  Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
249  void *New(void *obj = 0);
250  void *NewArray(Long_t nElements, void* ary = 0);
251  void Destructor(void* p, Bool_t dtorOnly = kFALSE);
252  void DeleteArray(void* p, Bool_t dtorOnly = kFALSE);
253  void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax=1000) const;
254  void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax=1000) const;
255  void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax=1000) const;
256 
257  template <class T>
258  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);
259  template <class T>
260  Int_t ReadBufferSkip(TBuffer &b, const T &arrptr, const TCompInfo *compinfo,Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset);
261  template <class T>
262  Int_t ReadBufferConv(TBuffer &b, const T &arrptr, const TCompInfo *compinfo,Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset);
263  template <class T>
264  Int_t ReadBufferArtificial(TBuffer &b, const T &arrptr, TStreamerElement *aElement, Int_t narr, Int_t eoffset);
265 
266  Int_t ReadBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset);
267  Int_t ReadBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t eoffset, Bool_t v7 = kTRUE );
268  void SetCheckSum(UInt_t checksum) {fCheckSum = checksum;}
269  void SetClass(TClass *cl) {fClass = cl;}
270  void SetClassVersion(Int_t vers) {fClassVersion=vers;}
271  void SetOnFileClassVersion(Int_t vers) {fOnFileClassVersion=vers;}
272  void TagFile(TFile *fFile);
273 private:
274  // Try to remove those functions from the public interface.
275  Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first);
276  Int_t WriteBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset);
278  Int_t WriteBufferSTLPtrs( TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t first, Int_t eoffset);
279 public:
280  virtual void Update(const TClass *oldClass, TClass *newClass);
281 
282  virtual TVirtualCollectionProxy *GenEmulatedProxy(const char* class_name, Bool_t silent);
283  virtual TClassStreamer *GenEmulatedClassStreamer(const char* class_name, Bool_t silent);
284  virtual TVirtualCollectionProxy *GenExplicitProxy( const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl );
285  virtual TClassStreamer *GenExplicitClassStreamer( const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl );
286 
288 
289 public:
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  ClassDef(TStreamerInfo,9) //Streamer information for one class version
296 };
297 
298 
299 #endif
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:47
TStreamerInfoActions::TActionSequence * GetWriteObjectWiseActions()
Int_t fClassVersion
Class version identifier.
Definition: TStreamerInfo.h:97
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.
static std::atomic< Int_t > fgCount
Number of TStreamerInfo instances.
Double_t GetValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
An array of TObjects.
Definition: TObjArray.h:39
TClass * fNewClass
Not Owned.
Definition: TStreamerInfo.h:62
Int_t GetNelement() const
Version_t fOldVersion
! Version of the TStreamerInfo object read from the file
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.
T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const
Return value of element i in object at pointer.
void SetCheckSum(UInt_t checksum)
void AddReadMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
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...
void BuildEmulated(TFile *file)
Create an Emulation TStreamerInfo object.
TStreamerInfoActions::TActionSequence * fWriteMemberWiseVecPtr
! List of write action resulting from the compilation for use in member wise streaming.
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
short Version_t
Definition: RtypesCore.h:61
void AddReadAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
Equal to TDataType's kchar.
const char Option_t
Definition: RtypesCore.h:62
Double_t GetValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Int_t GetOffset(Int_t id) const
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:33
double T(double x)
Definition: ChebyshevPol.h:34
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...
#define BIT(n)
Definition: Rtypes.h:120
TStreamerInfo & operator=(const TStreamerInfo &)
void Update(const TClass *oldcl, TClass *newcl)
Update the TClass pointer cached in this object.
void InsertArtificialElements(std::vector< const ROOT::TSchemaRule * > &rules)
Insert new members as expressed in the array of TSchemaRule(s).
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
Eventhough BIT(13) is taken up by TObject (to preserverse forward compatibility)
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)
Recursively mark streamer infos for writing to a file.
void AddWriteAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
void * New(void *obj=0)
An emulated object is created at address obj, if obj is null we allocate memory for the object...
Basic string class.
Definition: TString.h:137
void DestructorImpl(void *p, Bool_t dtorOnly)
Internal part of the destructor.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses=0, const TList *extrainfos=0)
Generate header file for the class described by this TStreamerInfo the function is called by TFile::M...
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
Int_t fNdata
!number of optimized elements
ULong_t * fVirtualInfoLoc
![fNVirtualInfoLoc] Location of the pointer to the TStreamerInfo inside the object (when emulated) ...
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).
Abstract base class for accessing the data-members of a class.
Int_t GetType(Int_t id) const
Double_t GetValue(char *pointer, Int_t i, Int_t j, Int_t len) const
void Destructor(void *p, Bool_t dtorOnly=kFALSE)
Emulated destructor for this class.
void DeleteArray(void *p, Bool_t dtorOnly=kFALSE)
Destroy an array of emulated objects, with optional delete.
TCompInfo ** fCompFull
![fElements->GetEntries()]
TClass * GetActualClass(const void *obj) const
Assuming that obj points to (the part of) an object that is of the type described by this streamerInf...
void ComputeSize()
Compute total size of all persistent elements of the class.
Int_t GetElementOffset(Int_t id) const
TStreamerInfoActions::TActionSequence * fReadMemberWise
! List of read action resulting from the compilation for use in member wise streaming.
Int_t fSize
!size of the persistent class
TVirtualStreamerInfo * NewInfo(TClass *cl)
Int_t WriteBufferSTLPtrs(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t first, Int_t eoffset)
Write for STL container.
virtual TVirtualCollectionProxy * GenEmulatedProxy(const char *class_name, Bool_t silent)
Generate emulated collection proxy for a given class.
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual TClassStreamer * GenEmulatedClassStreamer(const char *class_name, Bool_t silent)
Generate emulated class streamer for a given collection class.
virtual TVirtualCollectionProxy * GenExplicitProxy(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl)
Generate proxy from static functions.
ECheckSum
Definition: TClass.h:102
Int_t GetOnFileClassVersion() const
Int_t ReadBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Read for TClonesArray.
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...
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).
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...
TMemberStreamer * fStreamer
Not Owned.
Definition: TStreamerInfo.h:64
Version_t GetOldVersion() const
Int_t fNfulldata
!number of elements
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...
TStreamerInfoActions::TActionSequence * fReadObjectWise
! List of read action resulting from the compilation.
void SetOnFileClassVersion(Int_t vers)
virtual TClassStreamer * GenExplicitClassStreamer(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl)
Generate class streamer from static functions.
void SetClass(TClass *cl)
TClass * GetClass() const
XFontStruct * id
Definition: TGX11.cxx:108
UInt_t fCheckSum
Checksum of original class.
Definition: TStreamerInfo.h:96
TCompInfo TCompInfo_t
Definition: TStreamerInfo.h:74
void GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subClasses, Bool_t top=kTRUE)
Write the Declaration of class.
Int_t GetClassVersion() const
static T GetTypedValueAux(Int_t type, void *ladd, int k, Int_t len)
Get the value from inside a collection.
A doubly linked list.
Definition: TList.h:47
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 < ...
virtual void Update(const TClass *oldClass, TClass *newClass)
function called by the TClass constructor when replacing an emulated class by the real class ...
Int_t GetLength(Int_t id) const
TClass * fClass
!pointer to class
Int_t GetOffset(const char *) const
Return the offset of the data member as indicated by this StreamerInfo.
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.
TObjArray * fElements
Array of TStreamerElements.
UInt_t GenerateIncludes(FILE *fp, char *inclist, const TList *extrainfos)
Add to the header file, the #include need for this class.
TVirtualCollectionProxy * fProxy
Definition: TStreamerInfo.h:92
TStreamerElement * GetElem(Int_t id) const
void ls(Option_t *option="") const
List the TStreamerElement list and also the precomputed tables if option contains the string "incOrig...
TObjArray * GetElements() const
void BuildOld()
rebuild the TStreamerInfo structure
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Definition: TVirtualArray.h:26
void Clear(Option_t *)
If opt cointains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (use...
TPointerCollectionAdapter(TVirtualCollectionProxy *proxy)
Definition: TStreamerInfo.h:83
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...
Int_t fOnFileClassVersion
!Class version identifier as stored on file.
Definition: TStreamerInfo.h:98
UInt_t GetCheckSum() const
Int_t ReadBufferArtificial(TBuffer &b, const T &arrptr, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Handle Artificial StreamerElement.
virtual Bool_t BuildFor(const TClass *cl)
Check if we can build this for foreign class - do we have some rules to do that.
unsigned int UInt_t
Definition: RtypesCore.h:42
Int_t GetDataMemberOffset(TDataMember *dm, TMemberStreamer *&streamer) const
Compute data member offset.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Bool_t forCollection)
TClass * fClass
Not Owned.
Definition: TStreamerInfo.h:61
void SetClassVersion(Int_t vers)
Int_t GetNumber() const
TCompInfo * fComp
![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
TStreamerInfoActions::TActionSequence * fWriteMemberWise
! List of write action resulting from the compilation for use in member wise streaming.
TStreamerElement * fElem
Not Owned.
Definition: TStreamerInfo.h:59
long Long_t
Definition: RtypesCore.h:50
Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first)
General Write.
Int_t WriteBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc)
Write for STL container. ('first' is an id between -1 and fNfulldata).
void CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient) const
Emulated a call ShowMembers() on the obj of this class type, passing insp and parent.
Int_t GetNdata() const
TStreamerElement * GetStreamerElementReal(Int_t i, Int_t j) const
Obsolete: this routine is obsolete and should not longer be used.
void Build()
Build the I/O data structure for the current class version.
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const
Return the StreamerElement of "datamember" inside our class or any of its base classes.
T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Int_t GetSizeElements() const
Return total size of all persistent elements of the class use GetSize if you want to get the real siz...
double Double_t
Definition: RtypesCore.h:55
Int_t fNslots
!total numbrer of slots in fComp.
TStreamerInfoActions::TActionSequence * fReadMemberWiseVecPtr
! List of read action resulting from the compilation for use in member wise streaming.
TStreamerInfoActions::TActionSequence * fWriteObjectWise
! List of write action resulting from the compilation.
int type
Definition: TGX11.cxx:120
Int_t GetNewType(Int_t id) const
unsigned long ULong_t
Definition: RtypesCore.h:51
Int_t fNVirtualInfoLoc
! Number of virtual info location to update.
virtual void * At(UInt_t idx)=0
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:493
void Compile()
loop on the TStreamerElement list regroup members with same type Store predigested information into l...
void TagFile(TFile *fFile)
Mark the classindex of the current file as using this TStreamerInfo.
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
Int_t GetSize() const
Return total size of all persistent elements of the class (with offsets).
static TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement fgElement points to the current T...
An array of clone (identical) objects.
Definition: TClonesArray.h:32
Int_t fNumber
!Unique identifier
Definition: TStreamerInfo.h:99
ULong_t GetMethod(Int_t id) const
void BuildCheck(TFile *file=0)
Check if built and consistent with the class dictionary.
virtual ~TStreamerInfo()
TStreamerInfo dtor.
TStreamerElement * GetElement(Int_t id) const
void * NewArray(Long_t nElements, void *ary=0)
An array of emulated objects is created at address ary, if ary is null, we allocate memory for the ar...
TCompInfo ** fCompOpt
![fNdata]
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
TStreamerInfoActions::TActionSequence * GetReadObjectWiseActions()
Abstract Interface class describing Streamer information for one class.
char * operator[](UInt_t idx) const
Definition: TStreamerInfo.h:86
const Bool_t kTRUE
Definition: Rtypes.h:91
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.
TObject * obj
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.
Double_t GetValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Bool_t CompareContent(TClass *cl, TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file)
Return True if the current StreamerInfo in cl or info is equivalent to this TStreamerInfo.
std::atomic< ULong_t > fLiveCount
! Number of outstanding pointer to this StreamerInfo.
TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions(Bool_t forCollection)
TStreamerInfo()
Default ctor.