39#define __attribute__(unused)
83#define BIT(n) (1ULL << (n))
84#define SETBIT(n,i) ((n) |= BIT(i))
85#define CLRBIT(n,i) ((n) &= ~BIT(i))
86#define TESTBIT(n,i) ((Bool_t)(((n) & BIT(i)) != 0))
109 class TGenericClassInfo;
110 typedef void *(*NewFunc_t)(
void *);
111 typedef void *(*NewArrFunc_t)(
Long_t size,
void *arena);
123 const char *dfil,
const char *ifil,
125 extern void AddClass(
const char *cname,
Version_t id,
const std::type_info &info,
142 return CreateInitInstance(t);
156 const std::type_info &info,
161 const char *dfil,
const char *ifil,
168 const std::type_info &info,
179 const char *dfil,
const char *ifil,
199namespace ROOT {
namespace Internal {
206 static void SetName(
const std::string&
name, std::string& nameMember);
216 static void *
New(
void *p) {
return p ?
new(p)
T :
new T; };
218 return p ?
new(p)
T[nElements] :
new T[nElements]; }
219 static void Delete(
void *p) {
delete ((
T*)p); }
223 static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy<T>(0);
224 static ::ROOT::TGenericClassInfo
225 R__instance(T::Class_Name(), T::Class_Version(),
226 T::DeclFileName(), T::DeclFileLine(),
228 &T::Dictionary, isa_proxy, 0,
sizeof(
T) );
239 static std::string
gName;
242 return gName.c_str();
253 template <
typename T>
258 template <
typename T>
270#define _ClassDefBase_(name, id, virtual_keyword, overrd) \
272 static_assert(std::is_integral<decltype(id)>::value, "ClassDef(Inline) macro: the specified class version number is not an integer."); \
273 virtual_keyword Bool_t CheckTObjectHashConsistency() const overrd \
275 static std::atomic<UChar_t> recurseBlocker(0); \
276 if (R__likely(recurseBlocker >= 2)) { \
277 return ::ROOT::Internal::THashConsistencyHolder<decltype(*this)>::fgHashConsistency; \
278 } else if (recurseBlocker == 1) { \
280 } else if (recurseBlocker++ == 0) { \
281 ::ROOT::Internal::THashConsistencyHolder<decltype(*this)>::fgHashConsistency = \
282 ::ROOT::Internal::HasConsistentHashMember(_QUOTE_(name)) || \
283 ::ROOT::Internal::HasConsistentHashMember(*IsA()); \
285 return ::ROOT::Internal::THashConsistencyHolder<decltype(*this)>::fgHashConsistency; \
291 static Version_t Class_Version() { return id; } \
292 virtual_keyword TClass *IsA() const overrd { return name::Class(); } \
293 virtual_keyword void ShowMembers(TMemberInspector &insp) const overrd \
295 ::ROOT::Class_ShowMembers(name::Class(), this, insp); \
297 void StreamerNVirtual(TBuffer &ClassDef_StreamerNVirtual_b) { name::Streamer(ClassDef_StreamerNVirtual_b); } \
298 static const char *DeclFileName() { return __FILE__; }
300#define _ClassDefOutline_(name,id, virtual_keyword, overrd) \
301 _ClassDefBase_(name,id, virtual_keyword, overrd) \
303 static atomic_TClass_ptr fgIsA; \
305 static int ImplFileLine(); \
306 static const char *ImplFileName(); \
307 static const char *Class_Name(); \
308 static TClass *Dictionary(); \
309 static TClass *Class(); \
310 virtual_keyword void Streamer(TBuffer&) overrd;
312#define _ClassDefInline_(name, id, virtual_keyword, overrd) \
313 _ClassDefBase_(name, id, virtual_keyword, overrd) public : static int ImplFileLine() { return -1; } \
314 static const char *ImplFileName() { return 0; } \
315 static const char *Class_Name() \
317 return ::ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector<name>::Name(); \
319 static TClass *Dictionary() \
321 return ::ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector<name>::Dictionary(); \
323 static TClass *Class() { return ::ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector<name>::Class(); } \
324 virtual_keyword void Streamer(TBuffer &R__b) overrd { ::ROOT::Internal::DefaultStreamer(R__b, name::Class(), this); }
326#define ClassDef(name,id) \
327 _ClassDefOutline_(name,id,virtual,) \
328 static int DeclFileLine() { return __LINE__; }
330#define ClassDefOverride(name,id) \
331 _ClassDefOutline_(name,id,,override) \
332 static int DeclFileLine() { return __LINE__; }
334#define ClassDefNV(name,id) \
335 _ClassDefOutline_(name,id,,) \
336 static int DeclFileLine() { return __LINE__; }
338#define ClassDefInline(name,id) \
339 _ClassDefInline_(name,id,virtual,) \
340 static int DeclFileLine() { return __LINE__; }
342#define ClassDefInlineOverride(name,id) \
343 _ClassDefInline_(name,id,,override) \
344 static int DeclFileLine() { return __LINE__; }
346#define ClassDefInlineNV(name,id) \
347 _ClassDefInline_(name,id,,) \
348 static int DeclFileLine() { return __LINE__; }
352#define R__UseDummy(name) \
353 class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
356#define ClassImpUnique(name,key) \
358 TGenericClassInfo *GenerateInitInstance(const name*); \
360 static int _R__UNIQUE_(_NAME2_(R__dummyint,key)) __attribute__((unused)) = \
361 GenerateInitInstance((name*)0x0)->SetImplFile(__FILE__, __LINE__); \
362 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyint,key))); \
365#define ClassImp(name) ClassImpUnique(name,default)
369#define NamespaceImpUnique(name,key) \
372 ::ROOT::TGenericClassInfo *GenerateInitInstance(); \
374 static int _R__UNIQUE_(_NAME2_(R__dummyint,key)) = \
375 GenerateInitInstance()->SetImplFile(__FILE__, __LINE__); \
376 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyint,key))); \
380#define NamespaceImp(name) NamespaceImpUnique(name,default)
392#define ClassDefT(name,id) \
393 _ClassDefOutline_(name,id,virtual,) \
394 static int DeclFileLine() { return __LINE__; }
396#define ClassDefTNV(name,id) \
397 _ClassDefOutline_(name,id,virtual,) \
398 static int DeclFileLine() { return __LINE__; }
401#define ClassDefT2(name,Tmpl)
403#define templateClassImpUnique(name, key) \
406 _R__UNIQUE_(_NAME2_(R__dummyholder, key)) = ::ROOT::RegisterClassTemplate(_QUOTE_(name), __FILE__, __LINE__); \
407 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyholder, key))); \
409#define templateClassImp(name) templateClassImpUnique(name,default)
411#define ClassImpT(name,Tmpl) templateClassImp(name)
418#define ClassDef2T2(name,Tmpl1,Tmpl2)
419#define ClassImp2T(name,Tmpl1,Tmpl2) templateClassImp(name)
427#define ClassDef3T2(name,Tmpl1,Tmpl2,Tmpl3)
428#define ClassImp3T(name,Tmpl1,Tmpl2,Tmpl3) templateClassImp(name)
433#define RootClassVersion(name,VersionNumber) \
435 TGenericClassInfo *GenerateInitInstance(const name*); \
436 static Short_t _R__UNIQUE_(R__dummyVersionNumber) = \
437 GenerateInitInstance((name*)0x0)->SetVersion(VersionNumber); \
438 R__UseDummy(_R__UNIQUE_(R__dummyVersionNumber)); \
441#define RootStreamer(name,STREAMER) \
443 TGenericClassInfo *GenerateInitInstance(const name*); \
444 static Short_t _R__UNIQUE_(R__dummyStreamer) = \
445 GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER); \
446 R__UseDummy(_R__UNIQUE_(R__dummyStreamer)); \
456# define _R_PragmaStr(x) _Pragma(#x)
457# define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(cling load ( #LIBRARY ))
458# define R__ADD_INCLUDE_PATH(PATH) _R_PragmaStr(cling add_include_path ( #PATH ))
459# define R__ADD_LIBRARY_PATH(PATH) _R_PragmaStr(cling add_library_path ( #PATH ))
460#elif defined(R__WIN32)
461# define _R_PragmaStr(x) __pragma(#x)
462# define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(comment(lib, #LIBRARY))
463# define R__ADD_INCLUDE_PATH(PATH) _R_PragmaStr(comment(path, #PATH))
464# define R__ADD_LIBRARY_PATH(PATH) _R_PragmaStr(comment(path, #PATH))
473# define R__LOAD_LIBRARY(LIBRARY)
474# define R__ADD_INCLUDE_PATH(PATH)
475# define R__ADD_LIBRARY_PATH(PATH)
480# define R__CLING_PTRCHECK(ONOFF) __attribute__((annotate("__cling__ptrcheck(" #ONOFF ")")))
482# define R__CLING_PTRCHECK(ONOFF)
486inline char *
R__STRTOK_R(
char *str,
const char *delim,
char **saveptr)
489 return strtok_s(str, delim, saveptr);
491 return strtok_r(str, delim, saveptr);
TClass *(* DictFuncPtr_t)()
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
char * R__STRTOK_R(char *str, const char *delim, char **saveptr)
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
TBuffer & operator>>(TBuffer &buf, Tmpl *&obj)
std::atomic< TClass * > atomic_TClass_ptr
void(* ClassStreamerFunc_t)(TBuffer &, void *)
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
typedef void((*Func_t)())
static void * New(void *p)
static void * NewArray(Long_t nElements, void *p)
static atomic_TClass_ptr fgIsA
static void DeleteArray(void *p)
static void Destruct(void *p)
::ROOT::TGenericClassInfo * fgGenericInfo
::ROOT::TGenericClassInfo * GenerateInitInstanceLocal()
static void Delete(void *p)
static TClass * Dictionary()
static const char * Name()
static void SetInstance(::ROOT::TGenericClassInfo &R__instance, NewFunc_t, NewArrFunc_t, DelFunc_t, DelArrFunc_t, DesFunc_t)
static void SetName(const std::string &name, std::string &nameMember)
static void SetfgIsA(atomic_TClass_ptr &isA, TClass *(*dictfun)())
virtual 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) const
virtual void Register(const char *cname, Version_t id, const std::type_info &info, DictFuncPtr_t dict, Int_t pragmabits) const
virtual void Unregister(const char *classname) const
virtual 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) const =0
virtual void Register(const char *cname, Version_t id, const std::type_info &info, DictFuncPtr_t dict, Int_t pragmabits) const =0
virtual void Unregister(const char *classname) const =0
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Collection abstract base class.
Describe directory structure in memory.
Abstract base class for accessing the data-members of a class.
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.
R__EXTERN PyObject * gName
void DefaultStreamer(TBuffer &R__b, const TClass *cl, void *objpointer)
Default streamer implementation used by ClassDefInline to avoid requirement to include TBuffer....
const TInitBehavior * DefineBehavior(void *, void *)
std::string GetDemangledTypeName(const std::type_info &)
Returns a string with the demangled and normalized name for the given type.
Bool_t HasConsistentHashMember(TClass &clRef)
Return true is the Hash/RecursiveRemove setup is consistent, i.e.
void(* DirAutoAdd_t)(void *, TDirectory *)
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
void(* DesFunc_t)(void *)
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).
void(* DelFunc_t)(void *)
void AddClassAlternate(const char *normName, const char *alternate)
Global function called by GenerateInitInstance.
void RemoveClass(const char *cname)
Global function called by the dtor of a class's init class (see the ClassImp macro).
void AddClass(const char *cname, Version_t id, const std::type_info &info, DictFuncPtr_t dict, Int_t pragmabits)
Global function called by the ctor of a class's init class (see the ClassImp macro).
TNamed * RegisterClassTemplate(const char *name, const char *file, Int_t line)
Global function to register the implementation file and line of a class template (i....
void *(* NewArrFunc_t)(Long_t size, void *arena)
void Class_ShowMembers(TClass *cl, const void *obj, TMemberInspector &)
Indirect call to the implementation of ShowMember allowing [forward] declaration with out a full defi...
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
Short_t SetClassVersion(RootClass *)
void(* DelArrFunc_t)(void *)
void *(* NewFunc_t)(void *)
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
static Bool_t fgHashConsistency