35 #define __attribute__(unused) 78 #define BIT(n) (1ULL << (n)) 79 #define SETBIT(n,i) ((n) |= BIT(i)) 80 #define CLRBIT(n,i) ((n) &= ~BIT(i)) 81 #define TESTBIT(n,i) ((Bool_t)(((n) & BIT(i)) != 0)) 93 typedef TClass *(*IsAGlobalFunc_t)(
const TClass*,
const void *obj);
104 class TGenericClassInfo;
105 typedef void *(*NewFunc_t)(
void *);
106 typedef void *(*NewArrFunc_t)(
Long_t size,
void *arena);
118 const char *dfil,
const char *ifil,
120 extern void AddClass(
const char *cname,
Version_t id,
const std::type_info &info,
137 return CreateInitInstance(t);
151 const std::type_info &info,
153 virtual void Unregister(
const char *classname)
const = 0;
156 const char *dfil,
const char *ifil,
163 const std::type_info &info,
174 const char *dfil,
const char *ifil,
194 namespace ROOT {
namespace Internal {
201 static void SetName(
const std::string&
name, std::string& nameMember);
205 template <
typename T>
211 static void *
New(
void *p) {
return p ?
new(p)
T :
new T; };
213 return p ?
new(p)
T[nElements] :
new T[nElements]; }
214 static void Delete(
void *p) {
delete ((
T*)p); }
218 static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy<T>(0);
219 static ::ROOT::TGenericClassInfo
220 R__instance(T::Class_Name(), T::Class_Version(),
221 T::DeclFileName(), T::DeclFileLine(),
223 &T::Dictionary, isa_proxy, 0,
sizeof(
T) );
224 SetInstance(R__instance, &New, &NewArray, &Delete, &DeleteArray, &
Destruct);
232 static TClass *
Class() { SetfgIsA(fgIsA, &Dictionary);
return fgIsA; }
234 static std::string
gName;
237 return gName.c_str();
248 template <
typename T>
253 template <
typename T>
265 #define _ClassDefBase_(name, id, virtual_keyword, overrd) \ 267 virtual_keyword Bool_t CheckTObjectHashConsistency() const overrd \ 269 static std::atomic<UChar_t> recurseBlocker(0); \ 270 if (R__likely(recurseBlocker >= 2)) { \ 271 return ::ROOT::Internal::THashConsistencyHolder<decltype(*this)>::fgHashConsistency; \ 272 } else if (recurseBlocker == 1) { \ 274 } else if (recurseBlocker++ == 0) { \ 275 ::ROOT::Internal::THashConsistencyHolder<decltype(*this)>::fgHashConsistency = \ 276 ::ROOT::Internal::HasConsistentHashMember(_QUOTE_(name)) || \ 277 ::ROOT::Internal::HasConsistentHashMember(*IsA()); \ 279 return ::ROOT::Internal::THashConsistencyHolder<decltype(*this)>::fgHashConsistency; \ 285 static Version_t Class_Version() { return id; } \ 286 virtual_keyword TClass *IsA() const overrd { return name::Class(); } \ 287 virtual_keyword void ShowMembers(TMemberInspector &insp) const overrd \ 289 ::ROOT::Class_ShowMembers(name::Class(), this, insp); \ 291 void StreamerNVirtual(TBuffer &ClassDef_StreamerNVirtual_b) { name::Streamer(ClassDef_StreamerNVirtual_b); } \ 292 static const char *DeclFileName() { return __FILE__; } 294 #define _ClassDefOutline_(name,id, virtual_keyword, overrd) \ 295 _ClassDefBase_(name,id, virtual_keyword, overrd) \ 297 static atomic_TClass_ptr fgIsA; \ 299 static int ImplFileLine(); \ 300 static const char *ImplFileName(); \ 301 static const char *Class_Name(); \ 302 static TClass *Dictionary(); \ 303 static TClass *Class(); \ 304 virtual_keyword void Streamer(TBuffer&) overrd; 306 #define _ClassDefInline_(name, id, virtual_keyword, overrd) \ 307 _ClassDefBase_(name, id, virtual_keyword, overrd) public : static int ImplFileLine() { return -1; } \ 308 static const char *ImplFileName() { return 0; } \ 309 static const char *Class_Name() \ 311 return ::ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector<name>::Name(); \ 313 static TClass *Dictionary() \ 315 return ::ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector<name>::Dictionary(); \ 317 static TClass *Class() { return ::ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector<name>::Class(); } \ 318 virtual_keyword void Streamer(TBuffer &R__b) overrd { ::ROOT::Internal::DefaultStreamer(R__b, name::Class(), this); } 320 #define ClassDef(name,id) \ 321 _ClassDefOutline_(name,id,virtual,) \ 322 static int DeclFileLine() { return __LINE__; } 324 #define ClassDefOverride(name,id) \ 325 _ClassDefOutline_(name,id,,override) \ 326 static int DeclFileLine() { return __LINE__; } 328 #define ClassDefNV(name,id) \ 329 _ClassDefOutline_(name,id,,) \ 330 static int DeclFileLine() { return __LINE__; } 332 #define ClassDefInline(name,id) \ 333 _ClassDefInline_(name,id,virtual,) \ 334 static int DeclFileLine() { return __LINE__; } 336 #define ClassDefInlineOverride(name,id) \ 337 _ClassDefInline_(name,id,,override) \ 338 static int DeclFileLine() { return __LINE__; } 340 #define ClassDefInlineNV(name,id) \ 341 _ClassDefInline_(name,id,,) \ 342 static int DeclFileLine() { return __LINE__; } 346 #define R__UseDummy(name) \ 347 class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } } 350 #define ClassImpUnique(name,key) \ 352 TGenericClassInfo *GenerateInitInstance(const name*); \ 354 static int _R__UNIQUE_(_NAME2_(R__dummyint,key)) __attribute__((unused)) = \ 355 GenerateInitInstance((name*)0x0)->SetImplFile(__FILE__, __LINE__); \ 356 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyint,key))); \ 359 #define ClassImp(name) ClassImpUnique(name,default) 363 #define NamespaceImpUnique(name,key) \ 366 ::ROOT::TGenericClassInfo *GenerateInitInstance(); \ 368 static int _R__UNIQUE_(_NAME2_(R__dummyint,key)) = \ 369 GenerateInitInstance()->SetImplFile(__FILE__, __LINE__); \ 370 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyint,key))); \ 374 #define NamespaceImp(name) NamespaceImpUnique(name,default) 386 #define ClassDefT(name,id) \ 387 _ClassDefOutline_(name,id,virtual,) \ 388 static int DeclFileLine() { return __LINE__; } 390 #define ClassDefTNV(name,id) \ 391 _ClassDefOutline_(name,id,virtual,) \ 392 static int DeclFileLine() { return __LINE__; } 395 #define ClassDefT2(name,Tmpl) 397 #define templateClassImpUnique(name, key) \ 400 _R__UNIQUE_(_NAME2_(R__dummyholder, key)) = ::ROOT::RegisterClassTemplate(_QUOTE_(name), __FILE__, __LINE__); \ 401 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyholder, key))); \ 403 #define templateClassImp(name) templateClassImpUnique(name,default) 405 #define ClassImpT(name,Tmpl) templateClassImp(name) 412 #define ClassDef2T2(name,Tmpl1,Tmpl2) 413 #define ClassImp2T(name,Tmpl1,Tmpl2) templateClassImp(name) 421 #define ClassDef3T2(name,Tmpl1,Tmpl2,Tmpl3) 422 #define ClassImp3T(name,Tmpl1,Tmpl2,Tmpl3) templateClassImp(name) 427 #define RootClassVersion(name,VersionNumber) \ 429 TGenericClassInfo *GenerateInitInstance(const name*); \ 430 static Short_t _R__UNIQUE_(R__dummyVersionNumber) = \ 431 GenerateInitInstance((name*)0x0)->SetVersion(VersionNumber); \ 432 R__UseDummy(_R__UNIQUE_(R__dummyVersionNumber)); \ 435 #define RootStreamer(name,STREAMER) \ 437 TGenericClassInfo *GenerateInitInstance(const name*); \ 438 static Short_t _R__UNIQUE_(R__dummyStreamer) = \ 439 GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER); \ 440 R__UseDummy(_R__UNIQUE_(R__dummyStreamer)); \ 450 # define _R_PragmaStr(x) _Pragma(#x) 451 # define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(cling load ( #LIBRARY )) 452 # define R__ADD_INCLUDE_PATH(PATH) _R_PragmaStr(cling add_include_path ( #PATH )) 453 # define R__ADD_LIBRARY_PATH(PATH) _R_PragmaStr(cling add_library_path ( #PATH )) 454 #elif defined(R__WIN32) 455 # define _R_PragmaStr(x) __pragma(#x) 456 # define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(comment(lib, #LIBRARY)) 457 # define R__ADD_INCLUDE_PATH(PATH) _R_PragmaStr(comment(path, #PATH)) 458 # define R__ADD_LIBRARY_PATH(PATH) _R_PragmaStr(comment(path, #PATH)) 467 # define R__LOAD_LIBRARY(LIBRARY) 468 # define R__ADD_INCLUDE_PATH(PATH) 469 # define R__ADD_LIBRARY_PATH(PATH) 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).
static void * New(void *p)
virtual void Unregister(const char *classname) const
void(* ClassStreamerFunc_t)(TBuffer &, void *)
void(* ShowMembersFunc_t)(const void *obj, TMemberInspector &R__insp, Bool_t isTransient)
Namespace for new ROOT classes and functions.
void(* DelArrFunc_t)(void *)
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Buffer base class used for serializing objects.
static void Delete(void *p)
Abstract base class for accessing the data-members of a class.
const TInitBehavior * DefineBehavior(void *, void *)
TBuffer & operator>>(TBuffer &buf, Tmpl *&obj)
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
The TNamed class is the base class for all named ROOT classes.
void AddClassAlternate(const char *normName, const char *alternate)
Global function called by GenerateInitInstance.
void(* MemberStreamerFunc_t)(TBuffer &, void *, Int_t)
::ROOT::TGenericClassInfo * GenerateInitInstanceLocal()
void *(* NewFunc_t)(void *)
TClass *(* DictFuncPtr_t)()
static Bool_t fgHashConsistency
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
static atomic_TClass_ptr fgIsA
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
void *(* NewArrFunc_t)(Long_t size, void *arena)
void RemoveClass(const char *cname)
Global function called by the dtor of a class's init class (see the ClassImp macro).
static void Destruct(void *p)
static TClass * Dictionary()
Collection abstract base class.
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).
The ROOT global object gROOT contains a list of all defined classes.
std::atomic< TClass * > atomic_TClass_ptr
static void * NewArray(Long_t nElements, void *p)
Short_t SetClassVersion(RootClass *)
virtual void Unregister(const char *classname) const =0
virtual void Register(const char *cname, Version_t id, const std::type_info &info, DictFuncPtr_t dict, Int_t pragmabits) const
R__EXTERN PyObject * gName
Describe directory structure in memory.
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.
Mother of all ROOT objects.
void(* DelFunc_t)(void *)
typedef void((*Func_t)())
void(* DirAutoAdd_t)(void *, TDirectory *)
::ROOT::TGenericClassInfo * fgGenericInfo
static const char * Name()
virtual void Register(const char *cname, Version_t id, const std::type_info &info, DictFuncPtr_t dict, Int_t pragmabits) const =0
void Destruct(TCppType_t type, TCppObject_t instance)
Bool_t HasConsistentHashMember(TClass &clRef)
Return true is the Hash/RecursiveRemove setup is consistent, i.e.
std::string GetDemangledTypeName(const std::type_info &)
Returns a string with the demangled and normalized name for the given type.
static void DeleteArray(void *p)
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.e.
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
void DefaultStreamer(TBuffer &R__b, const TClass *cl, void *objpointer)
Default streamer implementation used by ClassDefInline to avoid requirement to include TBuffer...
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
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(* DesFunc_t)(void *)