Logo ROOT   6.19/01
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 #include "TObjArray.h"
26 #include "TObjString.h"
27 
28 #include <map>
29 #include <string>
30 #include <set>
31 #include <unordered_set>
32 #include <vector>
33 
34 #include <atomic>
35 #include "ThreadLocalStorage.h"
36 
37 class TBaseClass;
38 class TBrowser;
39 class TDataMember;
40 class TCling;
41 class TMethod;
42 class TRealData;
43 class TBuffer;
46 class TMethodCall;
47 class TVirtualIsAProxy;
48 class TVirtualRefProxy;
49 class THashTable;
50 class TListOfFunctions;
52 class TListOfDataMembers;
53 class TListOfEnums;
54 class TViewPubFunctions;
56 class TFunctionTemplate;
57 class TProtoClass;
58 
59 namespace ROOT {
60  class TGenericClassInfo;
61  class TMapTypeToTClass;
62  class TMapDeclIdToTClass;
63  namespace Detail {
64  class TSchemaRuleSet;
65  class TCollectionProxyInfo;
66  }
67  namespace Internal {
68  class TCheckHashRecursiveRemoveConsistency;
69  }
70 }
71 
72 typedef ROOT::TMapTypeToTClass IdMap_t;
73 typedef ROOT::TMapDeclIdToTClass DeclIdMap_t;
74 
75 class TClass : public TDictionary {
76 
77 friend class TCling;
78 friend void ROOT::ResetClassVersion(TClass*, const char*, Short_t);
80 friend class TProtoClass;
82 
83 public:
84  // TClass status bits
85  enum EStatusBits {
86  kReservedLoading = BIT(7), // Internal status bits, set and reset only during initialization
87 
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
126  // in ROOT Meta w/o interpreter information
127  };
128 
129 private:
130 
131 
132 
134  // A class which is used to collect decl names starting from normalised
135  // names (typedef resolution is excluded here, just string manipulation
136  // is performed). At the heart of the implementation, an unordered set.
137  public:
138  TDeclNameRegistry(Int_t verbLevel=0);
139  void AddQualifiedName(const char *name);
140  Bool_t HasDeclName(const char *name) const;
142  private:
144  std::unordered_set<std::string> fClassNamesSet;
145  mutable std::atomic_flag fSpinLock; // MSVC doesn't support = ATOMIC_FLAG_INIT;
146  };
147 
149  // Trivial RAII used to insert names in the registry
151  const char* fName;
153  public:
154  InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry);
156  };
157 
158  // TClass objects can be created as a result of opening a TFile (in which
159  // they are in emulated mode) or as a result of loading the dictionary for
160  // the corresponding class. When a dictionary is loaded any pre-existing
161  // emulated TClass is replaced by the one created/coming from the dictionary.
162  // To have a reference that always point to the 'current' TClass object for
163  // a given class, one should use a TClassRef.
164  // TClassRef works by holding on to the fPersistentRef which is updated
165  // atomically whenever a TClass is replaced. During the replacement the
166  // value of fPersistentRef is set to zero, leading the TClassRef to call
167  // TClass::GetClass which is also locked by the replacement. At the end
168  // of the replacement, fPersistentRef points to the new TClass object.
169  std::atomic<TClass**> fPersistentRef;//!Persistent address of pointer to this TClass object and its successors.
170 
171  typedef std::atomic<std::map<std::string, TObjArray*>*> ConvSIMap_t;
172 
173  mutable TObjArray *fStreamerInfo; //Array of TVirtualStreamerInfo
174  mutable ConvSIMap_t fConversionStreamerInfo; //Array of the streamer infos derived from another class.
175  TList *fRealData; //linked list for persistent members including base classes
176  std::atomic<TList*> fBase; //linked list for base classes
177  TListOfDataMembers *fData; //linked list for data members
178 
179  std::atomic<TListOfEnums*> fEnums; //linked list for the enums
180  TListOfFunctionTemplates *fFuncTemplate; //linked list for function templates [Not public until implemented as active list]
181  std::atomic<TListOfFunctions*> fMethod; //linked list for methods
182 
183  TViewPubDataMembers*fAllPubData; //all public data members (including from base classes)
184  TViewPubFunctions *fAllPubMethod; //all public methods (including from base classes)
185  mutable TList *fClassMenuList; //list of class menu items
186 
187  const char *fDeclFileName; //name of class declaration file
188  const char *fImplFileName; //name of class implementation file
189  Short_t fDeclFileLine; //line of class declaration
190  Short_t fImplFileLine; //line of class implementation
191  UInt_t fInstanceCount; //number of instances of this class
192  UInt_t fOnHeap; //number of instances on heap
193  mutable std::atomic<UInt_t> fCheckSum; //checksum of data members and base classes
194  TVirtualCollectionProxy *fCollectionProxy; //Collection interface
195  Version_t fClassVersion; //Class version Identifier
196  ClassInfo_t *fClassInfo; //pointer to CINT class info class
197  TString fContextMenuTitle;//context menu title
198  const std::type_info *fTypeInfo; //pointer to the C++ type information.
199  ShowMembersFunc_t fShowMembers; //pointer to the class's ShowMembers function
200  TClassStreamer *fStreamer; //pointer to streamer function
201  TString fSharedLibs; //shared libraries containing class code
202 
203  TVirtualIsAProxy *fIsA; //!pointer to the class's IsA proxy.
204  IsAGlobalFunc_t fGlobalIsA; //pointer to a global IsA function.
205  mutable std::atomic<TMethodCall*> fIsAMethod; //!saved info to call a IsA member function
206 
207  ROOT::MergeFunc_t fMerge; //pointer to a function implementing Merging objects of this class.
208  ROOT::ResetAfterMergeFunc_t fResetAfterMerge; //pointer to a function implementing Merging objects of this class.
209  ROOT::NewFunc_t fNew; //pointer to a function newing one object.
210  ROOT::NewArrFunc_t fNewArray; //pointer to a function newing an array of objects.
211  ROOT::DelFunc_t fDelete; //pointer to a function deleting one object.
212  ROOT::DelArrFunc_t fDeleteArray; //pointer to a function deleting an array of objects.
213  ROOT::DesFunc_t fDestructor; //pointer to a function call an object's destructor.
214  ROOT::DirAutoAdd_t fDirAutoAdd; //pointer which implements the Directory Auto Add feature for this class.']'
215  ClassStreamerFunc_t fStreamerFunc; //Wrapper around this class custom Streamer member function.
216  ClassConvStreamerFunc_t fConvStreamerFunc; //Wrapper around this class custom conversion Streamer member function.
217  Int_t fSizeof; //Sizeof the class.
218 
219  Int_t fCanSplit; //!Indicates whether this class can be split or not.
220  mutable std::atomic<Long_t> fProperty; //!Property
221  mutable Long_t fClassProperty; //!C++ Property of the class (is abstract, has virtual table, etc.)
222 
223  // fHasRootPcmInfo needs to be atomic as long as GetListOfBases needs to modify it.
224  std::atomic<Bool_t> fHasRootPcmInfo; //!Whether info was loaded from a root pcm.
225  mutable std::atomic<Bool_t> fCanLoadClassInfo; //!Indicates whether the ClassInfo is supposed to be available.
226  mutable std::atomic<Bool_t> fIsOffsetStreamerSet; //!saved remember if fOffsetStreamer has been set.
227  mutable std::atomic<Bool_t> fVersionUsed; //!Indicates whether GetClassVersion has been called
228 
230  kNotInitialized = 0,
231  kSet = BIT(0),
232  // kInconsistent when kSet & !kConsistent.
233  kConsistentHash = BIT(1)
234  };
236  return l & static_cast<UChar_t>(r);
237  }
238  mutable std::atomic<UChar_t> fRuntimeProperties; //! Properties that can only be evaluated at run-time
239 
240  mutable Long_t fOffsetStreamer; //!saved info to call Streamer
241  Int_t fStreamerType; //!cached of the streaming method to use
242  EState fState; //!Current 'state' of the class (Emulated,Interpreted,Loaded)
243  mutable std::atomic<TVirtualStreamerInfo*> fCurrentInfo; //!cached current streamer info.
244  mutable std::atomic<TVirtualStreamerInfo*> fLastReadInfo; //!cached streamer info used in the last read.
245  TVirtualRefProxy *fRefProxy; //!Pointer to reference proxy if this class represents a reference
246  ROOT::Detail::TSchemaRuleSet *fSchemaRules; //! Schema evolution rules
247 
248  typedef void (*StreamerImpl_t)(const TClass* pThis, void *obj, TBuffer &b, const TClass *onfile_class);
249 #ifdef R__NO_ATOMIC_FUNCTION_POINTER
250  mutable StreamerImpl_t fStreamerImpl; //! Pointer to the function implementing streaming for this class
251 #else
252  mutable std::atomic<StreamerImpl_t> fStreamerImpl; //! Pointer to the function implementing streaming for this class
253 #endif
254 
257  TMethod *GetClassMethod(Long_t faddr);
259  Int_t GetBaseClassOffsetRecurse(const TClass *toBase);
260  void Init(const char *name, Version_t cversion, const std::type_info *info,
261  TVirtualIsAProxy *isa,
262  const char *dfil, const char *ifil,
263  Int_t dl, Int_t il,
264  ClassInfo_t *classInfo,
265  Bool_t silent);
266  void ForceReload (TClass* oldcl);
267  void LoadClassInfo() const;
268 
269  static TClass *LoadClassDefault(const char *requestedname, Bool_t silent);
270  static TClass *LoadClassCustom(const char *requestedname, Bool_t silent);
271 
272  void SetClassVersion(Version_t version);
273  void SetClassSize(Int_t sizof) { fSizeof = sizof; }
275 
276  void SetStreamerImpl();
277 
278  void SetRuntimeProperties();
279 
280  // Various implementation for TClass::Stramer
281  static void StreamerExternal(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
282  static void StreamerTObject(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
283  static void StreamerTObjectInitialized(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
284  static void StreamerTObjectEmulated(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
285  static void StreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
286  static void ConvStreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
287  static void StreamerStreamerInfo(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
288  static void StreamerDefault(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
289 
290  static IdMap_t *GetIdMap(); //Map from typeid to TClass pointer
291  static DeclIdMap_t *GetDeclIdMap(); //Map from DeclId_t to TClass pointer
292  static std::atomic<Int_t> fgClassCount; //provides unique id for a each class
293  //stored in TObject::fUniqueID
294  static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry; // Store decl names of the forwardd and no info instances
295  static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char*);
296 
297  // Internal status bits, set and reset only during initialization and thus under the protection of the global lock.
299  // Internal streamer type.
301 
302  // When a new class is created, we need to be able to find
303  // if there are any existing classes that have the same name
304  // after any typedefs are expanded. (This only really affects
305  // template arguments.) To avoid having to search through all classes
306  // in that case, we keep a hash table mapping from the fully
307  // typedef-expanded names to the original class names.
308  // An entry is made in the table only if they are actually different.
309  //
310  // In these objects, the TObjString base holds the typedef-expanded
311  // name (the hash key), and fOrigName holds the original class name
312  // (the value to which the key maps).
313  //
314  class TNameMapNode : public TObjString
315  {
316  public:
317  TNameMapNode (const char* typedf, const char* orig);
319  };
320 
321  // These are the above-referenced hash tables. (The pointers are null
322  // if no entries have been made.)
324 
325 private:
326  TClass(const TClass& tc) = delete;
327  TClass& operator=(const TClass&) = delete;
328 
329 protected:
330  TVirtualStreamerInfo *FindStreamerInfo(TObjArray *arr, UInt_t checksum) const;
331  void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse);
332  void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse);
333  void GetMissingDictionariesWithRecursionCheck(TCollection &result, TCollection &visited, bool recurse);
334  void GetMissingDictionariesForPairElements(TCollection &result, TCollection &visited, bool recurse);
335 
336 public:
337  TClass();
338  TClass(const char *name, Bool_t silent = kFALSE);
339  TClass(const char *name, Version_t cversion, Bool_t silent = kFALSE);
340  TClass(const char *name, Version_t cversion, EState theState, Bool_t silent = kFALSE);
341  TClass(ClassInfo_t *info, Version_t cversion,
342  const char *dfil, const char *ifil = 0,
343  Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
344  TClass(const char *name, Version_t cversion,
345  const char *dfil, const char *ifil = 0,
346  Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
347  TClass(const char *name, Version_t cversion,
348  const std::type_info &info, TVirtualIsAProxy *isa,
349  const char *dfil, const char *ifil,
350  Int_t dl, Int_t il, Bool_t silent = kFALSE);
351  virtual ~TClass();
352 
353  void AddInstance(Bool_t heap = kFALSE) { fInstanceCount++; if (heap) fOnHeap++; }
354  void AddImplFile(const char *filename, int line);
355  static Bool_t AddRule(const char *rule);
356  static Int_t ReadRules(const char *filename);
357  static Int_t ReadRules();
359  virtual void Browse(TBrowser *b);
360  void BuildRealData(void *pointer=0, Bool_t isTransient = kFALSE);
361  void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl);
362  void CalculateStreamerOffset() const;
363  Bool_t CallShowMembers(const void* obj, TMemberInspector &insp, Bool_t isTransient = kFALSE) const;
364  Bool_t CanSplit() const;
366  Long_t ClassProperty() const;
367  TObject *Clone(const char *newname="") const;
369  void Draw(Option_t *option="");
370  void Dump() const { TDictionary::Dump(); }
371  void Dump(const void *obj, Bool_t noAddr = kFALSE) const;
372  char *EscapeChars(const char *text) const;
374  TVirtualStreamerInfo *GetConversionStreamerInfo( const char* onfile_classname, Int_t version ) const;
375  TVirtualStreamerInfo *FindConversionStreamerInfo( const char* onfile_classname, UInt_t checksum ) const;
376  TVirtualStreamerInfo *GetConversionStreamerInfo( const TClass* onfile_cl, Int_t version ) const;
377  TVirtualStreamerInfo *FindConversionStreamerInfo( const TClass* onfile_cl, UInt_t checksum ) const;
383  UInt_t GetCheckSum(Bool_t &isvalid) const;
384  UInt_t GetCheckSum(ECheckSum code, Bool_t &isvalid) const;
386  TVirtualIsAProxy *GetIsAProxy() const;
387  TMethod *GetClassMethod(const char *name, const char *params, Bool_t objectIsConst = kFALSE);
388  TMethod *GetClassMethodWithPrototype(const char *name, const char *proto,
389  Bool_t objectIsConst = kFALSE,
392  Int_t GetClassSize() const { return Size(); }
393  TDataMember *GetDataMember(const char *datamember) const;
394  Long_t GetDataMemberOffset(const char *membername) const;
395  const char *GetDeclFileName() const;
397  ROOT::DelFunc_t GetDelete() const;
400  ClassInfo_t *GetClassInfo() const {
402  LoadClassInfo();
403  return fClassInfo;
404  }
405  const char *GetContextMenuTitle() const { return fContextMenuTitle; }
407  if (fCurrentInfo.load()) return fCurrentInfo;
408  else return DetermineCurrentStreamerInfo();
409  }
413  TList *GetListOfEnums(Bool_t load = kTRUE);
417  TCollection *GetListOfMethodOverloads(const char* name) const;
418  TList *GetListOfRealData() const { return fRealData; }
421  const char *GetImplFileName() const { return fImplFileName; }
423  TClass *GetActualClass(const void *object) const;
424  TClass *GetBaseClass(const char *classname);
425  TClass *GetBaseClass(const TClass *base);
426  Int_t GetBaseClassOffset(const TClass *toBase, void *address = 0, bool isDerivedObject = true);
427  TClass *GetBaseDataMember(const char *datamember);
432  UInt_t GetHeapInstanceCount() const { return fOnHeap; }
433  void GetMenuItems(TList *listitems);
434  TList *GetMenuList() const;
435  TMethod *GetMethod(const char *method, const char *params, Bool_t objectIsConst = kFALSE);
436  TMethod *GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst = kFALSE,
438  TMethod *GetMethodAny(const char *method);
439  TMethod *GetMethodAllAny(const char *method);
440  Int_t GetNdata();
441  ROOT::MergeFunc_t GetMerge() const;
443  ROOT::NewFunc_t GetNew() const;
445  Int_t GetNmethods();
446  TClass *const*GetPersistentRef() const { return fPersistentRef; }
447  TRealData *GetRealData(const char *name) const;
451  const char *GetSharedLibs();
453  EState GetState() const { return fState; }
454  TClassStreamer *GetStreamer() const;
457  const TObjArray *GetStreamerInfos() const { return fStreamerInfo; }
458  TVirtualStreamerInfo *GetStreamerInfo(Int_t version=0) const;
461  const std::type_info *GetTypeInfo() const { return fTypeInfo; };
462 
463  /// @brief Return 'true' if we can guarantee that if this class (or any class in
464  /// this class inheritance hierarchy) overload TObject::Hash it also starts
465  /// the RecursiveRemove process from its own destructor.
467  {
468  if (!fRuntimeProperties)
471  }
472  Bool_t HasDictionary() const;
473  static Bool_t HasDictionarySelection(const char* clname);
474  Bool_t HasLocalHashMember() const;
475  void GetMissingDictionaries(THashTable& result, bool recurse = false);
476  void IgnoreTObjectStreamer(Bool_t ignore=kTRUE);
477  Bool_t InheritsFrom(const char *cl) const;
478  Bool_t InheritsFrom(const TClass *cl) const;
479  void InterpretedShowMembers(void* obj, TMemberInspector &insp, Bool_t isTransient);
480  Bool_t IsFolder() const { return kTRUE; }
481  Bool_t IsLoaded() const;
482  Bool_t IsForeign() const;
484  Bool_t IsVersioned() const { return !( GetClassVersion()<=1 && IsForeign() ); }
485  Bool_t IsTObject() const;
486  static TClass *LoadClass(const char *requestedname, Bool_t silent);
487  void ls(Option_t *opt="") const;
488  void MakeCustomMenuList();
489  Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
490  void Move(void *arenaFrom, void *arenaTo) const;
491  void *New(ENewType defConstructor = kClassNew, Bool_t quiet = kFALSE) const;
492  void *New(void *arena, ENewType defConstructor = kClassNew) const;
493  void *NewArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
494  void *NewArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
495  virtual void PostLoadCheck();
496  Long_t Property() const;
497  Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
498  Int_t ReadBuffer(TBuffer &b, void *pointer);
500  void RemoveStreamerInfo(Int_t slot);
501  void ReplaceWith(TClass *newcl) const;
502  void ResetCaches();
503  void ResetClassInfo(Long_t tagnum);
504  void ResetClassInfo();
506  void ResetMenuList();
507  Int_t Size() const;
508  void SetCanSplit(Int_t splitmode);
510  void SetContextMenuTitle(const char *title);
513  void SetDeclFile(const char *name, int line) { fDeclFileName = name; fDeclFileLine = line; }
514  void SetDelete(ROOT::DelFunc_t deleteFunc);
515  void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc);
516  void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc);
517  void SetDestructor(ROOT::DesFunc_t destructorFunc);
518  void SetImplFileName(const char *implFileName) { fImplFileName = implFileName; }
519  void SetMerge(ROOT::MergeFunc_t mergeFunc);
521  void SetNew(ROOT::NewFunc_t newFunc);
522  void SetNewArray(ROOT::NewArrFunc_t newArrayFunc);
523  TVirtualStreamerInfo *SetStreamerInfo(Int_t version, const char *info="");
524  void SetUnloaded();
525  Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="");
526 
528  void AdoptStreamer(TClassStreamer *strm);
529  void AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
530  void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm);
533 
534  // Function to retrieve the TClass object and dictionary function
535  static void AddClass(TClass *cl);
536  static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass* cl);
537  static void RemoveClass(TClass *cl);
539  static TClass *GetClass(const char *name, Bool_t load = kTRUE, Bool_t silent = kFALSE);
540  static TClass *GetClass(const std::type_info &typeinfo, Bool_t load = kTRUE, Bool_t silent = kFALSE);
541  static TClass *GetClass(ClassInfo_t *info, Bool_t load = kTRUE, Bool_t silent = kFALSE);
542  template<typename T>
543  static TClass *GetClass(Bool_t load = kTRUE, Bool_t silent = kFALSE);
544  static Bool_t GetClass(DeclId_t id, std::vector<TClass*> &classes);
545  static DictFuncPtr_t GetDict (const char *cname);
546  static DictFuncPtr_t GetDict (const std::type_info &info);
547 
548  static Int_t AutoBrowse(TObject *obj, TBrowser *browser);
549  static ENewType IsCallingNew();
550  static TClass *Load(TBuffer &b);
551  void Store(TBuffer &b) const;
552 
553  // Pseudo-method apply to the 'obj'. In particular those are used to
554  // implement TObject like methods for non-TObject classes
555 
556  Int_t Browse(void *obj, TBrowser *b) const;
557  void DeleteArray(void *ary, Bool_t dtorOnly = kFALSE);
558  void Destructor(void *obj, Bool_t dtorOnly = kFALSE);
559  void *DynamicCast(const TClass *base, void *obj, Bool_t up = kTRUE);
560  const void *DynamicCast(const TClass *base, const void *obj, Bool_t up = kTRUE);
561  Bool_t IsFolder(void *obj) const;
562 
563  inline void Streamer(void *obj, TBuffer &b, const TClass *onfile_class = 0) const
564  {
565  // Inline for performance, skipping one function call.
566 #ifdef R__NO_ATOMIC_FUNCTION_POINTER
567  fStreamerImpl(this,obj,b,onfile_class);
568 #else
569  auto t = fStreamerImpl.load();
570  t(this,obj,b,onfile_class);
571 #endif
572  }
573 
574  ClassDef(TClass,0) //Dictionary containing class information
575 };
576 
577 namespace ROOT {
578 namespace Internal {
579 template <typename T>
580 TClass *GetClassHelper(Bool_t, Bool_t, std::true_type)
581 {
582  return T::Class();
583 }
584 
585 template <typename T>
586 TClass *GetClassHelper(Bool_t load, Bool_t silent, std::false_type)
587 {
588  return TClass::GetClass(typeid(T), load, silent);
589 }
590 
591 } // namespace Internal
592 } // namespace ROOT
593 
594 template <typename T>
596 {
598  return ROOT::Internal::GetClassHelper<T>(load, silent, tag);
599 }
600 
601 namespace ROOT {
602 
603 template <typename T> TClass *GetClass(T * /* dummy */) { return TClass::GetClass<T>(); }
604 template <typename T> TClass *GetClass(const T * /* dummy */) { return TClass::GetClass<T>(); }
605 
606 #ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
607  // This can only be used when the template overload resolution can distinguish between T* and T**
608  template <typename T> TClass* GetClass( T** /* dummy */) { return TClass::GetClass<T>(); }
609  template <typename T> TClass* GetClass(const T** /* dummy */) { return TClass::GetClass<T>(); }
610  template <typename T> TClass* GetClass( T* const* /* dummy */) { return TClass::GetClass<T>(); }
611  template <typename T> TClass* GetClass(const T* const* /* dummy */) { return TClass::GetClass<T>(); }
612 #endif
613 
614  extern TClass *CreateClass(const char *cname, Version_t id,
615  const char *dfil, const char *ifil,
616  Int_t dl, Int_t il);
617 }
618 
619 #endif // ROOT_TClass
void AddQualifiedName(const char *name)
Extract this part of the name.
Definition: TClass.cxx:160
Short_t GetImplFileLine() const
Definition: TClass.h:422
void ResetCaches()
To clean out all caches.
Definition: TClass.cxx:4103
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Definition: TClass.cxx:2335
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:4440
static TClass * LoadClassCustom(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5596
ShowMembersFunc_t fShowMembers
Definition: TClass.h:199
Bool_t HasInterpreterInfoInMemory() const
Definition: TClass.h:380
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method). ...
Definition: TClass.cxx:5742
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:2250
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3536
ESTLType
Definition: ESTLType.h:28
An array of TObjects.
Definition: TObjArray.h:37
ROOT::NewArrFunc_t fNewArray
Definition: TClass.h:210
void(* ClassStreamerFunc_t)(TBuffer &, void *)
Definition: Rtypes.h:70
std::atomic< TMethodCall * > fIsAMethod
Definition: TClass.h:205
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
Definition: TClass.cxx:1820
virtual void PostLoadCheck()
Do the initialization that can only be done after the CINT dictionary has been fully populated and ca...
Definition: TClass.cxx:5752
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
Definition: Rtypes.h:96
void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse)
Verify the base classes always.
Definition: TClass.cxx:3810
VSD Structures.
Definition: StringConv.hxx:21
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:6429
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:4459
TLine * line
void(* DelArrFunc_t)(void *)
Definition: Rtypes.h:113
const char * GetImplFileName() const
Definition: TClass.h:421
Collectable string class.
Definition: TObjString.h:28
static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass *cl)
static: Add a TClass* to the map of classes.
Definition: TClass.cxx:467
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:6922
void SetDeclFile(const char *name, int line)
Definition: TClass.h:513
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:6825
ConvSIMap_t fConversionStreamerInfo
Definition: TClass.h:174
void SetDelete(ROOT::DelFunc_t deleteFunc)
Install a new wrapper around &#39;delete&#39;.
Definition: TClass.cxx:6742
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Definition: Rtypes.h:116
const char Option_t
Definition: RtypesCore.h:62
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:6485
void SetConvStreamerFunc(ClassConvStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom conversion streamer.
Definition: TClass.cxx:6686
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:396
double T(double x)
Definition: ChebyshevPol.h:34
ENewType
Definition: TClass.h:101
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
Definition: TClass.cxx:3590
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition: TClass.cxx:4227
std::atomic< TListOfEnums * > fEnums
Definition: TClass.h:179
static void StreamerExternal(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
There is special streamer for the class.
Definition: TClass.cxx:6529
void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl)
Build the list of real data for an emulated class.
Definition: TClass.cxx:2042
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:2345
void SetClassVersion(Version_t version)
Private function.
Definition: TClass.cxx:5470
TViewPubFunctions * fAllPubMethod
Definition: TClass.h:184
#define BIT(n)
Definition: Rtypes.h:83
Persistent version of a TClass.
Definition: TProtoClass.h:35
void ResetMenuList()
Resets the menu list to it&#39;s standard value.
Definition: TClass.cxx:4129
std::atomic< Bool_t > fHasRootPcmInfo
C++ Property of the class (is abstract, has virtual table, etc.)
Definition: TClass.h:224
static THashTable * fgClassTypedefHash
Definition: TClass.h:323
const std::type_info * GetTypeInfo() const
Definition: TClass.h:461
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:4485
std::atomic< std::map< std::string, TObjArray * > * > ConvSIMap_t
Persistent address of pointer to this TClass object and its successors.
Definition: TClass.h:171
void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc)
Install a new wrapper around &#39;delete []&#39;.
Definition: TClass.cxx:6750
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:4413
ROOT::NewArrFunc_t GetNewArray() const
ROOT::DirAutoAdd_t fDirAutoAdd
Definition: TClass.h:214
static void RemoveClassDeclId(TDictionary::DeclId_t id)
Definition: TClass.cxx:492
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
Bool_t HasInterpreterInfo() const
Definition: TClass.h:381
static void StreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6577
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition: TClass.cxx:2852
ROOT::DelArrFunc_t GetDeleteArray() const
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3646
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:3523
Bool_t HasDictionary() const
Check whether a class has a dictionary or not.
Definition: TClass.cxx:3789
TCollection * GetListOfMethodOverloads(const char *name) const
Return the collection of functions named "name".
Definition: TClass.cxx:3710
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:3873
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2835
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:5724
TString fContextMenuTitle
Definition: TClass.h:197
static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char *)
Definition: TClass.cxx:3258
TVirtualIsAProxy * GetIsAProxy() const
Return the proxy implementing the IsA functionality.
Definition: TClass.cxx:2893
TVirtualStreamerInfo * GetCurrentStreamerInfo()
Definition: TClass.h:406
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
Definition: TClass.cxx:3728
void SetContextMenuTitle(const char *title)
Change (i.e. set) the title of the TNamed.
Definition: TClass.cxx:6016
TVirtualRefProxy * fRefProxy
cached streamer info used in the last read.
Definition: TClass.h:245
const char * GetContextMenuTitle() const
Definition: TClass.h:405
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:6555
Int_t fStreamerType
saved info to call Streamer
Definition: TClass.h:241
ROOT::NewFunc_t GetNew() const
Abstract base class for accessing the data-members of a class.
void SetImplFileName(const char *implFileName)
Definition: TClass.h:518
void ReplaceWith(TClass *newcl) const
Definition: TClass.cxx:4020
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:6599
void AdoptStreamer(TClassStreamer *strm)
Adopt a TClassStreamer object.
Definition: TClass.cxx:6635
UInt_t GetHeapInstanceCount() const
Definition: TClass.h:432
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:226
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4270
std::atomic< TVirtualStreamerInfo * > fLastReadInfo
cached current streamer info.
Definition: TClass.h:244
void SetClassSize(Int_t sizof)
Definition: TClass.h:273
Short_t fImplFileLine
Definition: TClass.h:190
void DeleteArray(void *ary, Bool_t dtorOnly=kFALSE)
Explicitly call operator delete[] for an array.
Definition: TClass.cxx:5331
ROOT::NewFunc_t fNew
Definition: TClass.h:209
char * EscapeChars(const char *text) const
Introduce an escape character (@) in front of a special chars.
Definition: TClass.cxx:2507
void ResetInstanceCount()
Definition: TClass.h:505
void SetLastReadInfo(TVirtualStreamerInfo *info)
Definition: TClass.h:411
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:6499
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:4213
static IdMap_t * GetIdMap()
Definition: TClass.cxx:425
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:6564
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
Definition: TClass.cxx:2729
TDeclNameRegistry & fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:152
TClass * GetClass(T *)
Definition: TClass.h:603
Int_t GetBaseClassOffsetRecurse(const TClass *toBase)
Return data member offset to the base class "cl".
Definition: TClass.cxx:2643
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:4326
#define ClassDef(name, id)
Definition: Rtypes.h:326
void Dump() const
Dump contents of object on stdout.
Definition: TClass.h:370
void Class()
Definition: Class.C:29
std::atomic< TList * > fBase
Definition: TClass.h:176
static Int_t ReadRules()
Read the class.rules files from the default location:.
Definition: TClass.cxx:1750
ClassStreamerFunc_t fStreamerFunc
Definition: TClass.h:215
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:1309
ECheckSum
Definition: TClass.h:102
static DeclIdMap_t * GetDeclIdMap()
Definition: TClass.cxx:436
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:4588
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:72
ROOT::ResetAfterMergeFunc_t fResetAfterMerge
Definition: TClass.h:208
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:5707
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:2172
void ResetClassInfo()
Make sure that the current ClassInfo is up to date.
Definition: TClass.cxx:4068
void SetStreamerFunc(ClassStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom streamer.
Definition: TClass.cxx:6663
EFunctionMatchMode
Definition: TDictionary.h:155
EState GetState() const
Definition: TClass.h:453
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function)...
Definition: TClass.cxx:2885
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:5039
ClassInfo_t * GetClassInfo() const
Definition: TClass.h:400
void *(* NewFunc_t)(void *)
Definition: Rtypes.h:110
void RegisterStreamerInfo(TVirtualStreamerInfo *info)
Register the StreamerInfo in the given slot, change the State of the TClass as appropriate.
Definition: TClass.cxx:7018
Method or function calling interface.
Definition: TMethodCall.h:37
std::atomic< Bool_t > fVersionUsed
saved remember if fOffsetStreamer has been set.
Definition: TClass.h:227
This class defines an interface to the cling C++ interpreter.
Definition: TCling.h:98
TListOfFunctionTemplates * fFuncTemplate
Definition: TClass.h:180
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
Definition: TClass.cxx:5697
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:6520
ROOT::MergeFunc_t GetMerge() const
const TObjArray * GetStreamerInfos() const
Definition: TClass.h:457
TViewPubDataMembers * fAllPubData
Definition: TClass.h:183
TList * fClassMenuList
Definition: TClass.h:185
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:6117
ROOT::Detail::TSchemaRuleSet * fSchemaRules
Pointer to reference proxy if this class represents a reference.
Definition: TClass.h:246
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
Definition: Rtypes.h:71
std::atomic< StreamerImpl_t > fStreamerImpl
Definition: TClass.h:252
TList * fRealData
Definition: TClass.h:175
ROOT::DesFunc_t GetDestructor() const
EStreamerType
Definition: TClass.h:300
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:2593
const char * fImplFileName
Definition: TClass.h:188
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
Definition: Rtypes.h:117
void ls(Option_t *opt="") const
The ls function lists the contents of a class on stdout.
Definition: TClass.cxx:4144
ShowMembersFunc_t GetShowMembersWrapper() const
Definition: TClass.h:452
void AddInstance(Bool_t heap=kFALSE)
Definition: TClass.h:353
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:1961
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Int_t fCanSplit
Definition: TClass.h:219
void SetNew(ROOT::NewFunc_t newFunc)
Install a new wrapper around &#39;new&#39;.
Definition: TClass.cxx:6726
static DictFuncPtr_t GetDict(const char *cname)
Return a pointer to the dictionary loading function generated by rootcint.
Definition: TClass.cxx:3282
std::atomic< TVirtualStreamerInfo * > fCurrentInfo
Current &#39;state&#39; of the class (Emulated,Interpreted,Loaded)
Definition: TClass.h:243
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:111
TString fOrigName
Definition: TClass.h:318
Bool_t HasLocalHashMember() const
void(* StreamerImpl_t)(const TClass *pThis, void *obj, TBuffer &b, const TClass *onfile_class)
Schema evolution rules.
Definition: TClass.h:248
ROOT::R::TRInterface & r
Definition: Object.C:4
UInt_t GetInstanceCount() const
Definition: TClass.h:431
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition: TClass.cxx:6805
TVirtualStreamerInfo * GetLastReadInfo() const
Definition: TClass.h:410
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:6447
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition: TClass.cxx:4169
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:3856
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
Definition: TClass.cxx:2546
void SetDestructor(ROOT::DesFunc_t destructorFunc)
Install a new wrapper around the destructor.
Definition: TClass.cxx:6758
Bool_t HasDefaultConstructor() const
void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse)
Verify the Data Members.
Definition: TClass.cxx:3827
void SetGlobalIsA(IsAGlobalFunc_t)
This function installs a global IsA function for this class.
Definition: TClass.cxx:6047
void Store(TBuffer &b) const
Store class description on I/O buffer.
Definition: TClass.cxx:5655
void SetUnloaded()
Call this method to indicate that the shared library containing this class&#39;s code has been removed (u...
Definition: TClass.cxx:6056
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:6769
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
Definition: TClass.cxx:5214
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
Definition: TClass.cxx:4720
static void StreamerTObject(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects.
Definition: TClass.cxx:6541
unsigned int UInt_t
Definition: RtypesCore.h:42
ROOT::DirAutoAdd_t GetDirectoryAutoAdd() const
void Draw(Option_t *option="")
Draw detailed class inheritance structure.
Definition: TClass.cxx:2425
Int_t Size() const
Return size of object of this class.
Definition: TClass.cxx:5499
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:5664
TClass * GetClassHelper(Bool_t, Bool_t, std::true_type)
Definition: TClass.h:580
void GetMissingDictionaries(THashTable &result, bool recurse=false)
Get the classes that have a missing dictionary starting from this one.
Definition: TClass.cxx:3970
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:30
virtual void Browse(TBrowser *b)
This method is called by a browser to get the class information.
Definition: TClass.cxx:1940
Bool_t CanIgnoreTObjectStreamer()
Definition: TClass.h:365
InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry)
Definition: TClass.cxx:212
TClass *const * GetPersistentRef() const
Definition: TClass.h:446
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
TVirtualCollectionProxy * fCollectionProxy
Definition: TClass.h:194
TClass * GetBaseDataMember(const char *datamember)
Return pointer to (base) class that contains datamember.
Definition: TClass.cxx:2765
ROOT::ESTLType GetCollectionType() const
Return the &#39;type&#39; of the STL the TClass is representing.
Definition: TClass.cxx:2824
ROOT::TMapTypeToTClass IdMap_t
Definition: TClass.h:72
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4753
std::atomic< UChar_t > fRuntimeProperties
Definition: TClass.h:238
UInt_t fInstanceCount
Definition: TClass.h:191
TVirtualRefProxy * GetReferenceProxy() const
Definition: TClass.h:448
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Definition: TClass.cxx:5833
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
Definition: TClass.h:563
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:6238
UInt_t fOnHeap
Definition: TClass.h:192
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:5991
TListOfFunctions * GetMethodList()
Return (create an empty one if needed) the list of functions.
Definition: TClass.cxx:4241
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:466
View implementing the TList interface and giving access all the TFunction describing public methods i...
const Bool_t kFALSE
Definition: RtypesCore.h:88
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:6614
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
Definition: TClass.cxx:476
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
Definition: TClass.cxx:3745
TMethod * GetClassMethod(Long_t faddr)
Look for a method in this class that has the interface function address faddr.
Definition: TClass.cxx:4369
ROOT::DesFunc_t fDestructor
Definition: TClass.h:213
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:5941
std::atomic_flag fSpinLock
Definition: TClass.h:145
Int_t fSizeof
Definition: TClass.h:217
std::unordered_set< std::string > fClassNamesSet
Definition: TClass.h:144
long Long_t
Definition: RtypesCore.h:50
void ForceReload(TClass *oldcl)
we found at least one equivalent.
Definition: TClass.cxx:1284
void SetCanSplit(Int_t splitmode)
Set the splitability of this class:
Definition: TClass.cxx:5453
std::atomic< TListOfFunctions * > fMethod
Definition: TClass.h:181
Bool_t CanSplitBaseAllow()
Pointer to the function implementing streaming for this class.
Definition: TClass.cxx:2177
ROOT::DelArrFunc_t fDeleteArray
Definition: TClass.h:212
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:2135
Version_t GetClassVersion() const
Definition: TClass.h:391
TClass & operator=(const TClass &)=delete
TObjArray * fStreamerInfo
Definition: TClass.h:173
std::atomic< TClass ** > fPersistentRef
Definition: TClass.h:169
Long_t fOffsetStreamer
Properties that can only be evaluated at run-time.
Definition: TClass.h:240
EState fState
cached of the streaming method to use
Definition: TClass.h:242
ROOT::ResetAfterMergeFunc_t GetResetAfterMerge() const
TText * text
ROOT::DelFunc_t fDelete
Definition: TClass.h:211
void RemoveStreamerInfo(Int_t slot)
Remove and delete the StreamerInfo in the given slot.
Definition: TClass.cxx:7042
EStatusBits
Definition: TObject.h:57
Long_t GetDataMemberOffset(const char *membername) const
return offset for member name.
Definition: TClass.cxx:3337
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:450
TList * GetListOfRealData() const
Definition: TClass.h:418
Bool_t HasDataMemberInfo() const
Definition: TClass.h:378
virtual void Dump() const
Dump contents of object on stdout.
Definition: TObject.cxx:266
TClass()
Definition: TClass.cxx:1019
const std::type_info * fTypeInfo
Definition: TClass.h:198
virtual ~TClass()
TClass dtor. Deletes all list that might have been created.
Definition: TClass.cxx:1594
void SetStreamerImpl()
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition: TClass.cxx:5962
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:4297
static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:294
friend bool operator &(UChar_t l, ERuntimeProperties r)
Definition: TClass.h:235
TClass *(* IsAGlobalFunc_t)(const TClass *, const void *obj)
Definition: Rtypes.h:98
TVirtualStreamerInfo * DetermineCurrentStreamerInfo()
Determine and set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5479
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:2906
TVirtualIsAProxy * fIsA
Definition: TClass.h:203
std::atomic< Long_t > fProperty
Indicates whether this class can be split or not.
Definition: TClass.h:220
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5544
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
Definition: TClass.cxx:3323
IsAGlobalFunc_t fGlobalIsA
pointer to the class&#39;s IsA proxy.
Definition: TClass.h:204
ROOT::TMapDeclIdToTClass DeclIdMap_t
Definition: TClass.h:73
Long_t fClassProperty
Property.
Definition: TClass.h:221
TDeclNameRegistry(Int_t verbLevel=0)
TDeclNameRegistry class constructor.
Definition: TClass.cxx:149
Int_t GetClassSize() const
Definition: TClass.h:392
Mother of all ROOT objects.
Definition: TObject.h:37
Short_t fDeclFileLine
Definition: TClass.h:189
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition: TClass.cxx:3507
void(* DelFunc_t)(void *)
Definition: Rtypes.h:112
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TClass.h:480
static std::atomic< Int_t > fgClassCount
Definition: TClass.h:292
typedef void((*Func_t)())
TNameMapNode(const char *typedf, const char *orig)
Definition: TClass.cxx:702
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5733
Version_t fClassVersion
Definition: TClass.h:195
TString fSharedLibs
Definition: TClass.h:201
void AddImplFile(const char *filename, int line)
Definition: TClass.cxx:1882
Bool_t HasDeclName(const char *name) const
Definition: TClass.cxx:187
std::atomic< UInt_t > fCheckSum
Definition: TClass.h:193
TListOfDataMembers * fData
Definition: TClass.h:177
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:196
auto * l
Definition: textangle.C:4
void(* DirAutoAdd_t)(void *, TDirectory *)
Definition: Rtypes.h:115
static TClass * LoadClassDefault(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5566
Bool_t IsVersioned() const
Definition: TClass.h:484
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:3757
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:5510
ClassConvStreamerFunc_t fConvStreamerFunc
Definition: TClass.h:216
const char * proto
Definition: civetweb.c:16604
const char * fDeclFileName
Definition: TClass.h:187
TClassStreamer * fStreamer
Definition: TClass.h:200
void SetMerge(ROOT::MergeFunc_t mergeFunc)
Install a new wrapper around &#39;Merge&#39;.
Definition: TClass.cxx:6710
void SetCurrentStreamerInfo(TVirtualStreamerInfo *info)
Set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5491
std::atomic< Bool_t > fCanLoadClassInfo
Whether info was loaded from a root pcm.
Definition: TClass.h:225
static void ConvStreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6586
void LoadClassInfo() const
Try to load the ClassInfo if available.
Definition: TClass.cxx:5619
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Definition: TClass.cxx:3299
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition: TClass.cxx:2877
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:4794
unsigned char UChar_t
Definition: RtypesCore.h:34
void SetResetAfterMerge(ROOT::ResetAfterMergeFunc_t resetFunc)
Install a new wrapper around &#39;ResetAfterMerge&#39;.
Definition: TClass.cxx:6718
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Definition: TClass.cxx:1862
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:4260
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition: TClass.cxx:6249
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:4651
static Bool_t HasDictionarySelection(const char *clname)
Check whether a class has a dictionary or ROOT can load one.
Definition: TClass.cxx:3800
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:4342
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition: TClass.cxx:3695
void SetNewArray(ROOT::NewArrFunc_t newArrayFunc)
Install a new wrapper around &#39;new []&#39;.
Definition: TClass.cxx:6734
const Bool_t kTRUE
Definition: RtypesCore.h:87
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Copy the argument.
Definition: TClass.cxx:2408
static Int_t AutoBrowse(TObject *obj, TBrowser *browser)
Browse external object inherited from TObject.
Definition: TClass.cxx:1896
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
Definition: TClass.cxx:3363
char name[80]
Definition: TGX11.cxx:109
ERuntimeProperties
Indicates whether GetClassVersion has been called.
Definition: TClass.h:229
ROOT::MergeFunc_t fMerge
saved info to call a IsA member function
Definition: TClass.h:207
void CalculateStreamerOffset() const
Calculate the offset between an object of this class to its base class TObject.
Definition: TClass.cxx:2113
void AdoptSchemaRules(ROOT::Detail::TSchemaRuleSet *rules)
Adopt a new set of Data Model Evolution rules.
Definition: TClass.cxx:1850
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition: TClass.cxx:4857
EState
Definition: TClass.h:115
void(* DesFunc_t)(void *)
Definition: Rtypes.h:114
TList * GetListOfFunctionTemplates(Bool_t load=kTRUE)
Return list containing the TEnums of a class.
Definition: TClass.cxx:3681