Logo ROOT   master
Reference Guide
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 // TClass //
18 // //
19 // Dictionary of a class. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TDictionary.h"
24 #include "TString.h"
25 
26 #ifdef R__LESS_INCLUDES
27 class TObjArray;
28 #else
29 #include "TObjArray.h"
30 // Not used in this header file; user code should #include this directly.
31 // #include "TObjString.h"
32 // #include "ThreadLocalStorage.h"
33 // #include <set>
34 #endif
35 
36 #include <map>
37 #include <string>
38 #include <unordered_set>
39 #include <vector>
40 #include <atomic>
41 
42 class TBaseClass;
43 class TBrowser;
44 class TDataMember;
45 class TCling;
46 class TMethod;
47 class TRealData;
48 class TBuffer;
51 class TMethodCall;
52 class TVirtualIsAProxy;
53 class TVirtualRefProxy;
54 class THashTable;
55 class TListOfFunctions;
57 class TListOfDataMembers;
58 class TListOfEnums;
59 class TViewPubFunctions;
61 class TFunctionTemplate;
62 class TProtoClass;
63 
64 namespace ROOT {
65  class TGenericClassInfo;
66  class TMapTypeToTClass;
67  class TMapDeclIdToTClass;
68  namespace Detail {
69  class TSchemaRuleSet;
70  class TCollectionProxyInfo;
71  }
72  namespace Internal {
73  class TCheckHashRecursiveRemoveConsistency;
74  }
75 }
76 
77 typedef ROOT::TMapTypeToTClass IdMap_t;
78 typedef ROOT::TMapDeclIdToTClass DeclIdMap_t;
79 
80 class TClass : public TDictionary {
81 
82 friend class TCling;
83 friend void ROOT::ResetClassVersion(TClass*, const char*, Short_t);
85 friend class TProtoClass;
87 
88 public:
89  // TClass status bits
90  enum EStatusBits {
91  kReservedLoading = BIT(7), // Internal status bits, set and reset only during initialization
92 
96  kUnloaded = BIT(16), // The library containing the dictionary for this class was
97  // loaded and has been unloaded from memory.
98  kIsTObject = BIT(17),
99  kIsForeign = BIT(18),
100  kIsEmulation = BIT(19), // Deprecated
101  kStartWithTObject = BIT(20), // see comments for IsStartingWithTObject()
102  kWarned = BIT(21),
104  kHasCustomStreamerMember = BIT(23) // The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based) automatic streamer.
105  };
107  enum ECheckSum {
109  kNoEnum = 1, // Used since v3.3
110  kReflexNoComment = 2, // Up to v5.34.18 (has no range/comment and no typedef at all)
111  kNoRange = 3, // Up to v5.17
112  kWithTypeDef = 4, // Up to v5.34.18 and v5.99/06
113  kReflex = 5, // Up to v5.34.18 (has no typedef at all)
114  kNoRangeCheck = 6, // Up to v5.34.18 and v5.99/06
115  kNoBaseCheckSum = 7, // Up to v5.34.18 and v5.99/06
117  };
118 
119  // Describe the current state of the TClass itself.
120  enum EState {
121  kNoInfo, // The state has not yet been initialized, i.e. the TClass
122  // was just created and/or there is no trace of it in the interpreter.
123  kForwardDeclared, // The interpreted knows the entity is a class but that's it.
124  kEmulated, // The information about the class only comes from a TStreamerInfo
125  kInterpreted, // The class is described completely/only in the interpreter database.
126  kHasTClassInit, // The class has a TClass proper bootstrap coming from a run
127  // through rootcling/genreflex/TMetaUtils and the library
128  // containing this dictionary has been loaded in memory.
130  kNamespaceForMeta // Very transient state necessary to bootstrap namespace entries
131  // in ROOT Meta w/o interpreter information
132  };
133 
134 private:
135 
136 
137 
139  // A class which is used to collect decl names starting from normalised
140  // names (typedef resolution is excluded here, just string manipulation
141  // is performed). At the heart of the implementation, an unordered set.
142  public:
143  TDeclNameRegistry(Int_t verbLevel=0);
144  void AddQualifiedName(const char *name);
145  Bool_t HasDeclName(const char *name) const;
147  private:
149  std::unordered_set<std::string> fClassNamesSet;
150  mutable std::atomic_flag fSpinLock; // MSVC doesn't support = ATOMIC_FLAG_INIT;
151  };
152 
154  // Trivial RAII used to insert names in the registry
156  const char* fName;
158  public:
159  InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry);
161  };
162 
163  // TClass objects can be created as a result of opening a TFile (in which
164  // they are in emulated mode) or as a result of loading the dictionary for
165  // the corresponding class. When a dictionary is loaded any pre-existing
166  // emulated TClass is replaced by the one created/coming from the dictionary.
167  // To have a reference that always point to the 'current' TClass object for
168  // a given class, one should use a TClassRef.
169  // TClassRef works by holding on to the fPersistentRef which is updated
170  // atomically whenever a TClass is replaced. During the replacement the
171  // value of fPersistentRef is set to zero, leading the TClassRef to call
172  // TClass::GetClass which is also locked by the replacement. At the end
173  // of the replacement, fPersistentRef points to the new TClass object.
174  std::atomic<TClass**> fPersistentRef;//!Persistent address of pointer to this TClass object and its successors.
175 
176  typedef std::atomic<std::map<std::string, TObjArray*>*> ConvSIMap_t;
177 
178  mutable TObjArray *fStreamerInfo; //Array of TVirtualStreamerInfo
179  mutable ConvSIMap_t fConversionStreamerInfo; //Array of the streamer infos derived from another class.
180  TList *fRealData; //linked list for persistent members including base classes
181  std::atomic<TList*> fBase; //linked list for base classes
182  TListOfDataMembers *fData; //linked list for data members
183 
184  std::atomic<TListOfEnums*> fEnums; //linked list for the enums
185  TListOfFunctionTemplates *fFuncTemplate; //linked list for function templates [Not public until implemented as active list]
186  std::atomic<TListOfFunctions*> fMethod; //linked list for methods
187 
188  TViewPubDataMembers*fAllPubData; //all public data members (including from base classes)
189  TViewPubFunctions *fAllPubMethod; //all public methods (including from base classes)
190  mutable TList *fClassMenuList; //list of class menu items
191 
192  const char *fDeclFileName; //name of class declaration file
193  const char *fImplFileName; //name of class implementation file
194  Short_t fDeclFileLine; //line of class declaration
195  Short_t fImplFileLine; //line of class implementation
196  UInt_t fInstanceCount; //number of instances of this class
197  UInt_t fOnHeap; //number of instances on heap
198  mutable std::atomic<UInt_t> fCheckSum; //checksum of data members and base classes
199  TVirtualCollectionProxy *fCollectionProxy; //Collection interface
200  Version_t fClassVersion; //Class version Identifier
201  ClassInfo_t *fClassInfo; //pointer to CINT class info class
202  TString fContextMenuTitle;//context menu title
203  const std::type_info *fTypeInfo; //pointer to the C++ type information.
204  ShowMembersFunc_t fShowMembers; //pointer to the class's ShowMembers function
205  TClassStreamer *fStreamer; //pointer to streamer function
206  TString fSharedLibs; //shared libraries containing class code
207 
208  TVirtualIsAProxy *fIsA; //!pointer to the class's IsA proxy.
209  IsAGlobalFunc_t fGlobalIsA; //pointer to a global IsA function.
210  mutable std::atomic<TMethodCall*> fIsAMethod; //!saved info to call a IsA member function
211 
212  ROOT::MergeFunc_t fMerge; //pointer to a function implementing Merging objects of this class.
213  ROOT::ResetAfterMergeFunc_t fResetAfterMerge; //pointer to a function implementing Merging objects of this class.
214  ROOT::NewFunc_t fNew; //pointer to a function newing one object.
215  ROOT::NewArrFunc_t fNewArray; //pointer to a function newing an array of objects.
216  ROOT::DelFunc_t fDelete; //pointer to a function deleting one object.
217  ROOT::DelArrFunc_t fDeleteArray; //pointer to a function deleting an array of objects.
218  ROOT::DesFunc_t fDestructor; //pointer to a function call an object's destructor.
219  ROOT::DirAutoAdd_t fDirAutoAdd; //pointer which implements the Directory Auto Add feature for this class.']'
220  ClassStreamerFunc_t fStreamerFunc; //Wrapper around this class custom Streamer member function.
221  ClassConvStreamerFunc_t fConvStreamerFunc; //Wrapper around this class custom conversion Streamer member function.
222  Int_t fSizeof; //Sizeof the class.
223 
224  Int_t fCanSplit; //!Indicates whether this class can be split or not.
225  mutable std::atomic<Long_t> fProperty; //!Property
226  mutable Long_t fClassProperty; //!C++ Property of the class (is abstract, has virtual table, etc.)
227 
228  // fHasRootPcmInfo needs to be atomic as long as GetListOfBases needs to modify it.
229  std::atomic<Bool_t> fHasRootPcmInfo; //!Whether info was loaded from a root pcm.
230  mutable std::atomic<Bool_t> fCanLoadClassInfo; //!Indicates whether the ClassInfo is supposed to be available.
231  mutable std::atomic<Bool_t> fIsOffsetStreamerSet; //!saved remember if fOffsetStreamer has been set.
232  mutable std::atomic<Bool_t> fVersionUsed; //!Indicates whether GetClassVersion has been called
233 
235  kNotInitialized = 0,
236  kSet = BIT(0),
237  // kInconsistent when kSet & !kConsistent.
238  kConsistentHash = BIT(1)
239  };
241  return l & static_cast<UChar_t>(r);
242  }
243  mutable std::atomic<UChar_t> fRuntimeProperties; //! Properties that can only be evaluated at run-time
244 
245  mutable Long_t fOffsetStreamer; //!saved info to call Streamer
246  Int_t fStreamerType; //!cached of the streaming method to use
247  EState fState; //!Current 'state' of the class (Emulated,Interpreted,Loaded)
248  mutable std::atomic<TVirtualStreamerInfo*> fCurrentInfo; //!cached current streamer info.
249  mutable std::atomic<TVirtualStreamerInfo*> fLastReadInfo; //!cached streamer info used in the last read.
250  TVirtualRefProxy *fRefProxy; //!Pointer to reference proxy if this class represents a reference
251  ROOT::Detail::TSchemaRuleSet *fSchemaRules; //! Schema evolution rules
252 
253  typedef void (*StreamerImpl_t)(const TClass* pThis, void *obj, TBuffer &b, const TClass *onfile_class);
254 #ifdef R__NO_ATOMIC_FUNCTION_POINTER
255  mutable StreamerImpl_t fStreamerImpl; //! Pointer to the function implementing streaming for this class
256 #else
257  mutable std::atomic<StreamerImpl_t> fStreamerImpl; //! Pointer to the function implementing streaming for this class
258 #endif
259 
262  TMethod *GetClassMethod(Long_t faddr);
264  Int_t GetBaseClassOffsetRecurse(const TClass *toBase);
265  void Init(const char *name, Version_t cversion, const std::type_info *info,
266  TVirtualIsAProxy *isa,
267  const char *dfil, const char *ifil,
268  Int_t dl, Int_t il,
269  ClassInfo_t *classInfo,
270  Bool_t silent);
271  void ForceReload (TClass* oldcl);
272  void LoadClassInfo() const;
273 
274  static TClass *LoadClassDefault(const char *requestedname, Bool_t silent);
275  static TClass *LoadClassCustom(const char *requestedname, Bool_t silent);
276 
277  void SetClassVersion(Version_t version);
278  void SetClassSize(Int_t sizof) { fSizeof = sizof; }
280 
281  void SetStreamerImpl();
282 
283  void SetRuntimeProperties();
284 
285  // Various implementation for TClass::Stramer
286  static void StreamerExternal(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
287  static void StreamerTObject(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
288  static void StreamerTObjectInitialized(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
289  static void StreamerTObjectEmulated(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
290  static void StreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
291  static void ConvStreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
292  static void StreamerStreamerInfo(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
293  static void StreamerDefault(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
294 
295  static IdMap_t *GetIdMap(); //Map from typeid to TClass pointer
296  static DeclIdMap_t *GetDeclIdMap(); //Map from DeclId_t to TClass pointer
297  static std::atomic<Int_t> fgClassCount; //provides unique id for a each class
298  //stored in TObject::fUniqueID
299  static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry; // Store decl names of the forwardd and no info instances
300  static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char*);
301 
302  // Internal status bits, set and reset only during initialization and thus under the protection of the global lock.
304  // Internal streamer type.
306 
307  // These are the above-referenced hash tables. (The pointers are null
308  // if no entries have been made.)
310 
311 private:
312  TClass(const TClass& tc) = delete;
313  TClass& operator=(const TClass&) = delete;
314 
315 protected:
316  TVirtualStreamerInfo *FindStreamerInfo(TObjArray *arr, UInt_t checksum) const;
317  void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse);
318  void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse);
319  void GetMissingDictionariesWithRecursionCheck(TCollection &result, TCollection &visited, bool recurse);
320  void GetMissingDictionariesForPairElements(TCollection &result, TCollection &visited, bool recurse);
321 
322 public:
323  TClass();
324  TClass(const char *name, Bool_t silent = kFALSE);
325  TClass(const char *name, Version_t cversion, Bool_t silent = kFALSE);
326  TClass(const char *name, Version_t cversion, EState theState, Bool_t silent = kFALSE);
327  TClass(ClassInfo_t *info, Version_t cversion,
328  const char *dfil, const char *ifil = 0,
329  Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
330  TClass(const char *name, Version_t cversion,
331  const char *dfil, const char *ifil = 0,
332  Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
333  TClass(const char *name, Version_t cversion,
334  const std::type_info &info, TVirtualIsAProxy *isa,
335  const char *dfil, const char *ifil,
336  Int_t dl, Int_t il, Bool_t silent = kFALSE);
337  virtual ~TClass();
338 
339  void AddInstance(Bool_t heap = kFALSE) { fInstanceCount++; if (heap) fOnHeap++; }
340  void AddImplFile(const char *filename, int line);
341  static Bool_t AddRule(const char *rule);
342  static Int_t ReadRules(const char *filename);
343  static Int_t ReadRules();
345  virtual void Browse(TBrowser *b);
346  void BuildRealData(void *pointer=0, Bool_t isTransient = kFALSE);
347  void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl);
348  void CalculateStreamerOffset() const;
349  Bool_t CallShowMembers(const void* obj, TMemberInspector &insp, Bool_t isTransient = kFALSE) const;
350  Bool_t CanSplit() const;
352  Long_t ClassProperty() const;
353  TObject *Clone(const char *newname="") const;
355  void Draw(Option_t *option="");
356  void Dump() const { TDictionary::Dump(); }
357  void Dump(const void *obj, Bool_t noAddr = kFALSE) const;
358  char *EscapeChars(const char *text) const;
360  TVirtualStreamerInfo *GetConversionStreamerInfo( const char* onfile_classname, Int_t version ) const;
361  TVirtualStreamerInfo *FindConversionStreamerInfo( const char* onfile_classname, UInt_t checksum ) const;
362  TVirtualStreamerInfo *GetConversionStreamerInfo( const TClass* onfile_cl, Int_t version ) const;
363  TVirtualStreamerInfo *FindConversionStreamerInfo( const TClass* onfile_cl, UInt_t checksum ) const;
365  Bool_t HasDefaultConstructor(Bool_t testio = kFALSE) const;
369  UInt_t GetCheckSum(Bool_t &isvalid) const;
370  UInt_t GetCheckSum(ECheckSum code, Bool_t &isvalid) const;
372  TVirtualIsAProxy *GetIsAProxy() const;
373  TMethod *GetClassMethod(const char *name, const char *params, Bool_t objectIsConst = kFALSE);
374  TMethod *GetClassMethodWithPrototype(const char *name, const char *proto,
375  Bool_t objectIsConst = kFALSE,
378  Int_t GetClassSize() const { return Size(); }
379  TDataMember *GetDataMember(const char *datamember) const;
380  Long_t GetDataMemberOffset(const char *membername) const;
381  const char *GetDeclFileName() const;
383  ROOT::DelFunc_t GetDelete() const;
386  ClassInfo_t *GetClassInfo() const {
388  LoadClassInfo();
389  return fClassInfo;
390  }
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,
424  TMethod *GetMethodAny(const char *method);
425  TMethod *GetMethodAllAny(const char *method);
426  Int_t GetNdata();
427  ROOT::MergeFunc_t GetMerge() const;
429  ROOT::NewFunc_t GetNew() const;
431  Int_t GetNmethods();
432  TClass *const*GetPersistentRef() const { return fPersistentRef; }
433  TRealData *GetRealData(const char *name) const;
437  const char *GetSharedLibs();
439  EState GetState() const { return fState; }
440  TClassStreamer *GetStreamer() const;
443  const TObjArray *GetStreamerInfos() const { return fStreamerInfo; }
444  TVirtualStreamerInfo *GetStreamerInfo(Int_t version=0) const;
447  const std::type_info *GetTypeInfo() const { return fTypeInfo; };
448 
449  /// @brief Return 'true' if we can guarantee that if this class (or any class in
450  /// this class inheritance hierarchy) overload TObject::Hash it also starts
451  /// the RecursiveRemove process from its own destructor.
453  {
454  if (!fRuntimeProperties)
457  }
458  Bool_t HasDictionary() const;
459  static Bool_t HasDictionarySelection(const char* clname);
460  Bool_t HasLocalHashMember() const;
461  void GetMissingDictionaries(THashTable& result, bool recurse = false);
462  void IgnoreTObjectStreamer(Bool_t ignore=kTRUE);
463  Bool_t InheritsFrom(const char *cl) const;
464  Bool_t InheritsFrom(const TClass *cl) const;
465  void InterpretedShowMembers(void* obj, TMemberInspector &insp, Bool_t isTransient);
466  Bool_t IsFolder() const { return kTRUE; }
467  Bool_t IsLoaded() const;
468  Bool_t IsForeign() const;
470  Bool_t IsVersioned() const { return !( GetClassVersion()<=1 && IsForeign() ); }
471  Bool_t IsTObject() const;
472  static TClass *LoadClass(const char *requestedname, Bool_t silent);
473  void ls(Option_t *opt="") const;
474  void MakeCustomMenuList();
475  Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
476  void Move(void *arenaFrom, void *arenaTo) const;
477  void *New(ENewType defConstructor = kClassNew, Bool_t quiet = kFALSE) const;
478  void *New(void *arena, ENewType defConstructor = kClassNew) const;
479  void *NewArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
480  void *NewArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
481  virtual void PostLoadCheck();
482  Long_t Property() const;
483  Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
484  Int_t ReadBuffer(TBuffer &b, void *pointer);
486  void RemoveStreamerInfo(Int_t slot);
487  void ReplaceWith(TClass *newcl) const;
488  void ResetCaches();
489  void ResetClassInfo(Long_t tagnum);
490  void ResetClassInfo();
492  void ResetMenuList();
493  Int_t Size() const;
494  void SetCanSplit(Int_t splitmode);
496  void SetContextMenuTitle(const char *title);
499  void SetDeclFile(const char *name, int line) { fDeclFileName = name; fDeclFileLine = line; }
500  void SetDelete(ROOT::DelFunc_t deleteFunc);
501  void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc);
502  void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc);
503  void SetDestructor(ROOT::DesFunc_t destructorFunc);
504  void SetImplFileName(const char *implFileName) { fImplFileName = implFileName; }
505  void SetMerge(ROOT::MergeFunc_t mergeFunc);
507  void SetNew(ROOT::NewFunc_t newFunc);
508  void SetNewArray(ROOT::NewArrFunc_t newArrayFunc);
509  TVirtualStreamerInfo *SetStreamerInfo(Int_t version, const char *info="");
510  void SetUnloaded();
511  Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="");
512 
514  void AdoptStreamer(TClassStreamer *strm);
515  void AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
516  void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm);
519 
520  // Function to retrieve the TClass object and dictionary function
521  static void AddClass(TClass *cl);
522  static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass* cl);
523  static void RemoveClass(TClass *cl);
525  static TClass *GetClass(const char *name, Bool_t load = kTRUE, Bool_t silent = kFALSE);
526  static TClass *GetClass(const std::type_info &typeinfo, Bool_t load = kTRUE, Bool_t silent = kFALSE);
527  static TClass *GetClass(ClassInfo_t *info, Bool_t load = kTRUE, Bool_t silent = kFALSE);
528  template<typename T>
529  static TClass *GetClass(Bool_t load = kTRUE, Bool_t silent = kFALSE);
530  static Bool_t GetClass(DeclId_t id, std::vector<TClass*> &classes);
531  static DictFuncPtr_t GetDict (const char *cname);
532  static DictFuncPtr_t GetDict (const std::type_info &info);
533 
534  static Int_t AutoBrowse(TObject *obj, TBrowser *browser);
535  static ENewType IsCallingNew();
536  static TClass *Load(TBuffer &b);
537  void Store(TBuffer &b) const;
538 
539  // Pseudo-method apply to the 'obj'. In particular those are used to
540  // implement TObject like methods for non-TObject classes
541 
542  Int_t Browse(void *obj, TBrowser *b) const;
543  void DeleteArray(void *ary, Bool_t dtorOnly = kFALSE);
544  void Destructor(void *obj, Bool_t dtorOnly = kFALSE);
545  void *DynamicCast(const TClass *base, void *obj, Bool_t up = kTRUE);
546  const void *DynamicCast(const TClass *base, const void *obj, Bool_t up = kTRUE);
547  Bool_t IsFolder(void *obj) const;
548 
549  inline void Streamer(void *obj, TBuffer &b, const TClass *onfile_class = 0) const
550  {
551  // Inline for performance, skipping one function call.
552 #ifdef R__NO_ATOMIC_FUNCTION_POINTER
553  fStreamerImpl(this,obj,b,onfile_class);
554 #else
555  auto t = fStreamerImpl.load();
556  t(this,obj,b,onfile_class);
557 #endif
558  }
559 
560  ClassDef(TClass,0) //Dictionary containing class information
561 };
562 
563 namespace ROOT {
564 namespace Internal {
565 template <typename T>
566 TClass *GetClassHelper(Bool_t, Bool_t, std::true_type)
567 {
568  return T::Class();
569 }
570 
571 template <typename T>
572 TClass *GetClassHelper(Bool_t load, Bool_t silent, std::false_type)
573 {
574  return TClass::GetClass(typeid(T), load, silent);
575 }
576 
577 } // namespace Internal
578 } // namespace ROOT
579 
580 template <typename T>
582 {
584  return ROOT::Internal::GetClassHelper<T>(load, silent, tag);
585 }
586 
587 namespace ROOT {
588 
589 template <typename T> TClass *GetClass(T * /* dummy */) { return TClass::GetClass<T>(); }
590 template <typename T> TClass *GetClass(const T * /* dummy */) { return TClass::GetClass<T>(); }
591 
592 #ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
593  // This can only be used when the template overload resolution can distinguish between T* and T**
594  template <typename T> TClass* GetClass( T** /* dummy */) { return TClass::GetClass<T>(); }
595  template <typename T> TClass* GetClass(const T** /* dummy */) { return TClass::GetClass<T>(); }
596  template <typename T> TClass* GetClass( T* const* /* dummy */) { return TClass::GetClass<T>(); }
597  template <typename T> TClass* GetClass(const T* const* /* dummy */) { return TClass::GetClass<T>(); }
598 #endif
599 
600  extern TClass *CreateClass(const char *cname, Version_t id,
601  const char *dfil, const char *ifil,
602  Int_t dl, Int_t il);
603 }
604 
605 #endif // ROOT_TClass
void AddQualifiedName(const char *name)
Extract this part of the name.
Definition: TClass.cxx:187
Short_t GetImplFileLine() const
Definition: TClass.h:408
void ResetCaches()
To clean out all caches.
Definition: TClass.cxx:4120
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Definition: TClass.cxx:2352
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:4457
static TClass * LoadClassCustom(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5613
ShowMembersFunc_t fShowMembers
Definition: TClass.h:204
Bool_t HasInterpreterInfoInMemory() const
Definition: TClass.h:366
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method). ...
Definition: TClass.cxx:5759
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Definition: TClass.cxx:2267
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3553
ESTLType
Definition: ESTLType.h:28
An array of TObjects.
Definition: TObjArray.h:37
ROOT::NewArrFunc_t fNewArray
Definition: TClass.h:215
void(* ClassStreamerFunc_t)(TBuffer &, void *)
Definition: Rtypes.h:70
std::atomic< TMethodCall * > fIsAMethod
Definition: TClass.h:210
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
Definition: TClass.cxx:1837
virtual void PostLoadCheck()
Do the initialization that can only be done after the CINT dictionary has been fully populated and ca...
Definition: TClass.cxx:5769
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
Definition: Rtypes.h:92
void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse)
Verify the base classes always.
Definition: TClass.cxx:3827
Returns the available number of logical cores.
Definition: RNumpyDS.hxx:30
short Version_t
Definition: RtypesCore.h:63
void AdoptReferenceProxy(TVirtualRefProxy *proxy)
Adopt the Reference proxy pointer to indicate that this class represents a reference.
Definition: TClass.cxx:6446
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:4476
TLine * line
void(* DelArrFunc_t)(void *)
Definition: Rtypes.h:109
const char * GetImplFileName() const
Definition: TClass.h:407
static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass *cl)
static: Add a TClass* to the map of classes.
Definition: TClass.cxx:494
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class &#39;classname&#39; for the layout represented by &#39;checksum&#39; ...
Definition: TClass.cxx:6939
void SetDeclFile(const char *name, int line)
Definition: TClass.h:499
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class &#39;classname&#39; for version number &#39;version&#39; to this clas...
Definition: TClass.cxx:6842
ConvSIMap_t fConversionStreamerInfo
Definition: TClass.h:179
unsigned int UInt_t
Definition: CPyCppyy.h:44
void SetDelete(ROOT::DelFunc_t deleteFunc)
Install a new wrapper around &#39;delete&#39;.
Definition: TClass.cxx:6759
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Definition: Rtypes.h:112
const char Option_t
Definition: RtypesCore.h:64
Dictionary for function template This class describes one single function template.
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm)
Install a new member streamer (p will be copied).
Definition: TClass.cxx:6502
void SetConvStreamerFunc(ClassConvStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom conversion streamer.
Definition: TClass.cxx:6703
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
Short_t GetDeclFileLine() const
Definition: TClass.h:382
double T(double x)
Definition: ChebyshevPol.h:34
ENewType
Definition: TClass.h:106
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
Definition: TClass.cxx:3607
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition: TClass.cxx:4244
std::atomic< TListOfEnums * > fEnums
Definition: TClass.h:184
static void StreamerExternal(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
There is special streamer for the class.
Definition: TClass.cxx:6546
void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl)
Build the list of real data for an emulated class.
Definition: TClass.cxx:2059
TObject * Clone(const char *newname="") const
Create a Clone of this TClass object using a different name but using the same &#39;dictionary&#39;.
Definition: TClass.cxx:2362
void SetClassVersion(Version_t version)
Private function.
Definition: TClass.cxx:5487
TViewPubFunctions * fAllPubMethod
Definition: TClass.h:189
#define BIT(n)
Definition: Rtypes.h:83
Persistent version of a TClass.
Definition: TProtoClass.h:38
int Int_t
Definition: CPyCppyy.h:43
void ResetMenuList()
Resets the menu list to it&#39;s standard value.
Definition: TClass.cxx:4146
std::atomic< Bool_t > fHasRootPcmInfo
C++ Property of the class (is abstract, has virtual table, etc.)
Definition: TClass.h:229
static THashTable * fgClassTypedefHash
Definition: TClass.h:309
const std::type_info * GetTypeInfo() const
Definition: TClass.h:447
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:4502
std::atomic< std::map< std::string, TObjArray * > * > ConvSIMap_t
Persistent address of pointer to this TClass object and its successors.
Definition: TClass.h:176
void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc)
Install a new wrapper around &#39;delete []&#39;.
Definition: TClass.cxx:6767
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:4430
ROOT::NewArrFunc_t GetNewArray() const
ROOT::DirAutoAdd_t fDirAutoAdd
Definition: TClass.h:219
static void RemoveClassDeclId(TDictionary::DeclId_t id)
Definition: TClass.cxx:519
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
Bool_t HasInterpreterInfo() const
Definition: TClass.h:367
static void StreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6594
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition: TClass.cxx:2869
ROOT::DelArrFunc_t GetDeleteArray() const
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3663
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Definition: TClass.cxx:3540
Bool_t HasDictionary() const
Check whether a class has a dictionary or not.
Definition: TClass.cxx:3806
TCollection * GetListOfMethodOverloads(const char *name) const
Return the collection of functions named "name".
Definition: TClass.cxx:3727
ROOT::DelFunc_t GetDelete() const
Basic string class.
Definition: TString.h:131
void GetMissingDictionariesWithRecursionCheck(TCollection &result, TCollection &visited, bool recurse)
From the second level of recursion onwards it is different state check.
Definition: TClass.cxx:3890
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2852
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:5741
TString fContextMenuTitle
Definition: TClass.h:202
static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char *)
Definition: TClass.cxx:3275
TVirtualIsAProxy * GetIsAProxy() const
Return the proxy implementing the IsA functionality.
Definition: TClass.cxx:2910
TVirtualStreamerInfo * GetCurrentStreamerInfo()
Definition: TClass.h:392
bool Bool_t
Definition: RtypesCore.h:61
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
Definition: TClass.cxx:3745
void SetContextMenuTitle(const char *title)
Change (i.e. set) the title of the TNamed.
Definition: TClass.cxx:6033
TVirtualRefProxy * fRefProxy
cached streamer info used in the last read.
Definition: TClass.h:250
const char * GetContextMenuTitle() const
Definition: TClass.h:391
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:6572
Int_t fStreamerType
saved info to call Streamer
Definition: TClass.h:246
ROOT::NewFunc_t GetNew() const
Abstract base class for accessing the data-members of a class.
void SetImplFileName(const char *implFileName)
Definition: TClass.h:504
void ReplaceWith(TClass *newcl) const
Definition: TClass.cxx:4037
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:6616
void AdoptStreamer(TClassStreamer *strm)
Adopt a TClassStreamer object.
Definition: TClass.cxx:6652
UInt_t GetHeapInstanceCount() const
Definition: TClass.h:418
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:231
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4287
std::atomic< TVirtualStreamerInfo * > fLastReadInfo
cached current streamer info.
Definition: TClass.h:249
void SetClassSize(Int_t sizof)
Definition: TClass.h:278
Short_t fImplFileLine
Definition: TClass.h:195
void DeleteArray(void *ary, Bool_t dtorOnly=kFALSE)
Explicitly call operator delete[] for an array.
Definition: TClass.cxx:5348
ROOT::NewFunc_t fNew
Definition: TClass.h:214
char * EscapeChars(const char *text) const
Introduce an escape character (@) in front of a special chars.
Definition: TClass.cxx:2524
void ResetInstanceCount()
Definition: TClass.h:491
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:6516
void Move(void *arenaFrom, void *arenaTo) const
Register the fact that an object was moved from the memory location &#39;arenaFrom&#39; to the memory locatio...
Definition: TClass.cxx:4230
static IdMap_t * GetIdMap()
Definition: TClass.cxx:452
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:6581
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
Definition: TClass.cxx:2746
TDeclNameRegistry & fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:157
TClass * GetClass(T *)
Definition: TClass.h:589
Int_t GetBaseClassOffsetRecurse(const TClass *toBase)
Return data member offset to the base class "cl".
Definition: TClass.cxx:2660
THashTable implements a hash table to store TObject&#39;s.
Definition: THashTable.h:35
TMethod * FindClassOrBaseMethodWithId(DeclId_t faddr)
Find a method with decl id in this class or its bases.
Definition: TClass.cxx:4343
#define ClassDef(name, id)
Definition: Rtypes.h:322
void Dump() const
Dump contents of object on stdout.
Definition: TClass.h:356
void Class()
Definition: Class.C:29
std::atomic< TList * > fBase
Definition: TClass.h:181
static Int_t ReadRules()
Read the class.rules files from the default location:.
Definition: TClass.cxx:1767
ClassStreamerFunc_t fStreamerFunc
Definition: TClass.h:220
void Init(const char *name, Version_t cversion, const std::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:1326
ECheckSum
Definition: TClass.h:107
static DeclIdMap_t * GetDeclIdMap()
Definition: TClass.cxx:463
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:4605
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:72
ROOT::ResetAfterMergeFunc_t fResetAfterMerge
Definition: TClass.h:213
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process&#39;s memory.
Definition: TClass.cxx:5724
void InterpretedShowMembers(void *obj, TMemberInspector &insp, Bool_t isTransient)
Do a ShowMembers() traversal of all members and base classes&#39; members using the reflection informatio...
Definition: TClass.cxx:2189
void ResetClassInfo()
Make sure that the current ClassInfo is up to date.
Definition: TClass.cxx:4085
void SetStreamerFunc(ClassStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom streamer.
Definition: TClass.cxx:6680
EFunctionMatchMode
Definition: TDictionary.h:155
EState GetState() const
Definition: TClass.h:439
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function)...
Definition: TClass.cxx:2902
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:5056
ClassInfo_t * GetClassInfo() const
Definition: TClass.h:386
void *(* NewFunc_t)(void *)
Definition: Rtypes.h:106
void RegisterStreamerInfo(TVirtualStreamerInfo *info)
Register the StreamerInfo in the given slot, change the State of the TClass as appropriate.
Definition: TClass.cxx:7035
Method or function calling interface.
Definition: TMethodCall.h:37
std::atomic< Bool_t > fVersionUsed
saved remember if fOffsetStreamer has been set.
Definition: TClass.h:232
This class defines an interface to the cling C++ interpreter.
Definition: TCling.h:99
TListOfFunctionTemplates * fFuncTemplate
Definition: TClass.h:185
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
Definition: TClass.cxx:5714
TClass *(* DictFuncPtr_t)()
Definition: Rtypes.h:78
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:6537
ROOT::MergeFunc_t GetMerge() const
const TObjArray * GetStreamerInfos() const
Definition: TClass.h:443
TViewPubDataMembers * fAllPubData
Definition: TClass.h:188
TList * fClassMenuList
Definition: TClass.h:190
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:6134
ROOT::Detail::TSchemaRuleSet * fSchemaRules
Pointer to reference proxy if this class represents a reference.
Definition: TClass.h:251
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
Definition: Rtypes.h:71
std::atomic< StreamerImpl_t > fStreamerImpl
Definition: TClass.h:257
TList * fRealData
Definition: TClass.h:180
ROOT::DesFunc_t GetDestructor() const
EStreamerType
Definition: TClass.h:305
A doubly linked list.
Definition: TList.h:44
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:2610
const char * fImplFileName
Definition: TClass.h:193
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
Definition: Rtypes.h:113
void ls(Option_t *opt="") const
The ls function lists the contents of a class on stdout.
Definition: TClass.cxx:4161
ShowMembersFunc_t GetShowMembersWrapper() const
Definition: TClass.h:438
void AddInstance(Bool_t heap=kFALSE)
Definition: TClass.h:339
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:1978
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Int_t fCanSplit
Definition: TClass.h:224
void SetNew(ROOT::NewFunc_t newFunc)
Install a new wrapper around &#39;new&#39;.
Definition: TClass.cxx:6743
static DictFuncPtr_t GetDict(const char *cname)
Return a pointer to the dictionary loading function generated by rootcint.
Definition: TClass.cxx:3299
std::atomic< TVirtualStreamerInfo * > fCurrentInfo
Current &#39;state&#39; of the class (Emulated,Interpreted,Loaded)
Definition: TClass.h:248
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
void *(* NewArrFunc_t)(Long_t size, void *arena)
Definition: Rtypes.h:107
Bool_t HasLocalHashMember() const
void(* StreamerImpl_t)(const TClass *pThis, void *obj, TBuffer &b, const TClass *onfile_class)
Schema evolution rules.
Definition: TClass.h:253
ROOT::R::TRInterface & r
Definition: Object.C:4
UInt_t GetInstanceCount() const
Definition: TClass.h:417
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition: TClass.cxx:6822
TVirtualStreamerInfo * GetLastReadInfo() const
Definition: TClass.h:396
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:6464
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition: TClass.cxx:4186
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:3873
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
Definition: TClass.cxx:2563
void SetDestructor(ROOT::DesFunc_t destructorFunc)
Install a new wrapper around the destructor.
Definition: TClass.cxx:6775
void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse)
Verify the Data Members.
Definition: TClass.cxx:3844
void SetGlobalIsA(IsAGlobalFunc_t)
This function installs a global IsA function for this class.
Definition: TClass.cxx:6064
void Store(TBuffer &b) const
Store class description on I/O buffer.
Definition: TClass.cxx:5672
void SetUnloaded()
Call this method to indicate that the shared library containing this class&#39;s code has been removed (u...
Definition: TClass.cxx:6073
Collection abstract base class.
Definition: TCollection.h:63
void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc)
Install a new wrapper around the directory auto add function.
Definition: TClass.cxx:6786
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
Definition: TClass.cxx:5231
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
Definition: TClass.cxx:4737
static void StreamerTObject(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects.
Definition: TClass.cxx:6558
ROOT::DirAutoAdd_t GetDirectoryAutoAdd() const
void Draw(Option_t *option="")
Draw detailed class inheritance structure.
Definition: TClass.cxx:2442
Int_t Size() const
Return size of object of this class.
Definition: TClass.cxx:5516
TClass * CreateClass(const char *cname, Version_t id, const std::type_info &info, TVirtualIsAProxy *isa, const char *dfil, const char *ifil, Int_t dl, Int_t il)
Global function called by a class&#39; static Dictionary() method (see the ClassDef macro).
Definition: TClass.cxx:5681
TClass * GetClassHelper(Bool_t, Bool_t, std::true_type)
Definition: TClass.h:566
void GetMissingDictionaries(THashTable &result, bool recurse=false)
Get the classes that have a missing dictionary starting from this one.
Definition: TClass.cxx:3987
short Short_t
Definition: RtypesCore.h:37
The TRealData class manages the effective list of all data members for a given class.
Definition: TRealData.h:30
virtual void Browse(TBrowser *b)
This method is called by a browser to get the class information.
Definition: TClass.cxx:1957
Bool_t CanIgnoreTObjectStreamer()
Definition: TClass.h:351
InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry)
Definition: TClass.cxx:239
TClass *const * GetPersistentRef() const
Definition: TClass.h:432
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TVirtualCollectionProxy * fCollectionProxy
Definition: TClass.h:199
TClass * GetBaseDataMember(const char *datamember)
Return pointer to (base) class that contains datamember.
Definition: TClass.cxx:2782
ROOT::ESTLType GetCollectionType() const
Return the &#39;type&#39; of the STL the TClass is representing.
Definition: TClass.cxx:2841
ROOT::TMapTypeToTClass IdMap_t
Definition: TClass.h:77
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4770
std::atomic< UChar_t > fRuntimeProperties
Definition: TClass.h:243
UInt_t fInstanceCount
Definition: TClass.h:196
TVirtualRefProxy * GetReferenceProxy() const
Definition: TClass.h:434
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Definition: TClass.cxx:5850
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
Definition: TClass.h:549
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:6255
UInt_t fOnHeap
Definition: TClass.h:197
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:33
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:6008
TListOfFunctions * GetMethodList()
Return (create an empty one if needed) the list of functions.
Definition: TClass.cxx:4258
Bool_t HasConsistentHashMember()
Return &#39;true&#39; if we can guarantee that if this class (or any class in this class inheritance hierarch...
Definition: TClass.h:452
View implementing the TList interface and giving access all the TFunction describing public methods i...
const Bool_t kFALSE
Definition: RtypesCore.h:90
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:6631
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
Definition: TClass.cxx:503
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
Definition: TClass.cxx:3762
TMethod * GetClassMethod(Long_t faddr)
Look for a method in this class that has the interface function address faddr.
Definition: TClass.cxx:4386
ROOT::DesFunc_t fDestructor
Definition: TClass.h:218
void SetRuntimeProperties()
Internal routine to set calculate the class properties that can only be known at run-time, for example whether the Hash member function and the destructor are consistent.
Definition: TClass.cxx:5958
std::atomic_flag fSpinLock
Definition: TClass.h:150
Int_t fSizeof
Definition: TClass.h:222
std::unordered_set< std::string > fClassNamesSet
Definition: TClass.h:149
void ForceReload(TClass *oldcl)
we found at least one equivalent.
Definition: TClass.cxx:1301
void SetCanSplit(Int_t splitmode)
Set the splitability of this class:
Definition: TClass.cxx:5470
std::atomic< TListOfFunctions * > fMethod
Definition: TClass.h:186
Bool_t CanSplitBaseAllow()
Pointer to the function implementing streaming for this class.
Definition: TClass.cxx:2194
ROOT::DelArrFunc_t fDeleteArray
Definition: TClass.h:217
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:2152
Version_t GetClassVersion() const
Definition: TClass.h:377
TClass & operator=(const TClass &)=delete
TObjArray * fStreamerInfo
Definition: TClass.h:178
std::atomic< TClass ** > fPersistentRef
Definition: TClass.h:174
Long_t fOffsetStreamer
Properties that can only be evaluated at run-time.
Definition: TClass.h:245
EState fState
cached of the streaming method to use
Definition: TClass.h:247
ROOT::ResetAfterMergeFunc_t GetResetAfterMerge() const
TText * text
ROOT::DelFunc_t fDelete
Definition: TClass.h:216
void RemoveStreamerInfo(Int_t slot)
Remove and delete the StreamerInfo in the given slot.
Definition: TClass.cxx:7059
EStatusBits
Definition: TObject.h:57
Long_t GetDataMemberOffset(const char *membername) const
return offset for member name.
Definition: TClass.cxx:3354
int type
Definition: TGX11.cxx:120
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
Definition: TClass.cxx:477
TList * GetListOfRealData() const
Definition: TClass.h:404
Bool_t HasDataMemberInfo() const
Definition: TClass.h:364
Bool_t HasDefaultConstructor(Bool_t testio=kFALSE) const
virtual void Dump() const
Dump contents of object on stdout.
Definition: TObject.cxx:267
TClass()
Definition: TClass.cxx:1036
const std::type_info * fTypeInfo
Definition: TClass.h:203
virtual ~TClass()
TClass dtor. Deletes all list that might have been created.
Definition: TClass.cxx:1611
void SetStreamerImpl()
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition: TClass.cxx:5979
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:4314
static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:299
friend bool operator &(UChar_t l, ERuntimeProperties r)
Definition: TClass.h:240
TClass *(* IsAGlobalFunc_t)(const TClass *, const void *obj)
Definition: Rtypes.h:94
TVirtualStreamerInfo * DetermineCurrentStreamerInfo()
Determine and set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5496
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:2923
TVirtualIsAProxy * fIsA
Definition: TClass.h:208
std::atomic< Long_t > fProperty
Indicates whether this class can be split or not.
Definition: TClass.h:225
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5561
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
Definition: TClass.cxx:3340
IsAGlobalFunc_t fGlobalIsA
pointer to the class&#39;s IsA proxy.
Definition: TClass.h:209
ROOT::TMapDeclIdToTClass DeclIdMap_t
Definition: TClass.h:78
Long_t fClassProperty
Property.
Definition: TClass.h:226
TDeclNameRegistry(Int_t verbLevel=0)
TDeclNameRegistry class constructor.
Definition: TClass.cxx:176
Int_t GetClassSize() const
Definition: TClass.h:378
Mother of all ROOT objects.
Definition: TObject.h:37
Short_t fDeclFileLine
Definition: TClass.h:194
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition: TClass.cxx:3524
void(* DelFunc_t)(void *)
Definition: Rtypes.h:108
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TClass.h:466
static std::atomic< Int_t > fgClassCount
Definition: TClass.h:297
typedef void((*Func_t)())
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5750
Version_t fClassVersion
Definition: TClass.h:200
TString fSharedLibs
Definition: TClass.h:206
void AddImplFile(const char *filename, int line)
Definition: TClass.cxx:1899
Bool_t HasDeclName(const char *name) const
Definition: TClass.cxx:214
std::atomic< UInt_t > fCheckSum
Definition: TClass.h:198
TListOfDataMembers * fData
Definition: TClass.h:182
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
Definition: TListOfEnums.h:32
ClassInfo_t * fClassInfo
Definition: TClass.h:201
auto * l
Definition: textangle.C:4
void(* DirAutoAdd_t)(void *, TDirectory *)
Definition: Rtypes.h:111
static TClass * LoadClassDefault(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5583
long Long_t
Definition: CPyCppyy.h:50
Bool_t IsVersioned() const
Definition: TClass.h:470
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
Definition: TClass.cxx:3774
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
static TClass * Load(TBuffer &b)
Load class description from I/O buffer and return class object.
Definition: TClass.cxx:5527
ClassConvStreamerFunc_t fConvStreamerFunc
Definition: TClass.h:221
const char * proto
Definition: civetweb.c:16604
const char * fDeclFileName
Definition: TClass.h:192
TClassStreamer * fStreamer
Definition: TClass.h:205
void SetMerge(ROOT::MergeFunc_t mergeFunc)
Install a new wrapper around &#39;Merge&#39;.
Definition: TClass.cxx:6727
void SetCurrentStreamerInfo(TVirtualStreamerInfo *info)
Set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5508
std::atomic< Bool_t > fCanLoadClassInfo
Whether info was loaded from a root pcm.
Definition: TClass.h:230
static void ConvStreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6603
void LoadClassInfo() const
Try to load the ClassInfo if available.
Definition: TClass.cxx:5636
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Definition: TClass.cxx:3316
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition: TClass.cxx:2894
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:4811
unsigned char UChar_t
Definition: RtypesCore.h:36
void SetResetAfterMerge(ROOT::ResetAfterMergeFunc_t resetFunc)
Install a new wrapper around &#39;ResetAfterMerge&#39;.
Definition: TClass.cxx:6735
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Definition: TClass.cxx:1879
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:4277
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition: TClass.cxx:6266
Abstract Interface class describing Streamer information for one class.
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:4668
static Bool_t HasDictionarySelection(const char *clname)
Check whether a class has a dictionary or ROOT can load one.
Definition: TClass.cxx:3817
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:4359
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition: TClass.cxx:3712
void SetNewArray(ROOT::NewArrFunc_t newArrayFunc)
Install a new wrapper around &#39;new []&#39;.
Definition: TClass.cxx:6751
const Bool_t kTRUE
Definition: RtypesCore.h:89
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Copy the argument.
Definition: TClass.cxx:2425
static Int_t AutoBrowse(TObject *obj, TBrowser *browser)
Browse external object inherited from TObject.
Definition: TClass.cxx:1913
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
Definition: TClass.cxx:3380
char name[80]
Definition: TGX11.cxx:109
ERuntimeProperties
Indicates whether GetClassVersion has been called.
Definition: TClass.h:234
ROOT::MergeFunc_t fMerge
saved info to call a IsA member function
Definition: TClass.h:212
void CalculateStreamerOffset() const
Calculate the offset between an object of this class to its base class TObject.
Definition: TClass.cxx:2130
void AdoptSchemaRules(ROOT::Detail::TSchemaRuleSet *rules)
Adopt a new set of Data Model Evolution rules.
Definition: TClass.cxx:1867
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition: TClass.cxx:4874
EState
Definition: TClass.h:120
void(* DesFunc_t)(void *)
Definition: Rtypes.h:110
TList * GetListOfFunctionTemplates(Bool_t load=kTRUE)
Return list containing the TEnums of a class.
Definition: TClass.cxx:3698