35 if (!
name || status != 0)
60 R__instance.SetNew(New);
61 R__instance.SetNewArray(NewArray);
62 R__instance.SetDelete(Delete);
63 R__instance.SetDeleteArray(DeleteArray);
64 R__instance.SetDestructor(Destruct);
65 R__instance.SetImplFile(
"", -1);
69 std::string& nameMember) {
71 if (nameMember.empty()) {
85 TGenericClassInfo::TGenericClassInfo(
const char *fullClassname,
86 const char *declFileName,
Int_t declFileLine,
90 : fAction(action),
fClass(nullptr), fClassName(fullClassname),
91 fDeclFileName(declFileName), fDeclFileLine(declFileLine),
92 fDictionary(dictionary), fInfo(info),
93 fImplFileName(nullptr), fImplFileLine(0),
96 fMerge(nullptr),fResetAfterMerge(nullptr),fNew(nullptr),fNewArray(nullptr),fDelete(nullptr),fDeleteArray(nullptr),fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamer(nullptr),
97 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fCollectionProxy(nullptr), fSizeof(sizof), fPragmaBits(pragmabits),
98 fCollectionProxyInfo(nullptr), fCollectionStreamerInfo(nullptr)
105 TGenericClassInfo::TGenericClassInfo(
const char *fullClassname,
Int_t version,
106 const char *declFileName,
Int_t declFileLine,
107 const std::type_info &info,
const Internal::TInitBehavior *action,
110 : fAction(action),
fClass(nullptr), fClassName(fullClassname),
111 fDeclFileName(declFileName), fDeclFileLine(declFileLine),
112 fDictionary(dictionary), fInfo(info),
113 fImplFileName(nullptr), fImplFileLine(0),
116 fMerge(nullptr),fResetAfterMerge(nullptr),fNew(nullptr),fNewArray(nullptr),fDelete(nullptr),fDeleteArray(nullptr),fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamer(nullptr),
117 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fCollectionProxy(nullptr), fSizeof(sizof), fPragmaBits(pragmabits),
118 fCollectionProxyInfo(nullptr), fCollectionStreamerInfo(nullptr)
126 class TForNamespace {};
128 TGenericClassInfo::TGenericClassInfo(
const char *fullClassname,
Int_t version,
129 const char *declFileName,
Int_t declFileLine,
130 const Internal::TInitBehavior *action,
132 : fAction(action),
fClass(nullptr), fClassName(fullClassname),
133 fDeclFileName(declFileName), fDeclFileLine(declFileLine),
134 fDictionary(dictionary), fInfo(typeid(TForNamespace)),
135 fImplFileName(nullptr), fImplFileLine(0),
138 fMerge(nullptr),fResetAfterMerge(nullptr),fNew(nullptr),fNewArray(nullptr),fDelete(nullptr),fDeleteArray(nullptr),fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamer(nullptr),
139 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fCollectionProxy(nullptr), fSizeof(0), fPragmaBits(pragmabits),
140 fCollectionProxyInfo(nullptr), fCollectionStreamerInfo(nullptr)
196 void TGenericClassInfo::Init(
Int_t pragmabits)
202 if (!fAction)
return;
203 GetAction().Register(fClassName,
210 TGenericClassInfo::~TGenericClassInfo()
214 delete fCollectionProxyInfo;
215 delete fCollectionStreamerInfo;
221 if (fAction) GetAction().Unregister(GetClassName());
224 const Internal::TInitBehavior &TGenericClassInfo::GetAction()
const
231 TClass *TGenericClassInfo::GetClass()
242 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
250 fClass = GetAction().CreateClass(GetClassName(),
262 fClass->SetNewArray(fNewArray);
263 fClass->SetDelete(fDelete);
264 fClass->SetDeleteArray(fDeleteArray);
265 fClass->SetDestructor(fDestructor);
266 fClass->SetDirectoryAutoAdd(fDirAutoAdd);
267 fClass->SetStreamerFunc(fStreamerFunc);
268 fClass->SetConvStreamerFunc(fConvStreamerFunc);
270 fClass->SetResetAfterMerge(fResetAfterMerge);
271 fClass->AdoptStreamer(fStreamer); fStreamer =
nullptr;
274 if (!
fClass->IsZombie()) {
275 if (fCollectionProxy)
fClass->CopyCollectionProxy(*fCollectionProxy);
276 else if (fCollectionProxyInfo) {
277 fClass->SetCollectionProxy(*fCollectionProxyInfo);
280 fClass->SetClassSize(fSizeof);
286 CreateRuleSet( fReadRules,
true );
287 CreateRuleSet( fReadRawRules,
false );
295 void TGenericClassInfo::CreateRuleSet( std::vector<Internal::TSchemaHelper>& vect,
298 if ( vect.empty() ) {
306 TSchemaRuleSet* rset =
fClass->GetSchemaRules(
kTRUE );
314 std::vector<Internal::TSchemaHelper>::iterator it;
315 for( it = vect.begin(); it != vect.end(); ++it ) {
316 rule =
new TSchemaRule();
317 rule->SetTarget( it->fTarget );
318 rule->SetTargetClass(
fClass->GetName() );
319 rule->SetSourceClass( it->fSourceClass );
320 rule->SetSource( it->fSource );
321 rule->SetCode( it->fCode );
322 rule->SetVersion( it->fVersion );
323 rule->SetChecksum( it->fChecksum );
324 rule->SetEmbed( it->fEmbed );
325 rule->SetInclude( it->fInclude );
326 rule->SetAttributes( it->fAttributes );
328 if( ProcessReadRules ) {
337 ::Warning(
"TGenericClassInfo",
"The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
338 GetClassName(), it->fVersion.c_str(), it->fTarget.c_str(), errmsg.
Data() );
344 const char *TGenericClassInfo::GetClassName()
const
352 Detail::TCollectionProxyInfo *TGenericClassInfo::GetCollectionProxyInfo()
const
356 return fCollectionProxyInfo;
359 Detail::TCollectionProxyInfo *TGenericClassInfo::GetCollectionStreamerInfo()
const
363 return fCollectionProxyInfo;
366 const std::type_info &TGenericClassInfo::GetInfo()
const
373 const std::vector<Internal::TSchemaHelper>& TGenericClassInfo::GetReadRawRules()
const
377 return fReadRawRules;
381 const std::vector<Internal::TSchemaHelper>& TGenericClassInfo::GetReadRules()
const
387 void TGenericClassInfo::SetFromTemplate()
399 fImplFileName =
file;
400 fImplFileLine =
line;
409 fDeclFileName =
file;
410 fDeclFileLine =
line;
424 void TGenericClassInfo::AdoptCollectionProxyInfo(TCollectionProxyInfo *info)
429 delete fCollectionProxyInfo;;
430 fCollectionProxyInfo = info;
433 void TGenericClassInfo::AdoptCollectionStreamerInfo(TCollectionProxyInfo *info)
438 delete fCollectionStreamerInfo;
439 fCollectionStreamerInfo = info;
447 delete fStreamer; fStreamer =
nullptr;
449 fClass->AdoptStreamer(streamer);
451 fStreamer = streamer;
461 delete fCollectionProxy; fCollectionProxy =
nullptr;
462 fCollectionProxy = collProxy;
463 if (
fClass && fCollectionProxy && !
fClass->IsZombie()) {
464 fClass->CopyCollectionProxy(*fCollectionProxy);
469 void TGenericClassInfo::SetReadRawRules(
const std::vector<Internal::TSchemaHelper>& rules )
472 fReadRawRules = rules;
476 void TGenericClassInfo::SetReadRules(
const std::vector<Internal::TSchemaHelper>& rules )
486 delete fStreamer; fStreamer =
nullptr;
499 fStreamerFunc = streamer;
507 fConvStreamerFunc = streamer;
511 const char *TGenericClassInfo::GetDeclFileName()
const
515 return fDeclFileName;
518 Int_t TGenericClassInfo::GetDeclFileLine()
const
522 return fDeclFileLine;
525 const char *TGenericClassInfo::GetImplFileName()
529 if (!fImplFileName) SetFromTemplate();
530 return fImplFileName;
533 Int_t TGenericClassInfo::GetImplFileLine()
537 if (!fImplFileLine) SetFromTemplate();
538 return fImplFileLine;
541 Int_t TGenericClassInfo::GetVersion()
const
548 TClass *TGenericClassInfo::IsA(
const void *obj)
552 return (*GetIsA())(obj);
562 void TGenericClassInfo::SetNew(
NewFunc_t newFunc)
570 void TGenericClassInfo::SetNewArray(
NewArrFunc_t newArrayFunc)
574 fNewArray = newArrayFunc;
578 void TGenericClassInfo::SetDelete(
DelFunc_t deleteFunc)
582 fDelete = deleteFunc;
586 void TGenericClassInfo::SetDeleteArray(
DelArrFunc_t deleteArrayFunc)
590 fDeleteArray = deleteArrayFunc;
594 void TGenericClassInfo::SetDestructor(
DesFunc_t destructorFunc)
598 fDestructor = destructorFunc;
602 void TGenericClassInfo::SetDirectoryAutoAdd(
DirAutoAdd_t func)
622 fResetAfterMerge = func;
623 if (
fClass)
fClass->SetResetAfterMerge(fResetAfterMerge);
626 NewFunc_t TGenericClassInfo::GetNew()
const
640 DelFunc_t TGenericClassInfo::GetDelete()
const
654 DesFunc_t TGenericClassInfo::GetDestructor()
const
661 DirAutoAdd_t TGenericClassInfo::GetDirectoryAutoAdd()
const
TClass *(* DictFuncPtr_t)()
std::atomic< TClass * > atomic_TClass_ptr
void(* ClassStreamerFunc_t)(TBuffer &, void *)
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
R__EXTERN TVirtualMutex * gInterpreterMutex
R__EXTERN TVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
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)())
void(* ReadFuncPtr_t)(char *, TVirtualObject *)
void(* ReadRawFuncPtr_t)(char *, TBuffer &)
@ kHasCustomStreamerMember
TClass instances represent classes, structs and namespaces in the ROOT type system.
@ kHasCustomStreamerMember
The TNamed class is the base class for all named ROOT classes.
const char * GetTitle() const override
Returns title of object.
virtual UInt_t GetUniqueID() const
Return the unique object id.
TCollection * GetListOfClasses() const
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
const char * Data() const
static constexpr Version_t Class_Version()
R__EXTERN TROOT * gROOTLocal
const TInitBehavior * DefineBehavior(void *, void *)
std::string GetDemangledTypeName(const std::type_info &t)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
void(* DirAutoAdd_t)(void *, TDirectory *)
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
void(* DesFunc_t)(void *)
void(* DelFunc_t)(void *)
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 ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
void(* DelArrFunc_t)(void *)
void *(* NewFunc_t)(void *)
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
void Init(TClassEdit::TInterpreterLookupHelper *helper)
char * DemangleName(const char *mangled_name, int &errorCode)
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.