Logo ROOT   6.18/05
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
37class TBaseClass;
38class TBrowser;
39class TDataMember;
40class TCling;
41class TMethod;
42class TRealData;
43class TBuffer;
46class TMethodCall;
49class THashTable;
53class TListOfEnums;
57class TProtoClass;
58
59namespace 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
72typedef ROOT::TMapTypeToTClass IdMap_t;
73typedef ROOT::TMapDeclIdToTClass DeclIdMap_t;
74
75class TClass : public TDictionary {
76
77friend class TCling;
78friend void ROOT::ResetClassVersion(TClass*, const char*, Short_t);
80friend class TProtoClass;
82
83public:
84 // TClass status bits
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.
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 };
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
129private:
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
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
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
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 //
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
325private:
326 TClass(const TClass& tc) = delete;
327 TClass& operator=(const TClass&) = delete;
328
329protected:
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
336public:
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;
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 if (!fVersionUsed.load(std::memory_order_relaxed))
394 return fClassVersion;
395 }
396 Int_t GetClassSize() const { return Size(); }
397 TDataMember *GetDataMember(const char *datamember) const;
398 Long_t GetDataMemberOffset(const char *membername) const;
399 const char *GetDeclFileName() const;
404 ClassInfo_t *GetClassInfo() const {
407 return fClassInfo;
408 }
409 const char *GetContextMenuTitle() const { return fContextMenuTitle; }
411 auto current = fCurrentInfo.load(std::memory_order_relaxed);
412 if (current) return current;
413 else return DetermineCurrentStreamerInfo();
414 }
422 TCollection *GetListOfMethodOverloads(const char* name) const;
423 TList *GetListOfRealData() const { return fRealData; }
426 const char *GetImplFileName() const { return fImplFileName; }
428 TClass *GetActualClass(const void *object) const;
429 TClass *GetBaseClass(const char *classname);
430 TClass *GetBaseClass(const TClass *base);
431 Int_t GetBaseClassOffset(const TClass *toBase, void *address = 0, bool isDerivedObject = true);
432 TClass *GetBaseDataMember(const char *datamember);
438 void GetMenuItems(TList *listitems);
439 TList *GetMenuList() const;
440 TMethod *GetMethod(const char *method, const char *params, Bool_t objectIsConst = kFALSE);
441 TMethod *GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst = kFALSE,
443 TMethod *GetMethodAny(const char *method);
444 TMethod *GetMethodAllAny(const char *method);
445 Int_t GetNdata();
451 TClass *const*GetPersistentRef() const { return fPersistentRef; }
452 TRealData *GetRealData(const char *name) const;
456 const char *GetSharedLibs();
458 EState GetState() const { return fState; }
462 const TObjArray *GetStreamerInfos() const { return fStreamerInfo; }
466 const std::type_info *GetTypeInfo() const { return fTypeInfo; };
467
468 /// @brief Return 'true' if we can guarantee that if this class (or any class in
469 /// this class inheritance hierarchy) overload TObject::Hash it also starts
470 /// the RecursiveRemove process from its own destructor.
472 {
476 }
477 Bool_t HasDictionary() const;
478 static Bool_t HasDictionarySelection(const char* clname);
480 void GetMissingDictionaries(THashTable& result, bool recurse = false);
482 Bool_t InheritsFrom(const char *cl) const;
483 Bool_t InheritsFrom(const TClass *cl) const;
484 void InterpretedShowMembers(void* obj, TMemberInspector &insp, Bool_t isTransient);
485 Bool_t IsFolder() const { return kTRUE; }
486 Bool_t IsLoaded() const;
487 Bool_t IsForeign() const;
489 Bool_t IsVersioned() const { return !( GetClassVersion()<=1 && IsForeign() ); }
490 Bool_t IsTObject() const;
491 static TClass *LoadClass(const char *requestedname, Bool_t silent);
492 void ls(Option_t *opt="") const;
493 void MakeCustomMenuList();
494 Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
495 void Move(void *arenaFrom, void *arenaTo) const;
496 void *New(ENewType defConstructor = kClassNew, Bool_t quiet = kFALSE) const;
497 void *New(void *arena, ENewType defConstructor = kClassNew) const;
498 void *NewArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
499 void *NewArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
500 virtual void PostLoadCheck();
501 Long_t Property() const;
502 Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
503 Int_t ReadBuffer(TBuffer &b, void *pointer);
505 void RemoveStreamerInfo(Int_t slot);
506 void ReplaceWith(TClass *newcl) const;
507 void ResetCaches();
508 void ResetClassInfo(Long_t tagnum);
509 void ResetClassInfo();
511 void ResetMenuList();
512 Int_t Size() const;
513 void SetCanSplit(Int_t splitmode);
515 void SetContextMenuTitle(const char *title);
518 void SetDeclFile(const char *name, int line) { fDeclFileName = name; fDeclFileLine = line; }
519 void SetDelete(ROOT::DelFunc_t deleteFunc);
520 void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc);
521 void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc);
522 void SetDestructor(ROOT::DesFunc_t destructorFunc);
523 void SetImplFileName(const char *implFileName) { fImplFileName = implFileName; }
524 void SetMerge(ROOT::MergeFunc_t mergeFunc);
526 void SetNew(ROOT::NewFunc_t newFunc);
527 void SetNewArray(ROOT::NewArrFunc_t newArrayFunc);
528 TVirtualStreamerInfo *SetStreamerInfo(Int_t version, const char *info="");
529 void SetUnloaded();
530 Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="");
531
533 void AdoptStreamer(TClassStreamer *strm);
534 void AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
535 void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm);
538
539 // Function to retrieve the TClass object and dictionary function
540 static void AddClass(TClass *cl);
542 static void RemoveClass(TClass *cl);
544 static TClass *GetClass(const char *name, Bool_t load = kTRUE, Bool_t silent = kFALSE);
545 static TClass *GetClass(const std::type_info &typeinfo, Bool_t load = kTRUE, Bool_t silent = kFALSE);
546 static TClass *GetClass(ClassInfo_t *info, Bool_t load = kTRUE, Bool_t silent = kFALSE);
547 template<typename T>
548 static TClass *GetClass(Bool_t load = kTRUE, Bool_t silent = kFALSE);
549 static Bool_t GetClass(DeclId_t id, std::vector<TClass*> &classes);
550 static DictFuncPtr_t GetDict (const char *cname);
551 static DictFuncPtr_t GetDict (const std::type_info &info);
552
553 static Int_t AutoBrowse(TObject *obj, TBrowser *browser);
554 static ENewType IsCallingNew();
555 static TClass *Load(TBuffer &b);
556 void Store(TBuffer &b) const;
557
558 // Pseudo-method apply to the 'obj'. In particular those are used to
559 // implement TObject like methods for non-TObject classes
560
561 Int_t Browse(void *obj, TBrowser *b) const;
562 void DeleteArray(void *ary, Bool_t dtorOnly = kFALSE);
563 void Destructor(void *obj, Bool_t dtorOnly = kFALSE);
564 void *DynamicCast(const TClass *base, void *obj, Bool_t up = kTRUE);
565 const void *DynamicCast(const TClass *base, const void *obj, Bool_t up = kTRUE);
566 Bool_t IsFolder(void *obj) const;
567
568 inline void Streamer(void *obj, TBuffer &b, const TClass *onfile_class = 0) const
569 {
570 // Inline for performance, skipping one function call.
571#ifdef R__NO_ATOMIC_FUNCTION_POINTER
572 fStreamerImpl(this,obj,b,onfile_class);
573#else
574 auto t = fStreamerImpl.load();
575 t(this,obj,b,onfile_class);
576#endif
577 }
578
579 ClassDef(TClass,0) //Dictionary containing class information
580};
581
582namespace ROOT {
583namespace Internal {
584template <typename T>
586{
587 return T::Class();
588}
589
590template <typename T>
591TClass *GetClassHelper(Bool_t load, Bool_t silent, std::false_type)
592{
593 return TClass::GetClass(typeid(T), load, silent);
594}
595
596} // namespace Internal
597} // namespace ROOT
598
599template <typename T>
601{
603 return ROOT::Internal::GetClassHelper<T>(load, silent, tag);
604}
605
606namespace ROOT {
607
608template <typename T> TClass *GetClass(T * /* dummy */) { return TClass::GetClass<T>(); }
609template <typename T> TClass *GetClass(const T * /* dummy */) { return TClass::GetClass<T>(); }
610
611#ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
612 // This can only be used when the template overload resolution can distinguish between T* and T**
613 template <typename T> TClass* GetClass( T** /* dummy */) { return TClass::GetClass<T>(); }
614 template <typename T> TClass* GetClass(const T** /* dummy */) { return TClass::GetClass<T>(); }
615 template <typename T> TClass* GetClass( T* const* /* dummy */) { return TClass::GetClass<T>(); }
616 template <typename T> TClass* GetClass(const T* const* /* dummy */) { return TClass::GetClass<T>(); }
617#endif
618
619 extern TClass *CreateClass(const char *cname, Version_t id,
620 const char *dfil, const char *ifil,
621 Int_t dl, Int_t il);
622}
623
624#endif // ROOT_TClass
void Class()
Definition: Class.C:29
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:41
short Version_t
Definition: RtypesCore.h:61
unsigned char UChar_t
Definition: RtypesCore.h:34
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
short Short_t
Definition: RtypesCore.h:35
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
TClass *(* DictFuncPtr_t)()
Definition: Rtypes.h:78
#define BIT(n)
Definition: Rtypes.h:83
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition: Rtypes.h:72
TClass *(* IsAGlobalFunc_t)(const TClass *, const void *obj)
Definition: Rtypes.h:98
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
Definition: Rtypes.h:96
void(* ClassStreamerFunc_t)(TBuffer &, void *)
Definition: Rtypes.h:70
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
Definition: Rtypes.h:71
ROOT::TMapDeclIdToTClass DeclIdMap_t
Definition: TClass.h:73
ROOT::TMapTypeToTClass IdMap_t
Definition: TClass.h:72
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
typedef void((*Func_t)())
const char * proto
Definition: civetweb.c:16604
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:33
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
TDeclNameRegistry & fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:152
InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry)
Definition: TClass.cxx:212
Bool_t HasDeclName(const char *name) const
Definition: TClass.cxx:187
std::unordered_set< std::string > fClassNamesSet
Definition: TClass.h:144
void AddQualifiedName(const char *name)
Extract this part of the name.
Definition: TClass.cxx:160
TDeclNameRegistry(Int_t verbLevel=0)
TDeclNameRegistry class constructor.
Definition: TClass.cxx:149
std::atomic_flag fSpinLock
Definition: TClass.h:145
TString fOrigName
Definition: TClass.h:318
TNameMapNode(const char *typedf, const char *orig)
Definition: TClass.cxx:702
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
TClass *const * GetPersistentRef() const
Definition: TClass.h:451
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition: TClass.cxx:6233
ShowMembersFunc_t fShowMembers
Definition: TClass.h:199
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Definition: TClass.cxx:3288
TVirtualIsAProxy * fIsA
Definition: TClass.h:203
void ForceReload(TClass *oldcl)
we found at least one equivalent.
Definition: TClass.cxx:1284
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:4469
ROOT::DelArrFunc_t fDeleteArray
Definition: TClass.h:212
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Definition: TClass.cxx:2239
TClassStreamer * fStreamer
Definition: TClass.h:200
void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc)
Install a new wrapper around the directory auto add function.
Definition: TClass.cxx:6753
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TClass.h:485
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:5023
static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry
Definition: TClass.h:294
TListOfFunctionTemplates * fFuncTemplate
Definition: TClass.h:180
ClassStreamerFunc_t fStreamerFunc
Definition: TClass.h:215
void AdoptReferenceProxy(TVirtualRefProxy *proxy)
Adopt the Reference proxy pointer to indicate that this class represents a reference.
Definition: TClass.cxx:6413
TVirtualStreamerInfo * DetermineCurrentStreamerInfo()
Determine and set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5463
EState GetState() const
Definition: TClass.h:458
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
Definition: TClass.cxx:2813
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:6431
void ResetInstanceCount()
Definition: TClass.h:510
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition: TClass.cxx:2866
void RemoveStreamerInfo(Int_t slot)
Remove and delete the StreamerInfo in the given slot.
Definition: TClass.cxx:7026
void SetCanSplit(Int_t splitmode)
Set the splitability of this class:
Definition: TClass.cxx:5437
void AddInstance(Bool_t heap=kFALSE)
Definition: TClass.h:353
TObject * Clone(const char *newname="") const
Create a Clone of this TClass object using a different name but using the same 'dictionary'.
Definition: TClass.cxx:2334
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:4572
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition: TClass.cxx:4841
void SetMerge(ROOT::MergeFunc_t mergeFunc)
Install a new wrapper around 'Merge'.
Definition: TClass.cxx:6694
ConvSIMap_t fConversionStreamerInfo
Definition: TClass.h:174
ROOT::DirAutoAdd_t fDirAutoAdd
Definition: TClass.h:214
Bool_t HasDataMemberInfo() const
Definition: TClass.h:378
TVirtualRefProxy * fRefProxy
cached streamer info used in the last read.
Definition: TClass.h:245
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition: TClass.cxx:4211
ROOT::MergeFunc_t fMerge
saved info to call a IsA member function
Definition: TClass.h:207
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:4281
virtual void Browse(TBrowser *b)
This method is called by a browser to get the class information.
Definition: TClass.cxx:1929
static TClass * Load(TBuffer &b)
Load class description from I/O buffer and return class object.
Definition: TClass.cxx:5494
EState fState
cached of the streaming method to use
Definition: TClass.h:242
ROOT::DesFunc_t GetDestructor() const
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:4326
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Copy the argument.
Definition: TClass.cxx:2397
Int_t fStreamerType
saved info to call Streamer
Definition: TClass.h:241
TList * fRealData
Definition: TClass.h:175
UInt_t fOnHeap
Definition: TClass.h:192
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:1950
std::atomic< TList * > fBase
Definition: TClass.h:176
Bool_t HasDictionary() const
Check whether a class has a dictionary or not.
Definition: TClass.cxx:3778
Long_t GetDataMemberOffset(const char *membername) const
return offset for member name.
Definition: TClass.cxx:3326
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
Definition: TClass.cxx:3717
TMethod * GetClassMethod(Long_t faddr)
Look for a method in this class that has the interface function address faddr.
Definition: TClass.cxx:4353
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
Definition: TClass.cxx:3734
void BuildEmulatedRealData(const char *name, Long_t offset, TClass *cl)
Build the list of real data for an emulated class.
Definition: TClass.cxx:2031
TClass(const TClass &tc)=delete
static void AddClassToDeclIdMap(TDictionary::DeclId_t id, TClass *cl)
static: Add a TClass* to the map of classes.
Definition: TClass.cxx:467
virtual ~TClass()
TClass dtor. Deletes all list that might have been created.
Definition: TClass.cxx:1583
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
Definition: TClass.cxx:5198
Version_t fClassVersion
Definition: TClass.h:195
std::atomic< TVirtualStreamerInfo * > fCurrentInfo
Current 'state' of the class (Emulated,Interpreted,Loaded)
Definition: TClass.h:243
TList * GetListOfFunctionTemplates(Bool_t load=kTRUE)
Return list containing the TEnums of a class.
Definition: TClass.cxx:3670
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:4778
const char * fImplFileName
Definition: TClass.h:188
void RegisterStreamerInfo(TVirtualStreamerInfo *info)
Register the StreamerInfo in the given slot, change the State of the TClass as appropriate.
Definition: TClass.cxx:7002
TClass & operator=(const TClass &)=delete
std::atomic< UInt_t > fCheckSum
Definition: TClass.h:193
std::atomic< TListOfFunctions * > fMethod
Definition: TClass.h:181
static void RemoveClassDeclId(TDictionary::DeclId_t id)
Definition: TClass.cxx:492
void SetNewArray(ROOT::NewArrFunc_t newArrayFunc)
Install a new wrapper around 'new []'.
Definition: TClass.cxx:6718
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:2124
const char * fDeclFileName
Definition: TClass.h:187
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:5975
Int_t fCanSplit
Definition: TClass.h:219
static Bool_t HasDictionarySelection(const char *clname)
Check whether a class has a dictionary or ROOT can load one.
Definition: TClass.cxx:3789
void AdoptSchemaRules(ROOT::Detail::TSchemaRuleSet *rules)
Adopt a new set of Data Model Evolution rules.
Definition: TClass.cxx:1839
static void StreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6561
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:6101
static std::atomic< Int_t > fgClassCount
Definition: TClass.h:292
TVirtualStreamerInfo * GetCurrentStreamerInfo()
Definition: TClass.h:410
ROOT::DirAutoAdd_t GetDirectoryAutoAdd() const
void AddImplFile(const char *filename, int line)
Definition: TClass.cxx:1871
TCollection * GetListOfMethodOverloads(const char *name) const
Return the collection of functions named "name".
Definition: TClass.cxx:3699
std::atomic< TListOfEnums * > fEnums
Definition: TClass.h:179
static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char *)
Definition: TClass.cxx:3247
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
Definition: TClass.cxx:3579
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:5708
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition: TClass.cxx:3684
TClass()
Definition: TClass.cxx:1019
Short_t fDeclFileLine
Definition: TClass.h:189
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:4443
std::atomic< Bool_t > fIsOffsetStreamerSet
Indicates whether the ClassInfo is supposed to be available.
Definition: TClass.h:226
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
Definition: TClass.cxx:4704
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition: TClass.cxx:2841
static IdMap_t * GetIdMap()
Definition: TClass.cxx:425
UInt_t GetInstanceCount() const
Definition: TClass.h:436
void SetDelete(ROOT::DelFunc_t deleteFunc)
Install a new wrapper around 'delete'.
Definition: TClass.cxx:6726
void SetLastReadInfo(TVirtualStreamerInfo *info)
Definition: TClass.h:416
static Int_t AutoBrowse(TObject *obj, TBrowser *browser)
Browse external object inherited from TObject.
Definition: TClass.cxx:1885
ROOT::NewFunc_t GetNew() const
void SetDeclFile(const char *name, int line)
Definition: TClass.h:518
TClass * GetBaseClass(const char *classname)
Return pointer to the base class "classname".
Definition: TClass.cxx:2582
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:4424
void SetDestructor(ROOT::DesFunc_t destructorFunc)
Install a new wrapper around the destructor.
Definition: TClass.cxx:6742
Bool_t HasDefaultConstructor() const
virtual void PostLoadCheck()
Do the initialization that can only be done after the CINT dictionary has been fully populated and ca...
Definition: TClass.cxx:5736
void LoadClassInfo() const
Try to load the ClassInfo if available.
Definition: TClass.cxx:5603
void SetResetAfterMerge(ROOT::ResetAfterMergeFunc_t resetFunc)
Install a new wrapper around 'ResetAfterMerge'.
Definition: TClass.cxx:6702
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:6222
TViewPubFunctions * fAllPubMethod
Definition: TClass.h:184
ERuntimeProperties
Indicates whether GetClassVersion has been called.
Definition: TClass.h:229
Bool_t HasInterpreterInfo() const
Definition: TClass.h:381
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
Definition: TClass.cxx:450
void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse)
Verify the base classes always.
Definition: TClass.cxx:3799
ROOT::Detail::TSchemaRuleSet * fSchemaRules
Pointer to reference proxy if this class represents a reference.
Definition: TClass.h:246
std::atomic< Long_t > fProperty
Indicates whether this class can be split or not.
Definition: TClass.h:220
TVirtualStreamerInfo * GetLastReadInfo() const
Definition: TClass.h:415
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:6598
void SetUnloaded()
Call this method to indicate that the shared library containing this class's code has been removed (u...
Definition: TClass.cxx:6040
ROOT::DelArrFunc_t GetDeleteArray() const
Bool_t HasInterpreterInfoInMemory() const
Definition: TClass.h:380
TList * fClassMenuList
Definition: TClass.h:185
ClassConvStreamerFunc_t fConvStreamerFunc
Definition: TClass.h:216
void SetRuntimeProperties()
Internal routine to set calculate the class properties that can only be known at run-time,...
Definition: TClass.cxx:5925
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5528
TString fSharedLibs
Definition: TClass.h:201
const std::type_info * GetTypeInfo() const
Definition: TClass.h:466
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3635
ENewType
Definition: TClass.h:101
@ kClassNew
Definition: TClass.h:101
@ kRealNew
Definition: TClass.h:101
@ kDummyNew
Definition: TClass.h:101
void Move(void *arenaFrom, void *arenaTo) const
Register the fact that an object was moved from the memory location 'arenaFrom' to the memory locatio...
Definition: TClass.cxx:4197
static DeclIdMap_t * GetDeclIdMap()
Definition: TClass.cxx:436
Short_t GetDeclFileLine() const
Definition: TClass.h:400
void SetStreamerFunc(ClassStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom streamer.
Definition: TClass.cxx:6647
const char * GetImplFileName() const
Definition: TClass.h:426
TList * GetListOfRealData() const
Definition: TClass.h:423
Int_t Size() const
Return size of object of this class.
Definition: TClass.cxx:5483
void SetCurrentStreamerInfo(TVirtualStreamerInfo *info)
Set pointer to current TVirtualStreamerInfo.
Definition: TClass.cxx:5475
static DictFuncPtr_t GetDict(const char *cname)
Return a pointer to the dictionary loading function generated by rootcint.
Definition: TClass.cxx:3271
Int_t fSizeof
Definition: TClass.h:217
ROOT::NewArrFunc_t GetNewArray() const
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:6548
ROOT::NewFunc_t fNew
Definition: TClass.h:209
@ kLoading
Definition: TClass.h:298
@ kUnloading
Definition: TClass.h:298
ROOT::ResetAfterMergeFunc_t GetResetAfterMerge() const
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:4397
Bool_t CanIgnoreTObjectStreamer()
Definition: TClass.h:365
void SetGlobalIsA(IsAGlobalFunc_t)
This function installs a global IsA function for this class.
Definition: TClass.cxx:6031
void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse)
Verify the Data Members.
Definition: TClass.cxx:3816
TObjArray * fStreamerInfo
Definition: TClass.h:173
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Definition: TClass.cxx:1851
TVirtualCollectionProxy * fCollectionProxy
Definition: TClass.h:194
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
Definition: TClass.cxx:5681
void ls(Option_t *opt="") const
The ls function lists the contents of a class on stdout.
Definition: TClass.cxx:4128
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3525
void Store(TBuffer &b) const
Store class description on I/O buffer.
Definition: TClass.cxx:5639
void InterpretedShowMembers(void *obj, TMemberInspector &insp, Bool_t isTransient)
Do a ShowMembers() traversal of all members and base classes' members using the reflection informatio...
Definition: TClass.cxx:2161
static THashTable * fgClassTypedefHash
Definition: TClass.h:323
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
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:6583
const TObjArray * GetStreamerInfos() const
Definition: TClass.h:462
void SetClassVersion(Version_t version)
Private function.
Definition: TClass.cxx:5454
char * EscapeChars(const char *text) const
Introduce an escape character (@) in front of a special chars.
Definition: TClass.cxx:2496
const std::type_info * fTypeInfo
Definition: TClass.h:198
std::atomic< TVirtualStreamerInfo * > fLastReadInfo
cached current streamer info.
Definition: TClass.h:244
std::atomic< std::map< std::string, TObjArray * > * > ConvSIMap_t
Persistent address of pointer to this TClass object and its successors.
Definition: TClass.h:171
static void StreamerTObject(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects.
Definition: TClass.cxx:6525
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Definition: TClass.cxx:5691
EStreamerType
Definition: TClass.h:300
@ kDefault
Definition: TClass.h:300
@ kEmulatedStreamer
Definition: TClass.h:300
@ kExternal
Definition: TClass.h:300
@ kForeign
Definition: TClass.h:300
@ kInstrumented
Definition: TClass.h:300
@ kTObject
Definition: TClass.h:300
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
Definition: TClass.cxx:1809
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5717
const char * GetContextMenuTitle() const
Definition: TClass.h:409
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
Definition: TClass.cxx:476
Bool_t HasLocalHashMember() const
void DeleteArray(void *ary, Bool_t dtorOnly=kFALSE)
Explicitly call operator delete[] for an array.
Definition: TClass.cxx:5315
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function).
Definition: TClass.cxx:2874
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method).
Definition: TClass.cxx:5726
ClassInfo_t * GetClassInfo() const
Definition: TClass.h:404
ROOT::DelFunc_t fDelete
Definition: TClass.h:211
TViewPubDataMembers * fAllPubData
Definition: TClass.h:183
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
Definition: TClass.cxx:2718
void Dump() const
Dump contents of object on stdout.
Definition: TClass.h:370
ClassInfo_t * fClassInfo
Definition: TClass.h:196
Bool_t HasConsistentHashMember()
Return 'true' if we can guarantee that if this class (or any class in this class inheritance hierarch...
Definition: TClass.h:471
void AdoptStreamer(TClassStreamer *strm)
Adopt a TClassStreamer object.
Definition: TClass.cxx:6619
TClass * GetBaseDataMember(const char *datamember)
Return pointer to (base) class that contains datamember.
Definition: TClass.cxx:2754
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Definition: TClass.cxx:5817
ECheckSum
Definition: TClass.h:102
@ kLatestCheckSum
Definition: TClass.h:111
@ kNoRange
Definition: TClass.h:106
@ kCurrentCheckSum
Definition: TClass.h:103
@ kNoBaseCheckSum
Definition: TClass.h:110
@ kReflex
Definition: TClass.h:108
@ kReflexNoComment
Definition: TClass.h:105
@ kWithTypeDef
Definition: TClass.h:107
@ kNoRangeCheck
Definition: TClass.h:109
@ kNoEnum
Definition: TClass.h:104
Long_t fOffsetStreamer
Properties that can only be evaluated at run-time.
Definition: TClass.h:240
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2824
void ResetCaches()
To clean out all caches.
Definition: TClass.cxx:4087
std::atomic< Bool_t > fVersionUsed
saved remember if fOffsetStreamer has been set.
Definition: TClass.h:227
Int_t GetClassSize() const
Definition: TClass.h:396
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Definition: TClass.cxx:2324
void SetStreamerImpl()
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition: TClass.cxx:5946
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Definition: TClass.cxx:3512
void CalculateStreamerOffset() const
Calculate the offset between an object of this class to its base class TObject.
Definition: TClass.cxx:2102
void GetMissingDictionariesForPairElements(TCollection &result, TCollection &visited, bool recurse)
Definition: TClass.cxx:3845
void ReplaceWith(TClass *newcl) const
Definition: TClass.cxx:4009
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
Definition: TClass.cxx:3746
void SetNew(ROOT::NewFunc_t newFunc)
Install a new wrapper around 'new'.
Definition: TClass.cxx:6710
void Draw(Option_t *option="")
Draw detailed class inheritance structure.
Definition: TClass.cxx:2414
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
Definition: TClass.h:568
std::atomic< TMethodCall * > fIsAMethod
Definition: TClass.h:205
static Int_t ReadRules()
Read the class.rules files from the default location:.
Definition: TClass.cxx:1739
Bool_t CanSplitBaseAllow()
Pointer to the function implementing streaming for this class.
Definition: TClass.cxx:2166
std::atomic< StreamerImpl_t > fStreamerImpl
Definition: TClass.h:252
void SetContextMenuTitle(const char *title)
Change (i.e. set) the title of the TNamed.
Definition: TClass.cxx:6000
ShowMembersFunc_t GetShowMembersWrapper() const
Definition: TClass.h:457
void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm)
Install a new member streamer (p will be copied).
Definition: TClass.cxx:6469
std::atomic< TClass ** > fPersistentRef
Definition: TClass.h:169
IsAGlobalFunc_t fGlobalIsA
pointer to the class's IsA proxy.
Definition: TClass.h:204
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
Definition: TClass.cxx:6809
void(* StreamerImpl_t)(const TClass *pThis, void *obj, TBuffer &b, const TClass *onfile_class)
Schema evolution rules.
Definition: TClass.h:248
Short_t GetImplFileLine() const
Definition: TClass.h:427
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4254
std::atomic< UChar_t > fRuntimeProperties
Definition: TClass.h:238
EState
Definition: TClass.h:115
@ kInterpreted
Definition: TClass.h:120
@ kHasTClassInit
Definition: TClass.h:121
@ kEmulated
Definition: TClass.h:119
@ kNoInfo
Definition: TClass.h:116
@ kLoaded
Definition: TClass.h:124
@ kForwardDeclared
Definition: TClass.h:118
@ kNamespaceForMeta
Definition: TClass.h:125
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
Definition: TClass.cxx:6906
Int_t GetBaseClassOffsetRecurse(const TClass *toBase)
Return data member offset to the base class "cl".
Definition: TClass.cxx:2632
ROOT::DelFunc_t GetDelete() const
static TClass * LoadClassDefault(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5550
Bool_t IsVersioned() const
Definition: TClass.h:489
void SetClassSize(Int_t sizof)
Definition: TClass.h:273
TMethod * FindClassOrBaseMethodWithId(DeclId_t faddr)
Find a method with decl id in this class or its bases.
Definition: TClass.cxx:4310
static void StreamerExternal(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
There is special streamer for the class.
Definition: TClass.cxx:6513
friend bool operator&(UChar_t l, ERuntimeProperties r)
Definition: TClass.h:235
Long_t fClassProperty
Property.
Definition: TClass.h:221
TString fContextMenuTitle
Definition: TClass.h:197
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:6539
static void ConvStreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition: TClass.cxx:6570
TListOfDataMembers * fData
Definition: TClass.h:177
std::atomic< Bool_t > fCanLoadClassInfo
Whether info was loaded from a root pcm.
Definition: TClass.h:225
void SetConvStreamerFunc(ClassConvStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom conversion streamer.
Definition: TClass.cxx:6670
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition: TClass.cxx:6789
void GetMissingDictionaries(THashTable &result, bool recurse=false)
Get the classes that have a missing dictionary starting from this one.
Definition: TClass.cxx:3959
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition: TClass.cxx:4153
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:4635
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4244
TVirtualIsAProxy * GetIsAProxy() const
Return the proxy implementing the IsA functionality.
Definition: TClass.cxx:2882
Version_t GetClassVersion() const
Definition: TClass.h:391
ROOT::MergeFunc_t GetMerge() const
ROOT::ResetAfterMergeFunc_t fResetAfterMerge
Definition: TClass.h:208
UInt_t fInstanceCount
Definition: TClass.h:191
std::atomic< Bool_t > fHasRootPcmInfo
C++ Property of the class (is abstract, has virtual table, etc.)
Definition: TClass.h:224
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4737
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
Definition: TClass.cxx:2535
ROOT::DesFunc_t fDestructor
Definition: TClass.h:213
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
Definition: TClass.cxx:3312
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
Definition: TClass.cxx:3352
void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc)
Install a new wrapper around 'delete []'.
Definition: TClass.cxx:6734
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition: TClass.cxx:3496
void ResetClassInfo()
Make sure that the current ClassInfo is up to date.
Definition: TClass.cxx:4052
ROOT::NewArrFunc_t fNewArray
Definition: TClass.h:210
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:6483
void SetImplFileName(const char *implFileName)
Definition: TClass.h:523
void GetMissingDictionariesWithRecursionCheck(TCollection &result, TCollection &visited, bool recurse)
From the second level of recursion onwards it is different state check.
Definition: TClass.cxx:3862
@ kHasLocalHashMember
Definition: TClass.h:89
@ kHasNameMapNode
Definition: TClass.h:98
@ kIgnoreTObjectStreamer
Definition: TClass.h:90
@ kUnloaded
Definition: TClass.h:91
@ kHasCustomStreamerMember
Definition: TClass.h:99
@ kWarned
Definition: TClass.h:97
@ kStartWithTObject
Definition: TClass.h:96
@ kClassSaved
Definition: TClass.h:88
@ kIsTObject
Definition: TClass.h:93
@ kIsEmulation
Definition: TClass.h:95
@ kIsForeign
Definition: TClass.h:94
@ kReservedLoading
Definition: TClass.h:86
TListOfFunctions * GetMethodList()
Return (create an empty one if needed) the list of functions.
Definition: TClass.cxx:4225
TVirtualRefProxy * GetReferenceProxy() const
Definition: TClass.h:453
void ResetMenuList()
Resets the menu list to it's standard value.
Definition: TClass.cxx:4113
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:2895
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:6504
static TClass * LoadClassCustom(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5580
UInt_t GetHeapInstanceCount() const
Definition: TClass.h:437
Short_t fImplFileLine
Definition: TClass.h:190
This class defines an interface to the cling C++ interpreter.
Definition: TCling.h:89
Collection abstract base class.
Definition: TCollection.h:63
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:159
const void * DeclId_t
Definition: TDictionary.h:206
Dictionary for function template This class describes one single function template.
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:35
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
Definition: TListOfEnums.h:33
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
A doubly linked list.
Definition: TList.h:44
Abstract base class for accessing the data-members of a class.
Method or function calling interface.
Definition: TMethodCall.h:37
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
An array of TObjects.
Definition: TObjArray.h:37
Collectable string class.
Definition: TObjString.h:28
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void Dump() const
Dump contents of object on stdout.
Definition: TObject.cxx:266
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
EStatusBits
Definition: TObject.h:57
Persistent version of a TClass.
Definition: TProtoClass.h:35
The TRealData class manages the effective list of all data members for a given class.
Definition: TRealData.h:30
Basic string class.
Definition: TString.h:131
View implementing the TList interface and giving access all the TDictionary describing public data me...
View implementing the TList interface and giving access all the TFunction describing public methods i...
Abstract Interface class describing Streamer information for one class.
TText * text
TLine * line
TClass * GetClassHelper(Bool_t, Bool_t, std::true_type)
Definition: TClass.h:585
double T(double x)
Definition: ChebyshevPol.h:34
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
void(* DirAutoAdd_t)(void *, TDirectory *)
Definition: Rtypes.h:115
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
Definition: Rtypes.h:117
void(* DesFunc_t)(void *)
Definition: Rtypes.h:114
TClass * GetClass(T *)
Definition: TClass.h:608
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' static Dictionary() method (see the ClassDef macro).
Definition: TClass.cxx:5648
void(* DelFunc_t)(void *)
Definition: Rtypes.h:112
ESTLType
Definition: ESTLType.h:28
void *(* NewArrFunc_t)(Long_t size, void *arena)
Definition: Rtypes.h:111
EFunctionMatchMode
Definition: TDictionary.h:152
@ kConversionMatch
Definition: TDictionary.h:154
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
void(* DelArrFunc_t)(void *)
Definition: Rtypes.h:113
void *(* NewFunc_t)(void *)
Definition: Rtypes.h:110
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Definition: Rtypes.h:116
auto * l
Definition: textangle.C:4