ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TClass.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Rene Brun 07/01/95
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_TClass
13 #define ROOT_TClass
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TClass //
19 // //
20 // Dictionary of a class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TDictionary
25 #include "TDictionary.h"
26 #endif
27 #ifndef ROOT_TString
28 #include "TString.h"
29 #endif
30 #ifndef ROOT_TObjArray
31 #include "TObjArray.h"
32 #endif
33 #ifndef ROOT_TObjString
34 #include "TObjString.h"
35 #endif
36 
37 #include <map>
38 #include <string>
39 #include <set>
40 #include <unordered_set>
41 #include <vector>
42 
43 #include <atomic>
44 #ifndef ROOT_ThreadLocalStorage
45 #include "ThreadLocalStorage.h"
46 #endif
47 class TBaseClass;
48 class TBrowser;
49 class TDataMember;
50 class TCling;
51 class TMethod;
52 class TRealData;
53 class TBuffer;
56 class TMethodCall;
57 class TVirtualIsAProxy;
58 class TVirtualRefProxy;
59 class THashTable;
60 class TListOfFunctions;
62 class TListOfDataMembers;
63 class TListOfEnums;
64 class TViewPubFunctions;
66 class TFunctionTemplate;
67 class TProtoClass;
68 
69 namespace ROOT {
70  class TGenericClassInfo;
71  class TMapTypeToTClass;
72  class TMapDeclIdToTClass;
73  namespace Detail {
74  class TSchemaRuleSet;
75  class TCollectionProxyInfo;
76  }
77 }
78 typedef ROOT::TMapTypeToTClass IdMap_t;
79 typedef ROOT::TMapDeclIdToTClass DeclIdMap_t;
80 
81 class TClass : public TDictionary {
82 
83 friend class TCling;
84 friend void ROOT::ResetClassVersion(TClass*, const char*, Short_t);
86 friend class TProtoClass;
87 
88 public:
89  // TClass status bits
91  kUnloaded = BIT(16), // The library containing the dictionary for this class was
92  // loaded and has been unloaded from memory.
93  kIsTObject = BIT(17),
94  kIsForeign = BIT(18),
95  kIsEmulation = BIT(19), // Deprecated
96  kStartWithTObject = BIT(20), // see comments for IsStartingWithTObject()
97  kWarned = BIT(21),
99  kHasCustomStreamerMember = BIT(23) // The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based) automatic streamer.
100  };
102  enum ECheckSum {
104  kNoEnum = 1, // Used since v3.3
105  kReflexNoComment = 2, // Up to v5.34.18 (has no range/comment and no typedef at all)
106  kNoRange = 3, // Up to v5.17
107  kWithTypeDef = 4, // Up to v5.34.18 and v5.99/06
108  kReflex = 5, // Up to v5.34.18 (has no typedef at all)
109  kNoRangeCheck = 6, // Up to v5.34.18 and v5.99/06
110  kNoBaseCheckSum = 7, // Up to v5.34.18 and v5.99/06
112  };
113 
114  // Describe the current state of the TClass itself.
115  enum EState {
116  kNoInfo, // The state has not yet been initialized, i.e. the TClass
117  // was just created and/or there is no trace of it in the interpreter.
118  kForwardDeclared, // The interpreted knows the entity is a class but that's it.
119  kEmulated, // The information about the class only comes from a TStreamerInfo
120  kInterpreted, // The class is described completely/only in the interpreter database.
121  kHasTClassInit, // The class has a TClass proper bootstrap coming from a run
122  // through rootcling/genreflex/TMetaUtils and the library
123  // containing this dictionary has been loaded in memory.
125  kNamespaceForMeta // Very transient state necessary to bootstrap namespace entries in ROOT Meta w/o interpreter information
126  };
127 
128 private:
129 
131  // Trivial spin lock guard
132  public:
133  TSpinLockGuard(std::atomic_flag& aflag);
134  ~TSpinLockGuard();
135  private:
136  std::atomic_flag& fAFlag;
137  };
138 
140  // A class which is used to collect decl names starting from normalised
141  // names (typedef resolution is excluded here, just string manipulation
142  // is performed). At the heart of the implementation, an unordered set.
143  public:
144  TDeclNameRegistry(Int_t verbLevel=0);
145  void AddQualifiedName(const char *name);
146  Bool_t HasDeclName(const char *name) const;
148  private:
150  std::unordered_set<std::string> fClassNamesSet;
151  mutable std::atomic_flag fSpinLock; // MSVC doesn't support = ATOMIC_FLAG_INIT;
152  };
153 
155  // Trivial RAII used to insert names in the registry
157  const char* fName;
159  public:
160  InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry);
162  };
163 
164  // TClass objects can be created as a result of opening a TFile (in which
165  // they are in emulated mode) or as a result of loading the dictionary for
166  // the corresponding class. When a dictionary is loaded any pre-existing
167  // emulated TClass is replaced by the one created/coming from the dictionary.
168  // To have a reference that always point to the 'current' TClass object for
169  // a given class, one should use a TClassRef.
170  // TClassRef works by holding on to the fPersistentRef which is updated
171  // atomically whenever a TClass is replaced. During the replacement the
172  // value of fPersistentRef is set to zero, leading the TClassRef to call
173  // TClass::GetClass which is also locked by the replacement. At the end
174  // of the replacement, fPersistentRef points to the new TClass object.
175  std::atomic<TClass**> fPersistentRef;//!Persistent address of pointer to this TClass object and its successors.
176 
177  typedef std::atomic<std::map<std::string, TObjArray*>*> ConvSIMap_t;
178 
179  mutable TObjArray *fStreamerInfo; //Array of TVirtualStreamerInfo
180  mutable ConvSIMap_t fConversionStreamerInfo; //Array of the streamer infos derived from another class.
181  TList *fRealData; //linked list for persistent members including base classes
182  TList *fBase; //linked list for base classes
183  TListOfDataMembers *fData; //linked list for data members
184 
185  std::atomic<TListOfEnums*> fEnums; //linked list for the enums
186  TListOfFunctionTemplates *fFuncTemplate; //linked list for function templates [Not public until implemented as active list]
187  std::atomic<TListOfFunctions*> fMethod; //linked list for methods
188 
189  TViewPubDataMembers*fAllPubData; //all public data members (including from base classes)
190  TViewPubFunctions *fAllPubMethod; //all public methods (including from base classes)
191  mutable TList *fClassMenuList; //list of class menu items
192 
193  const char *fDeclFileName; //name of class declaration file
194  const char *fImplFileName; //name of class implementation file
195  Short_t fDeclFileLine; //line of class declaration
196  Short_t fImplFileLine; //line of class implementation
197  UInt_t fInstanceCount; //number of instances of this class
198  UInt_t fOnHeap; //number of instances on heap
199  mutable std::atomic<UInt_t> fCheckSum; //checksum of data members and base classes
200  TVirtualCollectionProxy *fCollectionProxy; //Collection interface
201  Version_t fClassVersion; //Class version Identifier
202  ClassInfo_t *fClassInfo; //pointer to CINT class info class
203  TString fContextMenuTitle;//context menu title
204  const type_info *fTypeInfo; //pointer to the C++ type information.
205  ShowMembersFunc_t fShowMembers; //pointer to the class's ShowMembers function
206  TClassStreamer *fStreamer; //pointer to streamer function
207  TString fSharedLibs; //shared libraries containing class code
208 
209  TVirtualIsAProxy *fIsA; //!pointer to the class's IsA proxy.
210  IsAGlobalFunc_t fGlobalIsA; //pointer to a global IsA function.
211  mutable std::atomic<TMethodCall*> fIsAMethod; //!saved info to call a IsA member function
212 
213  ROOT::MergeFunc_t fMerge; //pointer to a function implementing Merging objects of this class.
214  ROOT::ResetAfterMergeFunc_t fResetAfterMerge; //pointer to a function implementing Merging objects of this class.
215  ROOT::NewFunc_t fNew; //pointer to a function newing one object.
216  ROOT::NewArrFunc_t fNewArray; //pointer to a function newing an array of objects.
217  ROOT::DelFunc_t fDelete; //pointer to a function deleting one object.
218  ROOT::DelArrFunc_t fDeleteArray; //pointer to a function deleting an array of objects.
219  ROOT::DesFunc_t fDestructor; //pointer to a function call an object's destructor.
220  ROOT::DirAutoAdd_t fDirAutoAdd; //pointer which implements the Directory Auto Add feature for this class.']'
221  ClassStreamerFunc_t fStreamerFunc; //Wrapper around this class custom Streamer member function.
222  ClassConvStreamerFunc_t fConvStreamerFunc; //Wrapper around this class custom conversion Streamer member function.
223  Int_t fSizeof; //Sizeof the class.
224 
225  Int_t fCanSplit; //!Indicates whether this class can be split or not.
226  mutable std::atomic<Long_t> fProperty; //!Property
227  mutable Long_t fClassProperty; //!C++ Property of the class (is abstract, has virtual table, etc.)
228 
229  // fHasRootPcmInfo needs to be atomic as long as GetListOfBases needs to modify it.
230  std::atomic<Bool_t> fHasRootPcmInfo; //!Whether info was loaded from a root pcm.
231  mutable std::atomic<Bool_t> fCanLoadClassInfo; //!Indicates whether the ClassInfo is supposed to be available.
232  mutable std::atomic<Bool_t> fIsOffsetStreamerSet; //!saved remember if fOffsetStreamer has been set.
233  mutable std::atomic<Bool_t> fVersionUsed; //!Indicates whether GetClassVersion has been called
234 
235  mutable Long_t fOffsetStreamer; //!saved info to call Streamer
236  Int_t fStreamerType; //!cached of the streaming method to use
237  EState fState; //!Current 'state' of the class (Emulated,Interpreted,Loaded)
238  mutable std::atomic<TVirtualStreamerInfo*> fCurrentInfo; //!cached current streamer info.
239  mutable std::atomic<TVirtualStreamerInfo*> fLastReadInfo; //!cached streamer info used in the last read.
240  TVirtualRefProxy *fRefProxy; //!Pointer to reference proxy if this class represents a reference
241  ROOT::Detail::TSchemaRuleSet *fSchemaRules; //! Schema evolution rules
242 
243  typedef void (*StreamerImpl_t)(const TClass* pThis, void *obj, TBuffer &b, const TClass *onfile_class);
244 #ifdef R__NO_ATOMIC_FUNCTION_POINTER
245  mutable StreamerImpl_t fStreamerImpl; //! Pointer to the function implementing the right streaming behavior for the class represented by this object.
246 #else
247  mutable std::atomic<StreamerImpl_t> fStreamerImpl; //! Pointer to the function implementing the right streaming behavior for the class represented by this object.
248 #endif
249 
251  TMethod *GetClassMethod(Long_t faddr);
253  Int_t GetBaseClassOffsetRecurse(const TClass *toBase);
254  void Init(const char *name, Version_t cversion, const type_info *info,
255  TVirtualIsAProxy *isa,
256  const char *dfil, const char *ifil,
257  Int_t dl, Int_t il,
258  ClassInfo_t *classInfo,
259  Bool_t silent);
260  void ForceReload (TClass* oldcl);
261  void LoadClassInfo() const;
262 
263  static TClass *LoadClassDefault(const char *requestedname, Bool_t silent);
264  static TClass *LoadClassCustom(const char *requestedname, Bool_t silent);
265 
266  void SetClassVersion(Version_t version);
267  void SetClassSize(Int_t sizof) { fSizeof = sizof; }
269 
270  void SetStreamerImpl();
271 
272  // Various implementation for TClass::Stramer
273  static void StreamerExternal(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
274  static void StreamerTObject(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
275  static void StreamerTObjectInitialized(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
276  static void StreamerTObjectEmulated(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
277  static void StreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
278  static void ConvStreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
279  static void StreamerStreamerInfo(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
280  static void StreamerDefault(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
281 
282  static IdMap_t *GetIdMap(); //Map from typeid to TClass pointer
283  static DeclIdMap_t *GetDeclIdMap(); //Map from DeclId_t to TClass pointer
284  static std::atomic<Int_t> fgClassCount; //provides unique id for a each class
285  //stored in TObject::fUniqueID
286  static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry; // Store the decl names of the forwardd and no info instances
287  static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char*);
288 
289  // Internal status bits, set and reset only during initialization and thus under the protection of the global lock.
290  enum { kLoading = BIT(14), kUnloading = BIT(14) };
291  // Internal streamer type.
293 
294  // When a new class is created, we need to be able to find
295  // if there are any existing classes that have the same name
296  // after any typedefs are expanded. (This only really affects
297  // template arguments.) To avoid having to search through all classes
298  // in that case, we keep a hash table mapping from the fully
299  // typedef-expanded names to the original class names.
300  // An entry is made in the table only if they are actually different.
301  //
302  // In these objects, the TObjString base holds the typedef-expanded
303  // name (the hash key), and fOrigName holds the original class name
304  // (the value to which the key maps).
305  //
306  class TNameMapNode : public TObjString
307  {
308  public:
309  TNameMapNode (const char* typedf, const char* orig);
311  };
312 
313  // These are the above-referenced hash tables. (The pointers are null
314  // if no entries have been made.)
316 
317 private:
318  TClass(const TClass& tc) = delete;
319  TClass& operator=(const TClass&) = delete;
320 
321 protected:
322  TVirtualStreamerInfo *FindStreamerInfo(TObjArray* arr, UInt_t checksum) const;
324  void GetMissingDictionariesForMembers(TCollection& result, TCollection& visited, bool recurse);
327 
328 public:
329  TClass();
330  TClass(const char *name, Bool_t silent = kFALSE);
331  TClass(const char *name, Version_t cversion, Bool_t silent = kFALSE);
332  TClass(const char *name, Version_t cversion, EState theState, Bool_t silent = kFALSE);
333  TClass(ClassInfo_t *info, Version_t cversion,
334  const char *dfil, const char *ifil = 0,
335  Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
336  TClass(const char *name, Version_t cversion,
337  const char *dfil, const char *ifil = 0,
338  Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
339  TClass(const char *name, Version_t cversion,
340  const type_info &info, TVirtualIsAProxy *isa,
341  const char *dfil, const char *ifil,
342  Int_t dl, Int_t il, Bool_t silent = kFALSE);
343  virtual ~TClass();
344 
345  void AddInstance(Bool_t heap = kFALSE) { fInstanceCount++; if (heap) fOnHeap++; }
346  void AddImplFile(const char *filename, int line);
347  static Bool_t AddRule(const char *rule);
348  static Int_t ReadRules(const char *filename);
349  static Int_t ReadRules();
351  virtual void Browse(TBrowser *b);
352  void BuildRealData(void *pointer=0, Bool_t isTransient = kFALSE);
353  void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl);
354  void CalculateStreamerOffset() const;
355  Bool_t CallShowMembers(const void* obj, TMemberInspector &insp, Bool_t isTransient = kFALSE) const;
356  Bool_t CanSplit() const;
358  Long_t ClassProperty() const;
359  TObject *Clone(const char *newname="") const;
361  void Draw(Option_t *option="");
362  void Dump() const { TDictionary::Dump(); }
363  void Dump(const void *obj, Bool_t noAddr = kFALSE) const;
364  char *EscapeChars(const char *text) const;
366  TVirtualStreamerInfo *GetConversionStreamerInfo( const char* onfile_classname, Int_t version ) const;
367  TVirtualStreamerInfo *FindConversionStreamerInfo( const char* onfile_classname, UInt_t checksum ) const;
368  TVirtualStreamerInfo *GetConversionStreamerInfo( const TClass* onfile_cl, Int_t version ) const;
369  TVirtualStreamerInfo *FindConversionStreamerInfo( const TClass* onfile_cl, UInt_t checksum ) const;
375  UInt_t GetCheckSum(Bool_t &isvalid) const;
376  UInt_t GetCheckSum(ECheckSum code, Bool_t &isvalid) const;
378  TVirtualIsAProxy *GetIsAProxy() const;
379  TMethod *GetClassMethod(const char *name, const char *params, Bool_t objectIsConst = kFALSE);
380  TMethod *GetClassMethodWithPrototype(const char *name, const char *proto, Bool_t objectIsConst = kFALSE, ROOT::EFunctionMatchMode mode = ROOT::kConversionMatch);
382  Int_t GetClassSize() const { return Size(); }
383  TDataMember *GetDataMember(const char *datamember) const;
384  Long_t GetDataMemberOffset(const char *membername) const;
385  const char *GetDeclFileName() const { return fDeclFileName; }
387  ROOT::DelFunc_t GetDelete() const;
390  ClassInfo_t *GetClassInfo() const { if (fCanLoadClassInfo && !TestBit(kLoading)) LoadClassInfo(); return fClassInfo; }
391  const char *GetContextMenuTitle() const { return fContextMenuTitle; }
393  if (fCurrentInfo.load()) return fCurrentInfo;
394  else return DetermineCurrentStreamerInfo();
395  }
399  TList *GetListOfEnums(Bool_t load = kTRUE);
403  TCollection *GetListOfMethodOverloads(const char* name) const;
404  TList *GetListOfRealData() const { return fRealData; }
407  const char *GetImplFileName() const { return fImplFileName; }
409  TClass *GetActualClass(const void *object) const;
410  TClass *GetBaseClass(const char *classname);
411  TClass *GetBaseClass(const TClass *base);
412  Int_t GetBaseClassOffset(const TClass *toBase, void *address = 0, bool isDerivedObject = true);
413  TClass *GetBaseDataMember(const char *datamember);
418  UInt_t GetHeapInstanceCount() const { return fOnHeap; }
419  void GetMenuItems(TList *listitems);
420  TList *GetMenuList() const;
421  TMethod *GetMethod(const char *method, const char *params, Bool_t objectIsConst = kFALSE);
422  TMethod *GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst = kFALSE, ROOT::EFunctionMatchMode mode = ROOT::kConversionMatch);
423  TMethod *GetMethodAny(const char *method);
424  TMethod *GetMethodAllAny(const char *method);
425  Int_t GetNdata();
426  ROOT::MergeFunc_t GetMerge() const;
428  ROOT::NewFunc_t GetNew() const;
430  Int_t GetNmethods();
431 #ifdef __CINT__
432  TClass **GetPersistentRef() const { return fPersistentRef; }
433 #else
434  TClass *const*GetPersistentRef() const { return fPersistentRef; }
435 #endif
436  TRealData *GetRealData(const char *name) const;
440  const char *GetSharedLibs();
442  EState GetState() const { return fState; }
443  TClassStreamer *GetStreamer() const;
446  const TObjArray *GetStreamerInfos() const { return fStreamerInfo; }
447  TVirtualStreamerInfo *GetStreamerInfo(Int_t version=0) const;
450  const type_info *GetTypeInfo() const { return fTypeInfo; };
452  static Bool_t HasDictionarySelection(const char* clname);
453  void GetMissingDictionaries(THashTable& result, bool recurse = false);
454  void IgnoreTObjectStreamer(Bool_t ignore=kTRUE);
455  Bool_t InheritsFrom(const char *cl) const;
456  Bool_t InheritsFrom(const TClass *cl) const;
457  void InterpretedShowMembers(void* obj, TMemberInspector &insp, Bool_t isTransient);
458  Bool_t IsFolder() const { return kTRUE; }
459  Bool_t IsLoaded() const;
460  Bool_t IsForeign() const;
462  Bool_t IsVersioned() const { return !( GetClassVersion()<=1 && IsForeign() ); }
463  Bool_t IsTObject() const;
464  static TClass *LoadClass(const char *requestedname, Bool_t silent);
465  void ls(Option_t *opt="") const;
466  void MakeCustomMenuList();
467  Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
468  void Move(void *arenaFrom, void *arenaTo) const;
469  void *New(ENewType defConstructor = kClassNew, Bool_t quiet = kFALSE) const;
470  void *New(void *arena, ENewType defConstructor = kClassNew) const;
471  void *NewArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
472  void *NewArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
473  virtual void PostLoadCheck();
474  Long_t Property() const;
475  Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
476  Int_t ReadBuffer(TBuffer &b, void *pointer);
478  void RemoveStreamerInfo(Int_t slot);
479  void ReplaceWith(TClass *newcl) const;
480  void ResetCaches();
481  void ResetClassInfo(Long_t tagnum);
482  void ResetClassInfo();
484  void ResetMenuList();
485  Int_t Size() const;
486  void SetCanSplit(Int_t splitmode);
488  void SetContextMenuTitle(const char *title);
491  void SetDeclFile(const char *name, int line) { fDeclFileName = name; fDeclFileLine = line; }
492  void SetDelete(ROOT::DelFunc_t deleteFunc);
493  void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc);
494  void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc);
495  void SetDestructor(ROOT::DesFunc_t destructorFunc);
496  void SetImplFileName(const char *implFileName) { fImplFileName = implFileName; }
497  void SetMerge(ROOT::MergeFunc_t mergeFunc);
499  void SetNew(ROOT::NewFunc_t newFunc);
500  void SetNewArray(ROOT::NewArrFunc_t newArrayFunc);
501  TVirtualStreamerInfo *SetStreamerInfo(Int_t version, const char *info="");
502  void SetUnloaded();
503  Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="");
504 
506  void AdoptStreamer(TClassStreamer *strm);
507  void AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
508  void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm);
511 
512  // Function to retrieve the TClass object and dictionary function
513  static void AddClass(TClass *cl);
514  static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass* cl);
515  static void RemoveClass(TClass *cl);
517  static TClass *GetClass(const char *name, Bool_t load = kTRUE, Bool_t silent = kFALSE);
518  static TClass *GetClass(const type_info &typeinfo, Bool_t load = kTRUE, Bool_t silent = kFALSE);
519  static TClass *GetClass(ClassInfo_t *info, Bool_t load = kTRUE, Bool_t silent = kFALSE);
520  static Bool_t GetClass(DeclId_t id, std::vector<TClass*> &classes);
521  static DictFuncPtr_t GetDict (const char *cname);
522  static DictFuncPtr_t GetDict (const type_info &info);
523 
524  static Int_t AutoBrowse(TObject *obj, TBrowser *browser);
525  static ENewType IsCallingNew();
526  static TClass *Load(TBuffer &b);
527  void Store(TBuffer &b) const;
528 
529  // Pseudo-method apply to the 'obj'. In particular those are used to
530  // implement TObject like methods for non-TObject classes
531 
532  Int_t Browse(void *obj, TBrowser *b) const;
533  void DeleteArray(void *ary, Bool_t dtorOnly = kFALSE);
534  void Destructor(void *obj, Bool_t dtorOnly = kFALSE);
535  void *DynamicCast(const TClass *base, void *obj, Bool_t up = kTRUE);
536  const void *DynamicCast(const TClass *base, const void *obj, Bool_t up = kTRUE);
537  Bool_t IsFolder(void *obj) const;
538 
539  inline void Streamer(void *obj, TBuffer &b, const TClass *onfile_class = 0) const
540  {
541  // Inline for performance, skipping one function call.
542 #ifdef R__NO_ATOMIC_FUNCTION_POINTER
543  fStreamerImpl(this,obj,b,onfile_class);
544 #else
545  auto t = fStreamerImpl.load();
546  t(this,obj,b,onfile_class);
547 #endif
548  }
549 
550  ClassDef(TClass,0) //Dictionary containing class information
551 };
552 
553 namespace ROOT {
554  template <typename T> TClass* GetClass( T* /* dummy */) { return TClass::GetClass(typeid(T)); }
555  template <typename T> TClass* GetClass(const T* /* dummy */) { return TClass::GetClass(typeid(T)); }
556 
557 #ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
558  // This can only be used when the template overload resolution can distringuish between
559  // T* and T**
560  template <typename T> TClass* GetClass( T** /* dummy */) { return GetClass((T*)0); }
561  template <typename T> TClass* GetClass(const T** /* dummy */) { return GetClass((T*)0); }
562  template <typename T> TClass* GetClass( T* const* /* dummy */) { return GetClass((T*)0); }
563  template <typename T> TClass* GetClass(const T* const* /* dummy */) { return GetClass((T*)0); }
564 #endif
565 
566  extern TClass *CreateClass(const char *cname, Version_t id,
567  const char *dfil, const char *ifil,
568  Int_t dl, Int_t il);
569 }
570 
571 #endif // ROOT_TClass
TObject * Clone(const char *newname="") const
Create a Clone of this TClass object using a different name but using the same 'dictionary'.
Definition: TClass.cxx:2256
EState GetState() const
Definition: TClass.h:442
void ReplaceWith(TClass *newcl) const
Definition: TClass.cxx:3784
void AddQualifiedName(const char *name)
Extract this part of the name.
Definition: TClass.cxx:137
void ResetCaches()
To clean out all caches.
Definition: TClass.cxx:3870
Int_t GetNdata()
Return the number of data members of this class Note that in case the list of data members is not yet...
Definition: TClass.cxx:4211
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition: TClass.cxx:3994
TVirtualRefProxy * GetReferenceProxy() const
Definition: TClass.h:437
static TClass * LoadClassCustom(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5340
ShowMembersFunc_t fShowMembers
Definition: TClass.h:205
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
TClass *(* DictFuncPtr_t)()
Definition: Rtypes.h:75
Bool_t HasDefaultConstructor() const
Return true if we have access to a default constructor.
Definition: TClass.cxx:6755
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3368
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:69
ESTLType
Definition: ESTLType.h:28
An array of TObjects.
Definition: TObjArray.h:39
ROOT::NewArrFunc_t fNewArray
Definition: TClass.h:216
ROOT::MergeFunc_t GetMerge() const
Return the wrapper around Merge.
Definition: TClass.cxx:6777
std::atomic< TMethodCall * > fIsAMethod
Definition: TClass.h:211
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Definition: TClass.cxx:2152
TClass *(* IsAGlobalFunc_t)(const TClass *, const void *obj)
Definition: Rtypes.h:135
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
Definition: TClass.cxx:1792
ROOT::DelArrFunc_t GetDeleteArray() const
Return the wrapper around delete [] ThiObject.
Definition: TClass.cxx:6817
virtual void PostLoadCheck()
Do the initialization that can only be done after the CINT dictionary has been fully populated and ca...
Definition: TClass.cxx:5481
void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse)
Verify the base classes always.
Definition: TClass.cxx:3623
short Version_t
Definition: RtypesCore.h:61
void AdoptReferenceProxy(TVirtualRefProxy *proxy)
Adopt the Reference proxy pointer to indicate that this class represents a reference.
Definition: TClass.cxx:6126
Int_t GetNmethods()
Return the number of methods of this class Note that in case the list of methods is not yet created...
Definition: TClass.cxx:4230
TLine * line
Collectable string class.
Definition: TObjString.h:32
static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass *cl)
static: Add a TClass* to the map of classes.
Definition: TClass.cxx:463
void SetDeclFile(const char *name, int line)
Definition: TClass.h:491
ConvSIMap_t fConversionStreamerInfo
Definition: TClass.h:180
void SetDelete(ROOT::DelFunc_t deleteFunc)
Install a new wrapper around 'delete'.
Definition: TClass.cxx:6439
const char Option_t
Definition: RtypesCore.h:62
ROOT::DesFunc_t GetDestructor() const
Return the wrapper around the destructor.
Definition: TClass.cxx:6825
Dictionary for function template This class describes one single function template.
tuple offset
Definition: tree.py:93
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:33
void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm)
Install a new member streamer (p will be copied).
Definition: TClass.cxx:6182
void SetConvStreamerFunc(ClassConvStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom conversion streamer.
Definition: TClass.cxx:6383
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
ENewType
Definition: TClass.h:101
void ls(Option_t *opt="") const
The ls function lists the contents of a class on stdout.
Definition: TClass.cxx:3911
TList * GetListOfEnums(Bool_t load=kTRUE)
Return list containing the TEnums of a class.
Definition: TClass.cxx:3408
std::atomic< TListOfEnums * > fEnums
Definition: TClass.h:185
static void StreamerExternal(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
There is special streamer for the class.
Definition: TClass.cxx:6226
void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl)
Build the list of real data for an emulated class.
Definition: TClass.cxx:2014
void SetClassVersion(Version_t version)
Private function.
Definition: TClass.cxx:5214
TViewPubFunctions * fAllPubMethod
Definition: TClass.h:190
#define BIT(n)
Definition: Rtypes.h:120
Persistent version of a TClass.
Definition: TProtoClass.h:37
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5462
TCollection * GetListOfMethodOverloads(const char *name) const
Return the collection of functions named "name".
Definition: TClass.cxx:3523
void ResetMenuList()
Resets the menu list to it's standard value.
Definition: TClass.cxx:3896
std::atomic< Bool_t > fHasRootPcmInfo
C++ Property of the class (is abstract, has virtual table, etc.)
Definition: TClass.h:230
static THashTable * fgClassTypedefHash
Definition: TClass.h:315
void(* StreamerImpl_t)(const TClass *pThis, void *obj, TBuffer &b, const TClass *onfile_class)
Schema evolution rules.
Definition: TClass.h:243
std::atomic< std::map< std::string, TObjArray * > * > ConvSIMap_t
Persistent address of pointer to this TClass object and its successors.
Definition: TClass.h:177
void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc)
Install a new wrapper around 'delete []'.
Definition: TClass.cxx:6447
TMethod * GetClassMethodWithPrototype(const char *name, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
Definition: TClass.cxx:4184
ROOT::DirAutoAdd_t fDirAutoAdd
Definition: TClass.h:220
static void RemoveClassDeclId(TDictionary::DeclId_t id)
Definition: TClass.cxx:488
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Definition: TClass.cxx:5560
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
static void StreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6274
static const char * filename()
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3459
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Definition: TClass.cxx:3355
Basic string class.
Definition: TString.h:137
void GetMissingDictionariesWithRecursionCheck(TCollection &result, TCollection &visited, bool recurse)
From the second level of recursion onwards it is different state check.
Definition: TClass.cxx:3685
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method). ...
Definition: TClass.cxx:5471
TString fContextMenuTitle
Definition: TClass.h:203
static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char *)
Definition: TClass.cxx:3100
TVirtualStreamerInfo * GetCurrentStreamerInfo()
Definition: TClass.h:392
int Int_t
Definition: RtypesCore.h:41
ROOT::NewFunc_t GetNew() const
Return the wrapper around new ThisClass().
Definition: TClass.cxx:6793
bool Bool_t
Definition: RtypesCore.h:59
void *(* NewArrFunc_t)(Long_t size, void *arena)
Definition: Rtypes.h:148
const Bool_t kFALSE
Definition: Rtypes.h:92
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
Definition: TClass.cxx:3541
void SetContextMenuTitle(const char *title)
Change (i.e. set) the title of the TNamed.
Definition: TClass.cxx:5716
TVirtualRefProxy * fRefProxy
cached streamer info used in the last read.
Definition: TClass.h:240
static void StreamerTObjectInitialized(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects when fIsOffsetStreamerSet is known to have been set.
Definition: TClass.cxx:6252
TVirtualStreamerInfo * FindStreamerInfoAbstractEmulated(UInt_t checksum) const
For the case where the requestor class is emulated and this class is abstract, returns a pointer to t...
Definition: TClass.cxx:4399
Int_t fStreamerType
saved info to call Streamer
Definition: TClass.h:236
Abstract base class for accessing the data-members of a class.
void SetImplFileName(const char *implFileName)
Definition: TClass.h:496
static void StreamerStreamerInfo(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of where we should directly use the StreamerInfo.
Definition: TClass.cxx:6296
void AdoptStreamer(TClassStreamer *strm)
Adopt a TClassStreamer object.
Definition: TClass.cxx:6332
Int_t GetClassSize() const
Definition: TClass.h:382
const void * DeclId_t
Definition: TDictionary.h:209
std::atomic< Bool_t > fIsOffsetStreamerSet
Indicates whether the ClassInfo is supposed to be available.
Definition: TClass.h:232
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4037
std::atomic< TVirtualStreamerInfo * > fLastReadInfo
cached current streamer info.
Definition: TClass.h:239
void SetClassSize(Int_t sizof)
Definition: TClass.h:267
Short_t fImplFileLine
Definition: TClass.h:196
void LoadClassInfo() const
Try to load the classInfo (it may require parsing the header file and/or loading data from the clang ...
Definition: TClass.cxx:5361
void(* DirAutoAdd_t)(void *, TDirectory *)
Definition: Rtypes.h:152
void DeleteArray(void *ary, Bool_t dtorOnly=kFALSE)
Explicitly call operator delete[] for an array.
Definition: TClass.cxx:5076
Bool_t IsVersioned() const
Definition: TClass.h:462
ROOT::NewFunc_t fNew
Definition: TClass.h:215
TList * GetListOfRealData() const
Definition: TClass.h:404
void ResetInstanceCount()
Definition: TClass.h:483
void SetLastReadInfo(TVirtualStreamerInfo *info)
Definition: TClass.h:397
Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count)
Function called by the Streamer functions to deserialize information from buffer b into object at p...
Definition: TClass.cxx:6196
TTree * T
static IdMap_t * GetIdMap()
Definition: TClass.cxx:421
static void StreamerTObjectEmulated(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects when we do not have the library defining the class.
Definition: TClass.cxx:6261
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
Definition: TClass.cxx:2625
TDeclNameRegistry & fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:158
TClass * GetClass(T *)
Definition: TClass.h:554
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...
Definition: TClass.cxx:5939
Int_t GetBaseClassOffsetRecurse(const TClass *toBase)
Return data member offset to the base class "cl".
Definition: TClass.cxx:2554
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function)...
Definition: TClass.cxx:2780
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:39
TMethod * FindClassOrBaseMethodWithId(DeclId_t faddr)
Find a method with decl id in this class or its bases.
Definition: TClass.cxx:4093
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t HasInterpreterInfoInMemory() const
Definition: TClass.h:372
ShowMembersFunc_t GetShowMembersWrapper() const
Definition: TClass.h:441
void Move(void *arenaFrom, void *arenaTo) const
Register the fact that an object was moved from the memory location 'arenaFrom' to the memory locatio...
Definition: TClass.cxx:3980
static Int_t ReadRules()
Read the class.rules files from the default location:.
Definition: TClass.cxx:1714
ClassStreamerFunc_t fStreamerFunc
Definition: TClass.h:221
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Definition: Rtypes.h:153
ECheckSum
Definition: TClass.h:102
static DeclIdMap_t * GetDeclIdMap()
Definition: TClass.cxx:432
const char * GetContextMenuTitle() const
Definition: TClass.h:391
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition: TClass.cxx:4602
ROOT::ResetAfterMergeFunc_t fResetAfterMerge
Definition: TClass.h:214
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
Definition: TClass.cxx:2457
void InterpretedShowMembers(void *obj, TMemberInspector &insp, Bool_t isTransient)
Do a ShowMembers() traversal of all members and base classes' members using the reflection informatio...
Definition: TClass.cxx:2144
void ResetClassInfo()
Make sure that the current ClassInfo is up to date.
Definition: TClass.cxx:3835
void SetStreamerFunc(ClassStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom streamer.
Definition: TClass.cxx:6360
ROOT::NewArrFunc_t GetNewArray() const
Return the wrapper around new ThisClass[].
Definition: TClass.cxx:6801
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
Definition: Rtypes.h:154
EFunctionMatchMode
Definition: TDictionary.h:155
const char * GetImplFileName() const
Definition: TClass.h:407
TList * fBase
Definition: TClass.h:182
void RegisterStreamerInfo(TVirtualStreamerInfo *info)
Register the StreamerInfo in the given slot, change the State of the TClass as appropriate.
Definition: TClass.cxx:6715
Method or function calling interface.
Definition: TMethodCall.h:41
std::atomic< Bool_t > fVersionUsed
saved remember if fOffsetStreamer has been set.
Definition: TClass.h:233
This class defines an interface to the cling C++ interpreter.
Definition: TCling.h:92
TListOfFunctionTemplates * fFuncTemplate
Definition: TClass.h:186
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
Definition: TClass.cxx:5426
Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="")
Function called by the Streamer functions to serialize object at p to buffer b.
Definition: TClass.cxx:6217
TViewPubDataMembers * fAllPubData
Definition: TClass.h:189
TList * fClassMenuList
Definition: TClass.h:191
TVirtualStreamerInfo * SetStreamerInfo(Int_t version, const char *info="")
Info is a string describing the names and types of attributes written by the class Streamer function...
Definition: TClass.cxx:5818
ROOT::Detail::TSchemaRuleSet * fSchemaRules
Pointer to reference proxy if this class represents a reference.
Definition: TClass.h:241
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition: TClass.cxx:6502
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition: TClass.cxx:5950
std::atomic< StreamerImpl_t > fStreamerImpl
Definition: TClass.h:247
TList * fRealData
Definition: TClass.h:181
ROOT::DelFunc_t GetDelete() const
Return the wrapper around delete ThiObject.
Definition: TClass.cxx:6809
EStreamerType
Definition: TClass.h:292
A doubly linked list.
Definition: TList.h:47
View implementing the TList interface and giving access all the TDictionary describing public data me...
TClass * GetBaseClass(const char *classname)
Return pointer to the base class "classname".
Definition: TClass.cxx:2504
const char * fImplFileName
Definition: TClass.h:194
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
Definition: TClass.cxx:3195
void AddInstance(Bool_t heap=kFALSE)
Definition: TClass.h:345
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:1933
TClass * CreateClass(const char *cname, Version_t id, const type_info &info, TVirtualIsAProxy *isa, const char *dfil, const char *ifil, Int_t dl, Int_t il)
Global function called by a class' static Dictionary() method (see the ClassDef macro).
Definition: TClass.cxx:5393
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
std::atomic_flag & fAFlag
Definition: TClass.h:136
Int_t fCanSplit
Definition: TClass.h:225
void SetNew(ROOT::NewFunc_t newFunc)
Install a new wrapper around 'new'.
Definition: TClass.cxx:6423
static DictFuncPtr_t GetDict(const char *cname)
Return a pointer to the dictionary loading function generated by rootcint.
Definition: TClass.cxx:3124
const type_info * fTypeInfo
Definition: TClass.h:204
std::atomic< TVirtualStreamerInfo * > fCurrentInfo
Current 'state' of the class (Emulated,Interpreted,Loaded)
Definition: TClass.h:238
TThread * t[5]
Definition: threadsh1.C:13
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
Definition: TClass.cxx:6619
TString fOrigName
Definition: TClass.h:310
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Definition: TClass.cxx:4256
void AdoptMemberStreamer(const char *name, TMemberStreamer *strm)
Adopt the TMemberStreamer pointer to by p and use it to Stream non basic member name.
Definition: TClass.cxx:6144
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition: TClass.cxx:3936
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:162
void GetMissingDictionariesForPairElements(TCollection &result, TCollection &visited, bool recurse)
Definition: TClass.cxx:3668
void Init(const char *name, Version_t cversion, const type_info *info, TVirtualIsAProxy *isa, const char *dfil, const char *ifil, Int_t dl, Int_t il, ClassInfo_t *classInfo, Bool_t silent)
Initialize a TClass object.
Definition: TClass.cxx:1304
void Store(TBuffer &b) const
Store class description on I/O buffer.
Definition: TClass.cxx:5384
void SetDestructor(ROOT::DesFunc_t destructorFunc)
Install a new wrapper around the destructor.
Definition: TClass.cxx:6455
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
Definition: TClass.cxx:6522
ClassInfo_t * GetClassInfo() const
Definition: TClass.h:390
void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse)
Verify the Data Members.
Definition: TClass.cxx:3640
UInt_t GetInstanceCount() const
Definition: TClass.h:417
void SetGlobalIsA(IsAGlobalFunc_t)
This function installs a global IsA function for this class.
Definition: TClass.cxx:5747
void SetUnloaded()
Call this method to indicate that the shared library containing this class's code has been removed (u...
Definition: TClass.cxx:5756
Collection abstract base class.
Definition: TCollection.h:48
void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc)
Install a new wrapper around the directory auto add function.
Definition: TClass.cxx:6466
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
Definition: TClass.cxx:4959
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
Definition: TClass.cxx:4465
Bool_t HasInterpreterInfo() const
Definition: TClass.h:373
static void StreamerTObject(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects.
Definition: TClass.cxx:6238
unsigned int UInt_t
Definition: RtypesCore.h:42
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
Bool_t IsStartingWithTObject() const
Returns true if this class inherits from TObject and if the start of the TObject parts is at the very...
Definition: TClass.cxx:5453
void Draw(Option_t *option="")
Draw detailed class inheritance structure.
Definition: TClass.cxx:2336
Short_t GetDeclFileLine() const
Definition: TClass.h:386
void GetMissingDictionaries(THashTable &result, bool recurse=false)
Get the classes that have a missing dictionary starting from this one.
Definition: TClass.cxx:3734
short Short_t
Definition: RtypesCore.h:35
The TRealData class manages the effective list of all data members for a given class.
Definition: TRealData.h:34
virtual void Browse(TBrowser *b)
This method is called by a browser to get the class information.
Definition: TClass.cxx:1912
Bool_t CanIgnoreTObjectStreamer()
Definition: TClass.h:357
InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry)
Definition: TClass.cxx:204
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
TVirtualCollectionProxy * fCollectionProxy
Definition: TClass.h:200
TClass * GetBaseDataMember(const char *datamember)
Return pointer to (base) class that contains datamember.
Definition: TClass.cxx:2660
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition: TClass.cxx:2772
ROOT::TMapTypeToTClass IdMap_t
Definition: TClass.h:78
void CalculateStreamerOffset() const
Calculate the offset between an object of this class to its base class TObject.
Definition: TClass.cxx:2085
Version_t GetClassVersion() const
Definition: TClass.h:381
UInt_t fInstanceCount
Definition: TClass.h:197
TVirtualIsAProxy * GetIsAProxy() const
Return the proxy implementing the IsA functionality.
Definition: TClass.cxx:2788
UInt_t fOnHeap
Definition: TClass.h:198
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:35
Bool_t HasDictionary()
Check whether a class has a dictionary or not.
Definition: TClass.cxx:3602
void SetCollectionProxy(const ROOT::Detail::TCollectionProxyInfo &)
Create the collection proxy object (and the streamer object) from using the information in the TColle...
Definition: TClass.cxx:5691
TListOfFunctions * GetMethodList()
Pointer to the function implementing the right streaming behavior for the class represented by this o...
Definition: TClass.cxx:4008
View implementing the TList interface and giving access all the TFunction describing public methods i...
static void StreamerDefault(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Default streaming in cases where either we have no way to know what to do or if Property() has not ye...
Definition: TClass.cxx:6311
Bool_t CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient=kFALSE) const
Call ShowMembers() on the obj of this class type, passing insp and parent.
Definition: TClass.cxx:2107
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
Definition: TClass.cxx:472
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
Definition: TClass.cxx:3558
void(* DesFunc_t)(void *)
Definition: Rtypes.h:151
TMethod * GetClassMethod(Long_t faddr)
Look for a method in this class that has the interface function address faddr.
Definition: TClass.cxx:4140
ROOT::DesFunc_t fDestructor
Definition: TClass.h:219
std::atomic_flag fSpinLock
Definition: TClass.h:151
Int_t fSizeof
Definition: TClass.h:223
std::unordered_set< std::string > fClassNamesSet
Definition: TClass.h:150
long Long_t
Definition: RtypesCore.h:50
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Definition: TClass.cxx:5436
void ForceReload(TClass *oldcl)
we found at least one equivalent.
Definition: TClass.cxx:1279
void SetCanSplit(Int_t splitmode)
Set the splitability of this class: -1: Use the default calculation 0: Disallow splitting 1: Always a...
Definition: TClass.cxx:5197
std::atomic< TListOfFunctions * > fMethod
Definition: TClass.h:187
Short_t GetImplFileLine() const
Definition: TClass.h:408
ROOT::DelArrFunc_t fDeleteArray
Definition: TClass.h:218
TClass & operator=(const TClass &)=delete
void *(* NewFunc_t)(void *)
Definition: Rtypes.h:147
TObjArray * fStreamerInfo
Definition: TClass.h:179
std::atomic< TClass ** > fPersistentRef
Definition: TClass.h:175
Long_t fOffsetStreamer
Indicates whether GetClassVersion has been called.
Definition: TClass.h:235
EState fState
cached of the streaming method to use
Definition: TClass.h:237
char * EscapeChars(const char *text) const
Introduce an escape character (@) in front of a special chars.
Definition: TClass.cxx:2418
TText * text
ROOT::DelFunc_t fDelete
Definition: TClass.h:217
void RemoveStreamerInfo(Int_t slot)
Remove and delete the StreamerInfo in the given slot.
Definition: TClass.cxx:6739
void(* ClassStreamerFunc_t)(TBuffer &, void *)
Definition: Rtypes.h:67
UInt_t GetHeapInstanceCount() const
Definition: TClass.h:418
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
Definition: TClass.cxx:446
virtual ~TClass()
TClass dtor. Deletes all list that might have been created.
Definition: TClass.cxx:1558
void(* DelArrFunc_t)(void *)
Definition: Rtypes.h:150
void SetStreamerImpl()
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition: TClass.cxx:5662
TMethod * GetMethod(const char *method, const char *params, Bool_t objectIsConst=kFALSE)
Find the best method (if there is one) matching the parameters.
Definition: TClass.cxx:4064
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition: TClass.cxx:2747
static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:286
TVirtualStreamerInfo * GetLastReadInfo() const
Definition: TClass.h:396
Long_t GetDataMemberOffset(const char *membername) const
return offset for member name.
Definition: TClass.cxx:3169
void Dump() const
Dump contents of object on stdout.
Definition: TClass.h:362
TVirtualStreamerInfo * DetermineCurrentStreamerInfo()
Determine and set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5223
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2801
TVirtualIsAProxy * fIsA
Definition: TClass.h:209
std::atomic< Long_t > fProperty
Indicates whether this class can be split or not.
Definition: TClass.h:226
ROOT::DirAutoAdd_t GetDirectoryAutoAdd() const
Return the wrapper around the directory auto add function.
Definition: TClass.cxx:6833
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5288
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2730
#define name(a, b)
Definition: linkTestLib0.cpp:5
IsAGlobalFunc_t fGlobalIsA
pointer to the class's IsA proxy.
Definition: TClass.h:210
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Definition: TClass.cxx:3141
ROOT::TMapDeclIdToTClass DeclIdMap_t
Definition: TClass.h:79
Long_t fClassProperty
Property.
Definition: TClass.h:227
TDeclNameRegistry(Int_t verbLevel=0)
TDeclNameRegistry class constructor.
Definition: TClass.cxx:126
Mother of all ROOT objects.
Definition: TObject.h:58
Short_t fDeclFileLine
Definition: TClass.h:195
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition: TClass.cxx:3339
static std::atomic< Int_t > fgClassCount
Definition: TClass.h:284
typedef void((*Func_t)())
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
Definition: Rtypes.h:68
TNameMapNode(const char *typedf, const char *orig)
Definition: TClass.cxx:700
Version_t fClassVersion
Definition: TClass.h:201
TString fSharedLibs
Definition: TClass.h:207
const char * GetDeclFileName() const
Definition: TClass.h:385
void AddImplFile(const char *filename, int line)
Definition: TClass.cxx:1854
std::atomic< UInt_t > fCheckSum
Definition: TClass.h:199
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TClass.h:458
TListOfDataMembers * fData
Definition: TClass.h:183
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
Definition: TListOfEnums.h:36
ClassInfo_t * fClassInfo
Definition: TClass.h:202
static TClass * LoadClassDefault(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5310
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
Definition: Rtypes.h:133
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:40
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
Definition: TClass.cxx:3570
static TClass * Load(TBuffer &b)
Load class description from I/O buffer and return class object.
Definition: TClass.cxx:5254
ClassConvStreamerFunc_t fConvStreamerFunc
Definition: TClass.h:222
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Definition: TClass.cxx:1834
const char * fDeclFileName
Definition: TClass.h:193
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
Definition: TClass.cxx:2719
const TObjArray * GetStreamerInfos() const
Definition: TClass.h:446
TClassStreamer * fStreamer
Definition: TClass.h:206
void SetMerge(ROOT::MergeFunc_t mergeFunc)
Install a new wrapper around 'Merge'.
Definition: TClass.cxx:6407
void SetCurrentStreamerInfo(TVirtualStreamerInfo *info)
Set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5235
std::atomic< Bool_t > fCanLoadClassInfo
Whether info was loaded from a root pcm.
Definition: TClass.h:231
static void ConvStreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6283
double result[121]
void * DynamicCast(const TClass *base, void *obj, Bool_t up=kTRUE)
Cast obj of this class type up to baseclass cl if up is true.
Definition: TClass.cxx:4539
void SetResetAfterMerge(ROOT::ResetAfterMergeFunc_t resetFunc)
Install a new wrapper around 'ResetAfterMerge'.
Definition: TClass.cxx:6415
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4498
TClass *const * GetPersistentRef() const
Definition: TClass.h:434
Bool_t HasDeclName(const char *name) const
Definition: TClass.cxx:164
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4027
Bool_t HasDataMemberInfo() const
Definition: TClass.h:370
ROOT::ResetAfterMergeFunc_t GetResetAfterMerge() const
Return the wrapper around Merge.
Definition: TClass.cxx:6785
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Definition: TClass.cxx:2246
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
Definition: TClass.h:539
Abstract Interface class describing Streamer information for one class.
const Bool_t kTRUE
Definition: Rtypes.h:91
static Bool_t HasDictionarySelection(const char *clname)
Check whether a class has a dictionary or ROOT can load one.
Definition: TClass.cxx:3613
TMethod * GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
Definition: TClass.cxx:4113
TObject * obj
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition: TClass.cxx:3508
void SetNewArray(ROOT::NewArrFunc_t newArrayFunc)
Install a new wrapper around 'new []'.
Definition: TClass.cxx:6431
TSpinLockGuard(std::atomic_flag &aflag)
Definition: TClass.cxx:190
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Copy the argument.
Definition: TClass.cxx:2319
static Int_t AutoBrowse(TObject *obj, TBrowser *browser)
Browse external object inherited from TObject.
Definition: TClass.cxx:1868
const type_info * GetTypeInfo() const
Definition: TClass.h:450
void(* DelFunc_t)(void *)
Definition: Rtypes.h:149
void * NewArray(Long_t nElements, ENewType defConstructor=kClassNew) const
Return a pointer to a newly allocated array of objects of this class.
Definition: TClass.cxx:4784
Int_t Size() const
Return size of object of this class.
Definition: TClass.cxx:5243
ROOT::MergeFunc_t fMerge
saved info to call a IsA member function
Definition: TClass.h:213
virtual void Dump() const
Dump contents of object on stdout.
Definition: TObject.cxx:324
void AdoptSchemaRules(ROOT::Detail::TSchemaRuleSet *rules)
Adopt a new set of Data Model Evolution rules.
Definition: TClass.cxx:1822
TVirtualStreamerInfo * GetStreamerInfoAbstractEmulated(Int_t version=0) const
For the case where the requestor class is emulated and this class is abstract, returns a pointer to t...
Definition: TClass.cxx:4339
EState
Definition: TClass.h:115
TList * GetListOfFunctionTemplates(Bool_t load=kTRUE)
Return list containing the TEnums of a class.
Definition: TClass.cxx:3494