Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TSchemaRule.h"
26
27#ifdef R__LESS_INCLUDES
28class TObjArray;
29#else
30#include "TObjArray.h"
31// Not used in this header file; user code should #include this directly.
32// #include "TObjString.h"
33// #include "ThreadLocalStorage.h"
34// #include <set>
35#endif
36
37#include <cstddef>
38#include <map>
39#include <string>
40#include <unordered_map>
41#include <unordered_set>
42#include <vector>
43#include <atomic>
44
45class TBaseClass;
46class TBrowser;
47class TDataMember;
48class TCling;
49class TMethod;
50class TRealData;
51class TBuffer;
54class TMethodCall;
57class THashTable;
61class TListOfEnums;
65class TProtoClass;
66
67namespace ROOT {
68 class TGenericClassInfo;
69 class TMapTypeToTClass;
70 class TMapDeclIdToTClass;
71 namespace Detail {
72 class TSchemaRuleSet;
73 class TCollectionProxyInfo;
74 }
75 namespace Internal {
76 class TCheckHashRecursiveRemoveConsistency;
77 struct TSchemaHelper;
78 }
79}
80
83
84class TClass : public TDictionary {
85
86friend class TCling;
87friend void ROOT::ResetClassVersion(TClass*, const char*, Short_t);
89friend class TProtoClass;
91friend class TStreamerInfo;
92
93public:
94 // TClass status bits
96 kReservedLoading = BIT(7), // Internal status bits, set and reset only during initialization
97
98 /* had kClassSaved = BIT(12), */
101 kUnloaded = BIT(16), // The library containing the dictionary for this class was
102 // loaded and has been unloaded from memory.
105 /* had kIsEmulation = BIT(19), // Deprecated */
106 kStartWithTObject = BIT(20), // see comments for IsStartingWithTObject()
108 kHasNameMapNode = BIT(22)
109 };
113 kNoEnum = 1, // Used since v3.3
114 kReflexNoComment = 2, // Up to v5.34.18 (has no range/comment and no typedef at all)
115 kNoRange = 3, // Up to v5.17
116 kWithTypeDef = 4, // Up to v5.34.18 and v5.99/06
117 kReflex = 5, // Up to v5.34.18 (has no typedef at all)
118 kNoRangeCheck = 6, // Up to v5.34.18 and v5.99/06
119 kNoBaseCheckSum = 7, // Up to v5.34.18 and v5.99/06
121 };
122
123 // Describe the current state of the TClass itself.
124 enum EState {
125 kNoInfo, // The state has not yet been initialized, i.e. the TClass
126 // was just created and/or there is no trace of it in the interpreter.
127 kForwardDeclared, // The interpreted knows the entity is a class but that's it.
128 kEmulated, // The information about the class only comes from a TStreamerInfo
129 kInterpreted, // The class is described completely/only in the interpreter database.
130 kHasTClassInit, // The class has a TClass proper bootstrap coming from a run
131 // through rootcling/genreflex/TMetaUtils and the library
132 // containing this dictionary has been loaded in memory.
134 kNamespaceForMeta // Very transient state necessary to bootstrap namespace entries
135 // in ROOT Meta w/o interpreter information
136 };
137
138 // "Typed" pointer that recalls how TClass::New allocated the object.
139 // It is returned by TClass:NewObject and should be passed to TClass::DeleteArray or TClass::Destructor
140 // to delete the object.
141 // It is also used in TVirtualCollectionProxy for the same reasons.
143 {
144 void *fPtr = nullptr;
145
147
148 ObjectPtr(void *ptr = nullptr, TVirtualStreamerInfo *allocator = nullptr) : fPtr(ptr), fAllocator(allocator) {}
149
150 void *GetPtr() const { return fPtr; }
151
153
154 operator bool() const { return fPtr != nullptr; }
155 };
156
157private:
158
159
160
162 // A class which is used to collect decl names starting from normalised
163 // names (typedef resolution is excluded here, just string manipulation
164 // is performed). At the heart of the implementation, an unordered set.
165 public:
167 void AddQualifiedName(const char *name);
168 Bool_t HasDeclName(const char *name) const;
170 private:
172 std::unordered_set<std::string> fClassNamesSet;
173 mutable std::atomic_flag fSpinLock; // MSVC doesn't support = ATOMIC_FLAG_INIT;
174 };
175
177 // Trivial RAII used to insert names in the registry
179 const char* fName;
181 public:
184 };
185
186 // TClass objects can be created as a result of opening a TFile (in which
187 // they are in emulated mode) or as a result of loading the dictionary for
188 // the corresponding class. When a dictionary is loaded any pre-existing
189 // emulated TClass is replaced by the one created/coming from the dictionary.
190 // To have a reference that always point to the 'current' TClass object for
191 // a given class, one should use a TClassRef.
192 // TClassRef works by holding on to the fPersistentRef which is updated
193 // atomically whenever a TClass is replaced. During the replacement the
194 // value of fPersistentRef is set to zero, leading the TClassRef to call
195 // TClass::GetClass which is also locked by the replacement. At the end
196 // of the replacement, fPersistentRef points to the new TClass object.
197 std::atomic<TClass**> fPersistentRef = nullptr;///<!Persistent address of pointer to this TClass object and its successors.
198
199 typedef std::atomic<std::map<std::string, TObjArray*>*> ConvSIMap_t;
200
201 mutable TObjArray *fStreamerInfo = nullptr; //Array of TVirtualStreamerInfo
202 mutable ConvSIMap_t fConversionStreamerInfo = nullptr; //Array of the streamer infos derived from another class.
203 TList *fRealData = nullptr; //linked list for persistent members including base classes
204 std::atomic<TList*> fBase = nullptr; //linked list for base classes
205 std::atomic<TListOfDataMembers*> fData = nullptr; //linked list for data members; non-owning.
206 std::atomic<TListOfDataMembers*> fUsingData = nullptr; //linked list for data members pulled in through using decls.
207
208 std::atomic<TListOfEnums*> fEnums = nullptr; //linked list for the enums
209 TListOfFunctionTemplates *fFuncTemplate = nullptr; //linked list for function templates
210 //[Not public until implemented as active list]
211 std::atomic<TListOfFunctions*> fMethod = nullptr; //linked list for methods
212
213 TViewPubDataMembers *fAllPubData = nullptr; //all public data members (including from base classes)
214 TViewPubFunctions *fAllPubMethod = nullptr; //all public methods (including from base classes)
215 mutable TList *fClassMenuList = nullptr; //list of class menu items
216
217 const char *fDeclFileName = ""; //name of class declaration file
218 const char *fImplFileName = ""; //name of class implementation file
219 Short_t fDeclFileLine = 0; //line of class declaration
220 Short_t fImplFileLine = 0; //line of class implementation
221 UInt_t fInstanceCount = 0; //number of instances of this class
222 UInt_t fOnHeap = 0; //number of instances on heap
223 mutable std::atomic<UInt_t> fCheckSum = 0; //checksum of data members and base classes
224 TVirtualCollectionProxy *fCollectionProxy = nullptr; //Collection interface
225 Version_t fClassVersion = 0; //Class version Identifier
226 ClassInfo_t *fClassInfo = nullptr; //pointer to CINT class info class
227 TString fContextMenuTitle; //context menu title
228 const std::type_info *fTypeInfo = nullptr; //pointer to the C++ type information.
229 ShowMembersFunc_t fShowMembers = nullptr; //pointer to the class's ShowMembers function
230 TClassStreamer *fStreamer = nullptr; //pointer to streamer function
231 TString fSharedLibs; //shared libraries containing class code
232
233 TVirtualIsAProxy *fIsA = nullptr; ///<!pointer to the class's IsA proxy.
234 IsAGlobalFunc_t fGlobalIsA = nullptr; //pointer to a global IsA function.
235 mutable std::atomic<TMethodCall*> fIsAMethod = nullptr; ///<!saved info to call a IsA member function
236
237 ROOT::BrowseFunc_t fBrowse = nullptr; //pointer to a function implementing the TBrowser Browse() call.
238 ROOT::MergeFunc_t fMerge = nullptr; //pointer to a function implementing Merging objects of this class.
239 //pointer to a function implementing Merging objects of this class.
241 ROOT::NewFunc_t fNew = nullptr; //pointer to a function newing one object.
242 ROOT::NewArrFunc_t fNewArray = nullptr; //pointer to a function newing an array of objects.
243 ROOT::DelFunc_t fDelete = nullptr; //pointer to a function deleting one object.
244 ROOT::DelArrFunc_t fDeleteArray = nullptr; //pointer to a function deleting an array of objects.
245 ROOT::DesFunc_t fDestructor = nullptr; //pointer to a function call an object's destructor.
246 ROOT::DirAutoAdd_t fDirAutoAdd = nullptr; //pointer which implements the Directory Auto Add feature for this class.']'
247 ClassStreamerFunc_t fStreamerFunc = nullptr; //Wrapper around this class custom Streamer member function.
248 //Wrapper around this class custom conversion Streamer member function.
250 Int_t fSizeof = -1; //Sizeof the class.
251 std::size_t fAlignment = 0; //Alignment of the class (0 for unknown alignment)
252
253 std::atomic<Char_t> fCanSplit = -1; ///<!Indicates whether this class can be split or not. Values are -1, 0, 1, 2
254
255 // Bit field
256 /// Indicates whether this class represents a pair and was not created from a dictionary nor interpreter info but has
257 /// compiler compatible offset and size (and all the info is in the StreamerInfo per se)
259
260 /// @brief The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based)
261 /// automatic streamer.
263
264 mutable std::atomic<Long_t> fProperty = 0; ///<!Property See TClass::Property() for details
265 mutable Long_t fClassProperty = 0; ///<!C++ Property of the class (is abstract, has virtual table, etc.)
266
267 // fHasRootPcmInfo needs to be atomic as long as GetListOfBases needs to modify it.
268 std::atomic<Bool_t> fHasRootPcmInfo = false; ///<!Whether info was loaded from a root pcm.
269 mutable std::atomic<Bool_t> fCanLoadClassInfo = false; ///<!Indicates whether the ClassInfo is supposed to be available.
270 mutable std::atomic<Bool_t> fIsOffsetStreamerSet = false; ///<!saved remember if fOffsetStreamer has been set.
271 mutable std::atomic<Bool_t> fVersionUsed = false; ///<!Indicates whether GetClassVersion has been called
272
274 kNotInitialized = 0,
275 kSet = BIT(0),
276 // kInconsistent when kSet & !kConsistent.
278 };
280 return l & static_cast<UChar_t>(r);
281 }
282 mutable std::atomic<UChar_t> fRuntimeProperties = 0; ///<! Properties that can only be evaluated at run-time
283
284 mutable Longptr_t fOffsetStreamer = 0; ///<!saved info to call Streamer
285 Int_t fStreamerType = kDefault; ///<!cached of the streaming method to use
286 EState fState = kNoInfo; ///<!Current 'state' of the class (Emulated,Interpreted,Loaded)
287 mutable std::atomic<TVirtualStreamerInfo*> fCurrentInfo = nullptr; ///<!cached current streamer info.
288 mutable std::atomic<TVirtualStreamerInfo*> fLastReadInfo = nullptr; ///<!cached streamer info used in the last read.
289 TVirtualRefProxy *fRefProxy = nullptr; ///<!Pointer to reference proxy if this class represents a reference
290 ROOT::Detail::TSchemaRuleSet *fSchemaRules = nullptr; ///<! Schema evolution rules
291
292 typedef void (*StreamerImpl_t)(const TClass* pThis, void *obj, TBuffer &b, const TClass *onfile_class);
293#ifdef R__NO_ATOMIC_FUNCTION_POINTER
294 mutable StreamerImpl_t fStreamerImpl = StreamerDefault; ///<! Pointer to the function implementing streaming for this class
295#else
296 mutable std::atomic<StreamerImpl_t> fStreamerImpl = StreamerDefault; ///<! Pointer to the function implementing streaming for this class
297#endif
298
304 void Init(const char *name, Version_t cversion, const std::type_info *info,
306 const char *dfil, const char *ifil,
307 Int_t dl, Int_t il,
309 Bool_t silent);
310 void LoadClassInfo() const;
311
312 static TClass *LoadClassDefault(const char *requestedname, Bool_t silent);
313 static TClass *LoadClassCustom(const char *requestedname, Bool_t silent);
314
317 void SetClassAlignment(std::size_t align) { fAlignment = align; }
319
321
323
324 // Various implementation for TClass::Stramer
325 static void StreamerExternal(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
326 static void StreamerTObject(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
327 static void StreamerTObjectInitialized(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
328 static void StreamerTObjectEmulated(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
329 static void StreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
330 static void ConvStreamerInstrumented(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
331 static void StreamerStreamerInfo(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
332 static void StreamerDefault(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class);
333
334 static IdMap_t *GetIdMap(); //Map from typeid to TClass pointer
335 static DeclIdMap_t *GetDeclIdMap(); //Map from DeclId_t to TClass pointer
336 static std::atomic<Int_t> fgClassCount; //provides unique id for a each class
337 //stored in TObject::fUniqueID
338 static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry; // Store decl names of the forwardd and no info instances
339 static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char*);
340
341 // Internal status bits, set and reset only during initialization and thus under the protection of the global lock.
343 // Internal streamer type.
345
346 // These are the above-referenced hash tables. (The pointers are null
347 // if no entries have been made.)
349
351
352 mutable TVirtualMutex *fOVRMutex = nullptr;
353 typedef std::multimap<void*, Version_t> RepoCont_t;
355
356 void UnregisterAddressInRepository(const char *where, void *location, const TClass *what) const;
357 void MoveAddressInRepository(const char *where, void *oldadd, void *newadd, const TClass *what) const;
358 void RegisterAddressInRepository(const char *where, void *location, const TClass *what) const;
359
360private:
361 TClass(const TClass& tc) = delete;
362 TClass& operator=(const TClass&) = delete;
363
365 TList *CreateListOfDataMembers(std::atomic<TListOfDataMembers*> &data, TDictionary::EMemberSelection selection, bool load);
366
367protected:
373
374 using SchemaHelperMap_t = std::unordered_map<std::string, std::vector<ROOT::Internal::TSchemaHelper>>;
376
377public:
378 TClass();
379 TClass(const char *name, Bool_t silent = kFALSE);
383 const char *dfil, const char *ifil = nullptr,
384 Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
385 TClass(const char *name, Version_t cversion,
386 const char *dfil, const char *ifil = nullptr,
387 Int_t dl = 0, Int_t il = 0, Bool_t silent = kFALSE);
388 TClass(const char *name, Version_t cversion,
389 const std::type_info &info, TVirtualIsAProxy *isa,
390 const char *dfil, const char *ifil,
392 virtual ~TClass();
393
395 void AddImplFile(const char *filename, int line);
396 static Bool_t AddRule(const char *rule);
397 static Int_t ReadRules(const char *filename);
398 static Int_t ReadRules();
400 void Browse(TBrowser *b) override;
401 void BuildRealData(void *pointer = nullptr, Bool_t isTransient = kFALSE);
403 void CalculateStreamerOffset() const;
405 Bool_t CanSplit() const;
407 Long_t ClassProperty() const;
408 TObject *Clone(const char *newname="") const override;
410 void Draw(Option_t *option="") override;
411 void Dump() const override { TDictionary::Dump(); }
412 void Dump(const void *obj, Bool_t noAddr = kFALSE) const;
413 char *EscapeChars(const char *text) const;
419 void ForceReload (TClass* oldcl);
423 Bool_t HasInterpreterInfoInMemory() const { return nullptr != fClassInfo; }
430 TMethod *GetClassMethod(const char *name, const char *params, Bool_t objectIsConst = kFALSE);
431 TMethod *GetClassMethodWithPrototype(const char *name, const char *proto,
435 if (!fVersionUsed.load(std::memory_order_relaxed))
437 return fClassVersion;
438 }
439 Int_t GetClassSize() const { return Size(); }
440 size_t GetClassAlignment() const;
441 TDataMember *GetDataMember(const char *datamember) const;
442 Longptr_t GetDataMemberOffset(const char *membername) const;
443 const char *GetDeclFileName() const;
451 return fClassInfo;
452 }
453 const char *GetContextMenuTitle() const { return fContextMenuTitle; }
455 auto current = fCurrentInfo.load(std::memory_order_relaxed);
456 if (current) return current;
457 else return DetermineCurrentStreamerInfo();
458 }
467 TCollection *GetListOfMethodOverloads(const char* name) const;
468 TList *GetListOfRealData() const { return fRealData; }
471 const char *GetImplFileName() const { return fImplFileName; }
473 TClass *GetActualClass(const void *object) const;
474 TClass *GetBaseClass(const char *classname);
475 TClass *GetBaseClass(const TClass *base);
476 Int_t GetBaseClassOffset(const TClass *toBase, void *address = nullptr, bool isDerivedObject = true);
477 TClass *GetBaseDataMember(const char *datamember);
484 TList *GetMenuList() const;
485 TMethod *GetMethod(const char *method, const char *params, Bool_t objectIsConst = kFALSE);
488 TMethod *GetMethodAny(const char *method);
489 TMethod *GetMethodAllAny(const char *method);
490 Int_t GetNdata();
494 ROOT::NewFunc_t GetNew() const;
497 TClass *const*GetPersistentRef() const { return fPersistentRef; }
498 TRealData *GetRealData(const char *name) const;
502 const char *GetSharedLibs();
504 EState GetState() const { return fState; }
508 const TObjArray *GetStreamerInfos() const { return fStreamerInfo; }
512 const std::type_info *GetTypeInfo() const { return fTypeInfo; };
513
514 /// @brief Return 'true' if we can guarantee that if this class (or any class in
515 /// this class inheritance hierarchy) overload TObject::Hash it also starts
516 /// the RecursiveRemove process from its own destructor.
523 /// @brief The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based) automatic streamer.
525 Bool_t HasDictionary() const;
526 static Bool_t HasDictionarySelection(const char* clname);
528 void GetMissingDictionaries(THashTable& result, bool recurse = false);
530 Bool_t InheritsFrom(const char *cl) const override;
531 Bool_t InheritsFrom(const TClass *cl) const override;
533 Bool_t IsFolder() const override { return kTRUE; }
534 Bool_t IsLoaded() const;
535 Bool_t IsForeign() const;
538 Bool_t IsVersioned() const { return !( GetClassVersion()<=1 && IsForeign() ); }
539 Bool_t IsTObject() const;
540 static TClass *LoadClass(const char *requestedname, Bool_t silent);
541 void ls(Option_t *opt="") const override;
542 void MakeCustomMenuList();
544 void Move(void *arenaFrom, void *arenaTo) const;
545 void *New(ENewType defConstructor = kClassNew, Bool_t quiet = kFALSE) const;
546 void *New(void *arena, ENewType defConstructor = kClassNew) const;
547 void *NewArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
548 void *NewArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
549 ObjectPtr NewObject(ENewType defConstructor = kClassNew, Bool_t quiet = kFALSE) const;
550 ObjectPtr NewObject(void *arena, ENewType defConstructor = kClassNew) const;
551 ObjectPtr NewObjectArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
552 ObjectPtr NewObjectArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
553 virtual void PostLoadCheck();
554 Long_t Property() const override;
555 Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
556 Int_t ReadBuffer(TBuffer &b, void *pointer);
557 static void RegisterReadRules(ROOT::TSchemaRule::RuleType_t, const char *classname,
558 std::vector<::ROOT::Internal::TSchemaHelper> &&rules);
561 void ReplaceWith(TClass *newcl) const;
562 void ResetCaches();
564 void ResetClassInfo();
566 void ResetMenuList();
567 Int_t Size() const;
570 void SetContextMenuTitle(const char *title);
585 void SetUnloaded();
586 Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="");
587
590 bool AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
594
595 // Function to retrieve the TClass object and dictionary function
596 static void AddClass(TClass *cl);
598 static void RemoveClass(TClass *cl);
600 static TClass *GetClass(const char *name, Bool_t load = kTRUE, Bool_t silent = kFALSE);
601 static TClass *GetClass(const char *name, Bool_t load, Bool_t silent, size_t hint_pair_offset, size_t hint_pair_size);
602 static TClass *GetClass(const std::type_info &typeinfo, Bool_t load = kTRUE, Bool_t silent = kFALSE, size_t hint_pair_offset = 0, size_t hint_pair_size = 0);
604 template<typename T>
605 static TClass *GetClass(Bool_t load = kTRUE, Bool_t silent = kFALSE);
606 static Bool_t GetClass(DeclId_t id, std::vector<TClass*> &classes);
607 static DictFuncPtr_t GetDict (const char *cname);
608 static DictFuncPtr_t GetDict (const std::type_info &info);
609
610 static Int_t AutoBrowse(TObject *obj, TBrowser *browser);
611 static ENewType IsCallingNew();
612 static TClass *Load(TBuffer &b);
613 void Store(TBuffer &b) const;
614
615 // Pseudo-method apply to the 'obj'. In particular those are used to
616 // implement TObject like methods for non-TObject classes.
617 Int_t Browse(void *obj, TBrowser *b) const;
618 void DeleteArray(void *ary, Bool_t dtorOnly = kFALSE);
619 void DeleteArray(ObjectPtr ary, Bool_t dtorOnly = kFALSE);
620 void Destructor(void *obj, Bool_t dtorOnly = kFALSE);
621 void Destructor(ObjectPtr obj, Bool_t dtorOnly = kFALSE);
622 void *DynamicCast(const TClass *base, void *obj, Bool_t up = kTRUE);
623 const void *DynamicCast(const TClass *base, const void *obj, Bool_t up = kTRUE);
624 Bool_t IsFolder(void *obj) const;
625
626 inline void Streamer(void *obj, TBuffer &b, const TClass *onfile_class = nullptr) const
627 {
628 // Inline for performance, skipping one function call.
629#ifdef R__NO_ATOMIC_FUNCTION_POINTER
630 fStreamerImpl(this,obj,b,onfile_class);
631#else
632 auto t = fStreamerImpl.load();
633 t(this,obj,b,onfile_class);
634#endif
635 }
636
637 ClassDefOverride(TClass,0) //Dictionary containing class information
638};
639
640namespace ROOT {
641namespace Internal {
642template <typename T>
644{
645 return T::Class();
646}
647
648template <typename T>
651 return TClass::GetClass(typeid(T), load, silent);
652 }
653};
654
655template <typename F, typename S>
656struct TClassGetClassHelper<std::pair<F, S> > {
657 static TClass *GetClass(Bool_t load, Bool_t silent) {
658 using pair_t = std::pair<F,S>;
659 size_t hint_offset = offsetof(pair_t, second);
660 return TClass::GetClass(typeid(std::pair<F, S>), load, silent, hint_offset, sizeof(std::pair<F,S>));
661 }
662};
663
664template <typename T>
665TClass *GetClassHelper(Bool_t load, Bool_t silent, std::false_type)
666{
668}
669
670} // namespace Internal
671} // namespace ROOT
672
673template <typename T>
675{
676 typename std::is_base_of<TObject, T>::type tag;
677 return ROOT::Internal::GetClassHelper<T>(load, silent, tag);
678}
679
680namespace ROOT {
681
682template <typename T> TClass *GetClass(T * /* dummy */) { return TClass::GetClass<T>(); }
683template <typename T> TClass *GetClass(const T * /* dummy */) { return TClass::GetClass<T>(); }
684
685#ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
686 // This can only be used when the template overload resolution can distinguish between T* and T**
687 template <typename T> TClass* GetClass( T** /* dummy */) { return TClass::GetClass<T>(); }
688 template <typename T> TClass* GetClass(const T** /* dummy */) { return TClass::GetClass<T>(); }
689 template <typename T> TClass* GetClass( T* const* /* dummy */) { return TClass::GetClass<T>(); }
690 template <typename T> TClass* GetClass(const T* const* /* dummy */) { return TClass::GetClass<T>(); }
691#endif
692
693 extern TClass *CreateClass(const char *cname, Version_t id,
694 const char *dfil, const char *ifil,
695 Int_t dl, Int_t il);
696}
697
698#endif // ROOT_TClass
#define b(i)
Definition RSha256.hxx:100
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
Definition RtypesCore.h:52
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
TClass *(* DictFuncPtr_t)()
Definition Rtypes.h:86
#define BIT(n)
Definition Rtypes.h:91
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
Definition Rtypes.h:80
TClass *(* IsAGlobalFunc_t)(const TClass *, const void *obj)
Definition Rtypes.h:102
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
Definition Rtypes.h:100
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
void(* ClassStreamerFunc_t)(TBuffer &, void *)
Definition Rtypes.h:78
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
Definition Rtypes.h:79
ROOT::TMapDeclIdToTClass DeclIdMap_t
Definition TClass.h:82
ROOT::TMapTypeToTClass IdMap_t
Definition TClass.h:81
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kIsClass
Definition TDictionary.h:65
@ kIsStruct
Definition TDictionary.h:66
@ kIsUnion
Definition TDictionary.h:67
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char text
char name[80]
Definition TGX11.cxx:145
const char * proto
Definition civetweb.c:18822
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:43
TDeclNameRegistry & fNoInfoOrEmuOrFwdDeclNameRegistry
Definition TClass.h:180
InsertTClassInRegistryRAII(TClass::EState &state, const char *name, TDeclNameRegistry &emuRegistry)
Definition TClass.cxx:250
Bool_t HasDeclName(const char *name) const
Definition TClass.cxx:225
std::unordered_set< std::string > fClassNamesSet
Definition TClass.h:172
void AddQualifiedName(const char *name)
Extract this part of the name.
Definition TClass.cxx:198
TDeclNameRegistry(Int_t verbLevel=0)
TDeclNameRegistry class constructor.
Definition TClass.cxx:187
std::atomic_flag fSpinLock
Definition TClass.h:173
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
TClass *const * GetPersistentRef() const
Definition TClass.h:497
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition TClass.cxx:6616
Bool_t IsSyntheticPair() const
Definition TClass.h:537
RepoCont_t fObjectVersionRepository
Definition TClass.h:354
void SetClassAlignment(std::size_t align)
Definition TClass.h:317
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=nullptr) const
Definition TClass.h:626
ShowMembersFunc_t fShowMembers
Definition TClass.h:229
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Definition TClass.cxx:3501
TVirtualIsAProxy * fIsA
!pointer to the class's IsA proxy.
Definition TClass.h:233
TList * GetListOfUsingDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of using declarations of a class.
Definition TClass.cxx:3844
void ForceReload(TClass *oldcl)
we found at least one equivalent.
Definition TClass.cxx:1305
ROOT::DelArrFunc_t fDeleteArray
Definition TClass.h:244
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Definition TClass.cxx:2326
TClassStreamer * fStreamer
Definition TClass.h:230
void SetDirectoryAutoAdd(ROOT::DirAutoAdd_t dirAutoAddFunc)
Install a new wrapper around the directory auto add function.
Definition TClass.cxx:7151
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:5263
static TDeclNameRegistry fNoInfoOrEmuOrFwdDeclNameRegistry
Definition TClass.h:338
friend class ROOT::TGenericClassInfo
Definition TClass.h:88
TListOfFunctionTemplates * fFuncTemplate
Definition TClass.h:209
ClassStreamerFunc_t fStreamerFunc
Definition TClass.h:247
void AdoptReferenceProxy(TVirtualRefProxy *proxy)
Adopt the Reference proxy pointer to indicate that this class represents a reference.
Definition TClass.cxx:6796
TMethod * GetClassMethod(Longptr_t faddr)
Look for a method in this class that has the interface function address faddr.
Definition TClass.cxx:4541
TVirtualStreamerInfo * DetermineCurrentStreamerInfo()
Determine and set pointer to current TVirtualStreamerInfo.
Definition TClass.cxx:5754
void Browse(TBrowser *b) override
This method is called by a browser to get the class information.
Definition TClass.cxx:2017
EState GetState() const
Definition TClass.h:504
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
Definition TClass.cxx:2907
void ResetInstanceCount()
Definition TClass.h:565
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition TClass.cxx:2960
void RemoveStreamerInfo(Int_t slot)
Remove and delete the StreamerInfo in the given slot.
Definition TClass.cxx:7477
void SetCanSplit(Int_t splitmode)
Set the splitability of this class:
Definition TClass.cxx:5728
void AddInstance(Bool_t heap=kFALSE)
Definition TClass.h:394
bool 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:6817
TList * CreateListOfDataMembers(std::atomic< TListOfDataMembers * > &data, TDictionary::EMemberSelection selection, bool load)
Create the list containing the TDataMembers (of actual data members or members pulled in through usin...
Definition TClass.cxx:3799
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:4767
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition TClass.cxx:5048
void SetMerge(ROOT::MergeFunc_t mergeFunc)
Install a new wrapper around 'Merge'.
Definition TClass.cxx:7092
void SetBrowse(ROOT::BrowseFunc_t browseFunc)
Install a new wrapper around 'Browse'.
Definition TClass.cxx:7084
ConvSIMap_t fConversionStreamerInfo
Definition TClass.h:202
ROOT::DirAutoAdd_t fDirAutoAdd
Definition TClass.h:246
Bool_t HasDataMemberInfo() const
Definition TClass.h:420
TVirtualRefProxy * fRefProxy
!Pointer to reference proxy if this class represents a reference
Definition TClass.h:289
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition TClass.cxx:4399
ROOT::MergeFunc_t fMerge
Definition TClass.h:238
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:4469
static TClass * Load(TBuffer &b)
Load class description from I/O buffer and return class object.
Definition TClass.cxx:5817
EState fState
!Current 'state' of the class (Emulated,Interpreted,Loaded)
Definition TClass.h:286
ROOT::DesFunc_t GetDestructor() const
Return the wrapper around the destructor.
Definition TClass.cxx:7644
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:4514
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Replaces the collection proxy for this class.
Definition TClass.cxx:2477
Int_t fStreamerType
!cached of the streaming method to use
Definition TClass.h:285
TList * fRealData
Definition TClass.h:203
UInt_t fOnHeap
Definition TClass.h:222
static void RegisterReadRules(ROOT::TSchemaRule::RuleType_t, const char *classname, std::vector<::ROOT::Internal::TSchemaHelper > &&rules)
Register a set of read rules for a target class.
Definition TClass.cxx:7421
void ls(Option_t *opt="") const override
The ls function lists the contents of a class on stdout.
Definition TClass.cxx:4316
std::atomic< TList * > fBase
Definition TClass.h:204
std::atomic< Char_t > fCanSplit
!Indicates whether this class can be split or not. Values are -1, 0, 1, 2
Definition TClass.h:253
Bool_t HasDictionary() const
Check whether a class has a dictionary or not.
Definition TClass.cxx:3964
const TList * GetListOfAllPublicMethods(Bool_t load=kTRUE)
Returns a list of all public methods of this class and its base classes.
Definition TClass.cxx:3903
Bool_t HasCustomStreamerMember() const
The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based...
Definition TClass.h:524
void SetDeclFile(const char *name, Short_t line)
Definition TClass.h:573
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
Definition TClass.cxx:3920
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:578
virtual ~TClass()
TClass dtor. Deletes all list that might have been created.
Definition TClass.cxx:1648
Bool_t fIsSyntheticPair
Indicates whether this class represents a pair and was not created from a dictionary nor interpreter ...
Definition TClass.h:258
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
Definition TClass.cxx:5470
Version_t fClassVersion
Definition TClass.h:225
std::atomic< TVirtualStreamerInfo * > fCurrentInfo
!cached current streamer info.
Definition TClass.h:287
TList * GetListOfFunctionTemplates(Bool_t load=kTRUE)
Return TListOfFunctionTemplates for a class.
Definition TClass.cxx:3856
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:4973
const char * fImplFileName
Definition TClass.h:218
void RegisterStreamerInfo(TVirtualStreamerInfo *info)
Register the StreamerInfo in the given slot, change the State of the TClass as appropriate.
Definition TClass.cxx:7453
TClass & operator=(const TClass &)=delete
std::atomic< UInt_t > fCheckSum
Definition TClass.h:223
void UnregisterAddressInRepository(const char *where, void *location, const TClass *what) const
Definition TClass.cxx:320
std::atomic< TListOfFunctions * > fMethod
Definition TClass.h:211
static void RemoveClassDeclId(TDictionary::DeclId_t id)
Definition TClass.cxx:605
void SetNewArray(ROOT::NewArrFunc_t newArrayFunc)
Install a new wrapper around 'new []'.
Definition TClass.cxx:7116
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:2212
const char * fDeclFileName
Definition TClass.h:217
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:6354
static Bool_t HasDictionarySelection(const char *clname)
Check whether a class has a dictionary or ROOT can load one.
Definition TClass.cxx:3975
void AdoptSchemaRules(ROOT::Detail::TSchemaRuleSet *rules)
Adopt a new set of Data Model Evolution rules.
Definition TClass.cxx:1908
static void StreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition TClass.cxx:6951
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:6484
static std::atomic< Int_t > fgClassCount
Definition TClass.h:336
TVirtualStreamerInfo * GetCurrentStreamerInfo()
Definition TClass.h:454
ROOT::DirAutoAdd_t GetDirectoryAutoAdd() const
Return the wrapper around the directory auto add function.
Definition TClass.cxx:7652
void AddImplFile(const char *filename, int line)
Definition TClass.cxx:1954
TCollection * GetListOfMethodOverloads(const char *name) const
Return the collection of functions named "name".
Definition TClass.cxx:3885
std::atomic< TListOfEnums * > fEnums
Definition TClass.h:208
static Bool_t HasNoInfoOrEmuOrFwdDeclaredDecl(const char *)
Definition TClass.cxx:3460
TVirtualMutex * fOVRMutex
Definition TClass.h:352
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
Definition TClass.cxx:3744
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:6034
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition TClass.cxx:3870
size_t GetClassAlignment() const
Return the alignment requirement (in bytes) for objects of this class.
Definition TClass.cxx:5781
TClass()
Internal, default constructor.
Definition TClass.cxx:1139
Short_t fDeclFileLine
Definition TClass.h:219
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:4631
std::atomic< Bool_t > fIsOffsetStreamerSet
!saved remember if fOffsetStreamer has been set.
Definition TClass.h:270
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
Definition TClass.cxx:4899
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition TClass.cxx:2935
static IdMap_t * GetIdMap()
Definition TClass.cxx:471
UInt_t GetInstanceCount() const
Definition TClass.h:481
void SetDelete(ROOT::DelFunc_t deleteFunc)
Install a new wrapper around 'delete'.
Definition TClass.cxx:7124
void SetLastReadInfo(TVirtualStreamerInfo *info)
Definition TClass.h:460
static Int_t AutoBrowse(TObject *obj, TBrowser *browser)
Browse external object inherited from TObject.
Definition TClass.cxx:1968
ROOT::NewFunc_t GetNew() const
Return the wrapper around new ThisClass().
Definition TClass.cxx:7612
TClass * GetBaseClass(const char *classname)
Return pointer to the base class "classname".
Definition TClass.cxx:2662
Longptr_t GetDataMemberOffset(const char *membername) const
return offset for member name.
Definition TClass.cxx:3539
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:4612
void SetDestructor(ROOT::DesFunc_t destructorFunc)
Install a new wrapper around the destructor.
Definition TClass.cxx:7140
virtual void PostLoadCheck()
Do the initialization that can only be done after the CINT dictionary has been fully populated and ca...
Definition TClass.cxx:6064
void LoadClassInfo() const
Try to load the ClassInfo if available.
Definition TClass.cxx:5926
void SetResetAfterMerge(ROOT::ResetAfterMergeFunc_t resetFunc)
Install a new wrapper around 'ResetAfterMerge'.
Definition TClass.cxx:7100
TVirtualStreamerInfo * GetStreamerInfoImpl(Int_t version, Bool_t silent) const
Definition TClass.cxx:4692
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:6605
TViewPubFunctions * fAllPubMethod
Definition TClass.h:214
ERuntimeProperties
Definition TClass.h:273
Bool_t HasInterpreterInfo() const
Definition TClass.h:424
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
Definition TClass.cxx:557
void GetMissingDictionariesForBaseClasses(TCollection &result, TCollection &visited, bool recurse)
Verify the base classes always.
Definition TClass.cxx:3985
ROOT::Detail::TSchemaRuleSet * fSchemaRules
! Schema evolution rules
Definition TClass.h:290
std::atomic< Long_t > fProperty
!Property See TClass::Property() for details
Definition TClass.h:264
TVirtualStreamerInfo * GetLastReadInfo() const
Definition TClass.h:459
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:6988
void SetUnloaded()
Call this method to indicate that the shared library containing this class's code has been removed (u...
Definition TClass.cxx:6420
ROOT::DelArrFunc_t GetDeleteArray() const
Return the wrapper around delete [] ThisObject.
Definition TClass.cxx:7636
Bool_t HasInterpreterInfoInMemory() const
Definition TClass.h:423
TList * fClassMenuList
Definition TClass.h:215
ClassConvStreamerFunc_t fConvStreamerFunc
Definition TClass.h:249
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition TClass.cxx:2038
void SetRuntimeProperties()
Internal routine to set calculate the class properties that can only be known at run-time,...
Definition TClass.cxx:6303
void BuildEmulatedRealData(const char *name, Longptr_t offset, TClass *cl, Bool_t isTransient=kFALSE)
Build the list of real data for an emulated class.
Definition TClass.cxx:2119
std::unordered_map< std::string, std::vector< ROOT::Internal::TSchemaHelper > > SchemaHelperMap_t
Definition TClass.h:374
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition TClass.cxx:5851
TString fSharedLibs
Definition TClass.h:231
const std::type_info * GetTypeInfo() const
Definition TClass.h:512
void SetStreamerImpl(Int_t streamerType)
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition TClass.cxx:6324
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition TClass.cxx:3828
ENewType
Definition TClass.h:110
@ kClassNew
Definition TClass.h:110
@ kRealNew
Definition TClass.h:110
@ kDummyNew
Definition TClass.h:110
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:4385
static DeclIdMap_t * GetDeclIdMap()
Definition TClass.cxx:482
Short_t GetDeclFileLine() const
Definition TClass.h:444
void SetStreamerFunc(ClassStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom streamer.
Definition TClass.cxx:7037
const char * GetImplFileName() const
Definition TClass.h:471
TList * GetListOfRealData() const
Definition TClass.h:468
Int_t Size() const
Return size of object of this class.
Definition TClass.cxx:5806
void SetCurrentStreamerInfo(TVirtualStreamerInfo *info)
Set pointer to current TVirtualStreamerInfo.
Definition TClass.cxx:5766
static DictFuncPtr_t GetDict(const char *cname)
Return a pointer to the dictionary loading function generated by rootcint.
Definition TClass.cxx:3484
Longptr_t fOffsetStreamer
!saved info to call Streamer
Definition TClass.h:284
Int_t fSizeof
Definition TClass.h:250
ROOT::NewArrFunc_t GetNewArray() const
Return the wrapper around new ThisClass[].
Definition TClass.cxx:7620
std::multimap< void *, Version_t > RepoCont_t
Definition TClass.h:353
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:6938
ROOT::NewFunc_t fNew
Definition TClass.h:241
@ kLoading
Definition TClass.h:342
@ kUnloading
Definition TClass.h:342
ROOT::ResetAfterMergeFunc_t GetResetAfterMerge() const
Return the wrapper around Merge.
Definition TClass.cxx:7604
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:4585
Bool_t CanIgnoreTObjectStreamer()
Definition TClass.h:406
void SetGlobalIsA(IsAGlobalFunc_t)
This function installs a global IsA function for this class.
Definition TClass.cxx:6410
void GetMissingDictionariesForMembers(TCollection &result, TCollection &visited, bool recurse)
Verify the Data Members.
Definition TClass.cxx:4002
TObjArray * fStreamerInfo
Definition TClass.h:201
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Definition TClass.cxx:1934
TObject * Clone(const char *newname="") const override
Create a Clone of this TClass object using a different name but using the same 'dictionary'.
Definition TClass.cxx:2413
TVirtualCollectionProxy * fCollectionProxy
Definition TClass.h:224
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
Definition TClass.cxx:6007
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition TClass.cxx:3694
void Store(TBuffer &b) const
Store class description on I/O buffer.
Definition TClass.cxx:5965
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:2249
static THashTable * fgClassTypedefHash
Definition TClass.h:348
Bool_t HasDirectStreamerInfoUse() const
Definition TClass.h:422
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:1339
std::atomic< TListOfDataMembers * > fData
Definition TClass.h:205
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:6973
const TObjArray * GetStreamerInfos() const
Definition TClass.h:508
void SetClassVersion(Version_t version)
Private function.
Definition TClass.cxx:5745
char * EscapeChars(const char *text) const
Introduce an escape character (@) in front of a special chars.
Definition TClass.cxx:2575
const std::type_info * fTypeInfo
Definition TClass.h:228
std::atomic< TVirtualStreamerInfo * > fLastReadInfo
!cached streamer info used in the last read.
Definition TClass.h:288
std::atomic< std::map< std::string, TObjArray * > * > ConvSIMap_t
Definition TClass.h:199
static void StreamerTObject(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of TObjects.
Definition TClass.cxx:6908
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Definition TClass.cxx:6017
EStreamerType
Definition TClass.h:344
@ kDefault
Definition TClass.h:344
@ kEmulatedStreamer
Definition TClass.h:344
@ kExternal
Definition TClass.h:344
@ kForeign
Definition TClass.h:344
@ kInstrumented
Definition TClass.h:344
@ kTObject
Definition TClass.h:344
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
Definition TClass.cxx:1878
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition TClass.cxx:6043
const char * GetContextMenuTitle() const
Definition TClass.h:453
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
Definition TClass.cxx:587
Bool_t HasLocalHashMember() const
Returns true if this class has an definition and/or overload of the member function Hash.
Definition TClass.cxx:7578
void DeleteArray(void *ary, Bool_t dtorOnly=kFALSE)
Explicitly call operator delete[] for an array.
Definition TClass.cxx:5599
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function).
Definition TClass.cxx:2968
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method).
Definition TClass.cxx:6052
ClassInfo_t * GetClassInfo() const
Definition TClass.h:448
ROOT::DelFunc_t fDelete
Definition TClass.h:243
TViewPubDataMembers * fAllPubData
Definition TClass.h:213
ClassInfo_t * fClassInfo
Definition TClass.h:226
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Definition TClass.cxx:4657
Bool_t HasConsistentHashMember()
Return 'true' if we can guarantee that if this class (or any class in this class inheritance hierarch...
Definition TClass.h:517
void AdoptStreamer(TClassStreamer *strm)
Adopt a TClassStreamer object.
Definition TClass.cxx:7009
TClass * GetBaseDataMember(const char *datamember)
Return pointer to (base) class that contains datamember.
Definition TClass.cxx:2848
ECheckSum
Definition TClass.h:111
@ kLatestCheckSum
Definition TClass.h:120
@ kNoRange
Definition TClass.h:115
@ kCurrentCheckSum
Definition TClass.h:112
@ kNoBaseCheckSum
Definition TClass.h:119
@ kReflex
Definition TClass.h:117
@ kReflexNoComment
Definition TClass.h:114
@ kWithTypeDef
Definition TClass.h:116
@ kNoRangeCheck
Definition TClass.h:118
@ kNoEnum
Definition TClass.h:113
void Dump() const override
Dump contents of object on stdout.
Definition TClass.h:411
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4932
Int_t GetBaseClassOffset(const TClass *toBase, void *address=nullptr, bool isDerivedObject=true)
Definition TClass.cxx:2812
ObjectPtr NewObjectArray(Long_t nElements, ENewType defConstructor=kClassNew) const
Return a pointer to a newly allocated array of objects of this class.
Definition TClass.cxx:5279
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition TClass.cxx:2918
void ResetCaches()
To clean out all caches.
Definition TClass.cxx:4273
std::atomic< Bool_t > fVersionUsed
!Indicates whether GetClassVersion has been called
Definition TClass.h:271
Int_t GetClassSize() const
Definition TClass.h:439
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Definition TClass.cxx:2403
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Definition TClass.cxx:3681
void CalculateStreamerOffset() const
Calculate the offset between an object of this class to its base class TObject.
Definition TClass.cxx:2190
void GetMissingDictionariesForPairElements(TCollection &result, TCollection &visited, bool recurse)
Definition TClass.cxx:4031
void ReplaceWith(TClass *newcl) const
Definition TClass.cxx:4200
void RegisterAddressInRepository(const char *where, void *location, const TClass *what) const
Definition TClass.cxx:292
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
Definition TClass.cxx:6191
Bool_t HasDefaultConstructor(Bool_t testio=kFALSE) const
Return true if we have access to a constructor usable for I/O.
Definition TClass.cxx:7550
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
Definition TClass.cxx:3932
void SetNew(ROOT::NewFunc_t newFunc)
Install a new wrapper around 'new'.
Definition TClass.cxx:7108
std::atomic< TMethodCall * > fIsAMethod
!saved info to call a IsA member function
Definition TClass.h:235
static Int_t ReadRules()
Read the class.rules files from the default location:.
Definition TClass.cxx:1808
Bool_t CanSplitBaseAllow()
Definition TClass.cxx:2254
void MoveAddressInRepository(const char *where, void *oldadd, void *newadd, const TClass *what) const
Definition TClass.cxx:339
std::size_t fAlignment
Definition TClass.h:251
std::atomic< StreamerImpl_t > fStreamerImpl
! Pointer to the function implementing streaming for this class
Definition TClass.h:296
void SetContextMenuTitle(const char *title)
Change (i.e. set) the title of the TNamed.
Definition TClass.cxx:6379
ShowMembersFunc_t GetShowMembersWrapper() const
Definition TClass.h:503
void SetMemberStreamer(const char *name, MemberStreamerFunc_t strm)
Install a new member streamer (p will be copied).
Definition TClass.cxx:6852
std::atomic< TClass ** > fPersistentRef
!Persistent address of pointer to this TClass object and its successors.
Definition TClass.h:197
IsAGlobalFunc_t fGlobalIsA
Definition TClass.h:234
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:7209
void(* StreamerImpl_t)(const TClass *pThis, void *obj, TBuffer &b, const TClass *onfile_class)
Definition TClass.h:292
Short_t GetImplFileLine() const
Definition TClass.h:472
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Definition TClass.cxx:4442
std::atomic< UChar_t > fRuntimeProperties
! Properties that can only be evaluated at run-time
Definition TClass.h:282
@ kInterpreted
Definition TClass.h:129
@ kHasTClassInit
Definition TClass.h:130
@ kEmulated
Definition TClass.h:128
@ kNoInfo
Definition TClass.h:125
@ kLoaded
Definition TClass.h:133
@ kForwardDeclared
Definition TClass.h:127
@ kNamespaceForMeta
Definition TClass.h:134
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:7316
Int_t GetBaseClassOffsetRecurse(const TClass *toBase)
Return data member offset to the base class "cl".
Definition TClass.cxx:2712
ROOT::DelFunc_t GetDelete() const
Return the wrapper around delete ThisObject.
Definition TClass.cxx:7628
static TClass * LoadClassDefault(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition TClass.cxx:5873
Bool_t IsVersioned() const
Definition TClass.h:538
void SetClassSize(Int_t sizof)
Definition TClass.h:316
TMethod * FindClassOrBaseMethodWithId(DeclId_t faddr)
Find a method with decl id in this class or its bases.
Definition TClass.cxx:4498
static void StreamerExternal(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
There is special streamer for the class.
Definition TClass.cxx:6896
friend bool operator&(UChar_t l, ERuntimeProperties r)
Definition TClass.h:279
Long_t fClassProperty
!C++ Property of the class (is abstract, has virtual table, etc.)
Definition TClass.h:265
TString fContextMenuTitle
Definition TClass.h:227
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:6922
static void ConvStreamerInstrumented(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
Case of instrumented class with a library.
Definition TClass.cxx:6960
std::atomic< Bool_t > fCanLoadClassInfo
!Indicates whether the ClassInfo is supposed to be available.
Definition TClass.h:269
void SetConvStreamerFunc(ClassConvStreamerFunc_t strm)
Set a wrapper/accessor function around this class custom conversion streamer.
Definition TClass.cxx:7060
ROOT::BrowseFunc_t GetBrowse() const
Return the wrapper around Browse.
Definition TClass.cxx:7588
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition TClass.cxx:7189
void GetMissingDictionaries(THashTable &result, bool recurse=false)
Get the classes that have a missing dictionary starting from this one.
Definition TClass.cxx:4145
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition TClass.cxx:4341
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:4830
static SchemaHelperMap_t & GetReadRulesRegistry(ROOT::TSchemaRule::RuleType_t type)
Return the registry for the unassigned read rules.
Definition TClass.cxx:1920
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
Definition TClass.cxx:4432
TVirtualIsAProxy * GetIsAProxy() const
Return the proxy implementing the IsA functionality.
Definition TClass.cxx:2976
Version_t GetClassVersion() const
Definition TClass.h:434
ROOT::MergeFunc_t GetMerge() const
Return the wrapper around Merge.
Definition TClass.cxx:7596
ROOT::ResetAfterMergeFunc_t fResetAfterMerge
Definition TClass.h:240
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TClass.h:533
UInt_t fInstanceCount
Definition TClass.h:221
std::atomic< Bool_t > fHasRootPcmInfo
!Whether info was loaded from a root pcm.
Definition TClass.h:268
TClass * GetActualClass(const void *object) const
Return a pointer to the real class of the object.
Definition TClass.cxx:2614
ROOT::DesFunc_t fDestructor
Definition TClass.h:245
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
Definition TClass.cxx:3525
ObjectPtr NewObject(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Definition TClass.cxx:5062
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
Definition TClass.cxx:3565
void SetDeleteArray(ROOT::DelArrFunc_t deleteArrayFunc)
Install a new wrapper around 'delete []'.
Definition TClass.cxx:7132
Bool_t fHasCustomStreamerMember
The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based...
Definition TClass.h:262
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition TClass.cxx:3665
void ResetClassInfo()
Make sure that the current ClassInfo is up to date.
Definition TClass.cxx:4238
ROOT::NewArrFunc_t fNewArray
Definition TClass.h:242
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:6866
void SetImplFileName(const char *implFileName)
Definition TClass.h:578
void GetMissingDictionariesWithRecursionCheck(TCollection &result, TCollection &visited, bool recurse)
From the second level of recursion onwards it is different state check.
Definition TClass.cxx:4048
ROOT::BrowseFunc_t fBrowse
Definition TClass.h:237
bool IsClassStructOrUnion() const
Definition TClass.h:364
EStatusBits
Definition TClass.h:95
@ kHasLocalHashMember
Definition TClass.h:99
@ kHasNameMapNode
Definition TClass.h:108
@ kIgnoreTObjectStreamer
Definition TClass.h:100
@ kUnloaded
Definition TClass.h:101
@ kWarned
Definition TClass.h:107
@ kStartWithTObject
Definition TClass.h:106
@ kIsTObject
Definition TClass.h:103
@ kIsForeign
Definition TClass.h:104
@ kReservedLoading
Definition TClass.h:96
std::atomic< TListOfDataMembers * > fUsingData
Definition TClass.h:206
TListOfFunctions * GetMethodList()
Return (create an empty one if needed) the list of functions.
Definition TClass.cxx:4413
TVirtualRefProxy * GetReferenceProxy() const
Definition TClass.h:499
void ResetMenuList()
Resets the menu list to it's standard value.
Definition TClass.cxx:4301
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:2994
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:6887
static TClass * LoadClassCustom(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition TClass.cxx:5903
UInt_t GetHeapInstanceCount() const
Definition TClass.h:482
Short_t fImplFileLine
Definition TClass.h:220
This class defines an interface to the cling C++ interpreter.
Definition TCling.h:102
Collection abstract base class.
Definition TCollection.h:65
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...
EMemberSelection
Kinds of members to include in lists.
const void * DeclId_t
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...
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:38
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:31
Mother of all ROOT objects.
Definition TObject.h:42
virtual void Dump() const
Dump contents of object on stdout.
Definition TObject.cxx:364
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
Persistent version of a TClass.
Definition TProtoClass.h:38
The TRealData class manages the effective list of all data members for a given class.
Definition TRealData.h:30
Describes a persistent version of a class.
Basic string class.
Definition TString.h:138
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...
Defines a common interface to inspect/change the contents of an object that represents a collection.
This class implements a mutex interface.
Abstract Interface class describing Streamer information for one class.
TLine * line
TClass * GetClassHelper(Bool_t, Bool_t, std::true_type)
Definition TClass.h:643
void(* DirAutoAdd_t)(void *, TDirectory *)
Definition Rtypes.h:120
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
Definition Rtypes.h:122
void(* DesFunc_t)(void *)
Definition Rtypes.h:119
TClass * GetClass(T *)
Definition TClass.h:682
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:5974
void(* DelFunc_t)(void *)
Definition Rtypes.h:117
ESTLType
Definition ESTLType.h:28
void(* BrowseFunc_t)(const void *, TBrowser *)
Definition Rtypes.h:123
void *(* NewArrFunc_t)(Long_t size, void *arena)
Definition Rtypes.h:116
EFunctionMatchMode
@ kConversionMatch
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
void(* DelArrFunc_t)(void *)
Definition Rtypes.h:118
void *(* NewFunc_t)(void *)
Definition Rtypes.h:115
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Definition Rtypes.h:121
static const char * what
Definition stlLoader.cc:5
static TClass * GetClass(Bool_t load, Bool_t silent)
Definition TClass.h:650
TVirtualStreamerInfo * GetAllocator() const
Definition TClass.h:152
void * GetPtr() const
Definition TClass.h:150
TVirtualStreamerInfo * fAllocator
Definition TClass.h:146
ObjectPtr(void *ptr=nullptr, TVirtualStreamerInfo *allocator=nullptr)
Definition TClass.h:148
th1 Draw()
TLine l
Definition textangle.C:4