75 #define BIT(n) (1ULL << (n)) 76 #define SETBIT(n,i) ((n) |= BIT(i)) 77 #define CLRBIT(n,i) ((n) &= ~BIT(i)) 78 #define TESTBIT(n,i) ((Bool_t)(((n) & BIT(i)) != 0)) 90 typedef TClass *(*IsAGlobalFunc_t)(
const TClass*,
const void *obj);
101 class TGenericClassInfo;
102 typedef void *(*NewFunc_t)(
void *);
103 typedef void *(*NewArrFunc_t)(
Long_t size,
void *arena);
115 const char *dfil,
const char *ifil,
117 extern void AddClass(
const char *cname,
Version_t id,
const std::type_info &info,
134 return CreateInitInstance(t);
148 const std::type_info &info,
150 virtual void Unregister(
const char *classname)
const = 0;
153 const char *dfil,
const char *ifil,
160 const std::type_info &info,
171 const char *dfil,
const char *ifil,
191 namespace ROOT {
namespace Internal {
194 static std::string GetImpl(
const char* derived_funcname);
201 static std::string
Get() {
202 #ifdef _MSC_VER // Visual Studio 203 # define R__TNE_PRETTY_FUNCTION __FUNCTION__ 205 # define R__TNE_PRETTY_FUNCTION __PRETTY_FUNCTION__ 208 #undef R__TNE_PRETTY_FUNCTION 218 static void SetName(
const std::string&
name, std::string& nameMember);
222 template <
typename T>
228 static void *
New(
void *p) {
return p ?
new(p)
T :
new T; };
230 return p ?
new(p)
T[nElements] :
new T[nElements]; }
231 static void Delete(
void *p) {
delete ((
T*)p); }
235 static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy<T>(0);
236 static ::ROOT::TGenericClassInfo
237 R__instance(T::Class_Name(), T::Class_Version(),
238 T::DeclFileName(), T::DeclFileLine(),
240 &T::Dictionary, isa_proxy, 0,
sizeof(
T) );
241 SetInstance(R__instance, &New, &NewArray, &Delete, &DeleteArray, &
Destruct);
245 static TClass *
Class() { SetfgIsA(fgIsA, &Dictionary);
return fgIsA; }
249 return fgName.c_str();
264 #define _ClassDefBase_(name,id, virtual_keyword, overrd) \ 266 static Version_t Class_Version() { return id; } \ 267 virtual_keyword TClass *IsA() const overrd { return name::Class(); } \ 268 virtual_keyword void ShowMembers(TMemberInspector&insp) const overrd { ::ROOT::Class_ShowMembers(name::Class(), this, insp); } \ 269 void StreamerNVirtual(TBuffer&ClassDef_StreamerNVirtual_b) { name::Streamer(ClassDef_StreamerNVirtual_b); } \ 270 static const char *DeclFileName() { return __FILE__; } 273 #define _ClassDefOutline_(name,id, virtual_keyword, overrd) \ 274 _ClassDefBase_(name,id, virtual_keyword, overrd) \ 276 static atomic_TClass_ptr fgIsA; \ 278 static int ImplFileLine(); \ 279 static const char *ImplFileName(); \ 280 static const char *Class_Name(); \ 281 static TClass *Dictionary(); \ 282 static TClass *Class(); \ 283 virtual_keyword void Streamer(TBuffer&) overrd; 285 #define _ClassDefInline_(name,id, virtual_keyword, overrd) \ 286 _ClassDefBase_(name,id, virtual_keyword, overrd) \ 288 static int ImplFileLine() { return -1; } \ 289 static const char *ImplFileName() { return 0; } \ 290 static const char *Class_Name() { return ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector< name >::Name(); } \ 291 static TClass *Dictionary() { return ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector< name >::Dictionary(); } \ 292 static TClass *Class() { return ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector< name >::Class(); } \ 293 virtual_keyword void Streamer(TBuffer& R__b) overrd { \ 294 if (R__b.IsReading()) R__b.ReadClassBuffer(name::Class(),this); \ 295 else R__b.WriteClassBuffer(name::Class(),this);} 297 #define ClassDef(name,id) \ 298 _ClassDefOutline_(name,id,virtual,) \ 299 static int DeclFileLine() { return __LINE__; } 301 #define ClassDefOverride(name,id) \ 302 _ClassDefOutline_(name,id,,override) \ 303 static int DeclFileLine() { return __LINE__; } 305 #define ClassDefNV(name,id) \ 306 _ClassDefOutline_(name,id,,) \ 307 static int DeclFileLine() { return __LINE__; } 309 #define ClassDefInline(name,id) \ 310 _ClassDefInline_(name,id,virtual,) \ 311 static int DeclFileLine() { return __LINE__; } 313 #define ClassDefInlineOverride(name,id) \ 314 _ClassDefInline_(name,id,,override) \ 315 static int DeclFileLine() { return __LINE__; } 317 #define ClassDefInlineNV(name,id) \ 318 _ClassDefInline_(name,id,,) \ 319 static int DeclFileLine() { return __LINE__; } 323 #define R__UseDummy(name) \ 324 class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } } 327 #define ClassImpUnique(name,key) \ 329 TGenericClassInfo *GenerateInitInstance(const name*); \ 331 static int _R__UNIQUE_(_NAME2_(R__dummyint,key)) __attribute__ ((unused)) = \ 332 GenerateInitInstance((name*)0x0)->SetImplFile(__FILE__, __LINE__); \ 333 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyint,key))); \ 336 #define ClassImp(name) ClassImpUnique(name,default) 340 #define NamespaceImpUnique(name,key) \ 343 ::ROOT::TGenericClassInfo *GenerateInitInstance(); \ 345 static int _R__UNIQUE_(_NAME2_(R__dummyint,key)) = \ 346 GenerateInitInstance()->SetImplFile(__FILE__, __LINE__); \ 347 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyint,key))); \ 351 #define NamespaceImp(name) NamespaceImpUnique(name,default) 363 #define ClassDefT(name,id) \ 364 _ClassDefOutline_(name,id,virtual,) \ 365 static int DeclFileLine() { return __LINE__; } 367 #define ClassDefTNV(name,id) \ 368 _ClassDefOutline_(name,id,virtual,) \ 369 static int DeclFileLine() { return __LINE__; } 372 #define ClassDefT2(name,Tmpl) 376 #define templateClassImpUnique(name,key) \ 378 static TNamed *_R__UNIQUE_(_NAME2_(R__dummyholder,key)) = \ 379 ROOT::RegisterClassTemplate(_QUOTE_(name), __FILE__, __LINE__); \ 380 R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyholder,key))); \ 382 #define templateClassImp(name) templateClassImpUnique(name,default) 384 #define ClassImpT(name,Tmpl) templateClassImp(name) 391 #define ClassDef2T2(name,Tmpl1,Tmpl2) 392 #define ClassImp2T(name,Tmpl1,Tmpl2) templateClassImp(name) 400 #define ClassDef3T2(name,Tmpl1,Tmpl2,Tmpl3) 401 #define ClassImp3T(name,Tmpl1,Tmpl2,Tmpl3) templateClassImp(name) 406 #define RootClassVersion(name,VersionNumber) \ 408 TGenericClassInfo *GenerateInitInstance(const name*); \ 409 static Short_t _R__UNIQUE_(R__dummyVersionNumber) = \ 410 GenerateInitInstance((name*)0x0)->SetVersion(VersionNumber); \ 411 R__UseDummy(_R__UNIQUE_(R__dummyVersionNumber)); \ 414 #define RootStreamer(name,STREAMER) \ 416 TGenericClassInfo *GenerateInitInstance(const name*); \ 417 static Short_t _R__UNIQUE_(R__dummyStreamer) = \ 418 GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER); \ 419 R__UseDummy(_R__UNIQUE_(R__dummyStreamer)); \ 428 #define _R_PragmaStr(x) _Pragma(#x) 430 # define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(cling load ( #LIBRARY )) 431 # define R__ADD_INCLUDE_PATH(PATH) _R_PragmaStr(cling add_include_path ( #PATH )) 432 # define R__ADD_LIBRARY_PATH(PATH) _R_PragmaStr(cling add_library_path ( #PATH )) 433 #elif defined(R__WIN32) 434 # define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(comment(lib, #LIBRARY)) 435 # define R__ADD_INCLUDE_PATH(PATH) _R_PragmaStr(comment(path, #PATH)) 436 # define R__ADD_LIBRARY_PATH(PATH) _R_PragmaStr(comment(path, #PATH)) 445 # define R__LOAD_LIBRARY(LIBRARY) 446 # define R__ADD_INCLUDE_PATH(PATH) 447 # 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)
static std::string fgName
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)()
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
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 *)
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)
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
#define R__TNE_PRETTY_FUNCTION
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 *)