36 if (!
name || status != 0)
61 R__instance.SetNew(New);
62 R__instance.SetNewArray(NewArray);
63 R__instance.SetDelete(Delete);
64 R__instance.SetDeleteArray(DeleteArray);
65 R__instance.SetDestructor(Destruct);
66 R__instance.SetImplFile(
"", -1);
70 std::string& nameMember) {
72 if (nameMember.empty()) {
86 TGenericClassInfo::TGenericClassInfo(
const char *fullClassname,
87 const char *declFileName,
Int_t declFileLine,
91 : fAction(action),
fClass(nullptr), fClassName(fullClassname),
92 fDeclFileName(declFileName), fDeclFileLine(declFileLine),
93 fDictionary(dictionary), fInfo(info),
94 fImplFileName(nullptr), fImplFileLine(0),
97 fMerge(nullptr),fResetAfterMerge(nullptr),fNew(nullptr),fNewArray(nullptr),fDelete(nullptr),fDeleteArray(nullptr),fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamer(nullptr),
98 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fCollectionProxy(nullptr), fSizeof(sizof), fPragmaBits(pragmabits),
99 fCollectionProxyInfo(nullptr), fCollectionStreamerInfo(nullptr)
106 TGenericClassInfo::TGenericClassInfo(
const char *fullClassname,
Int_t version,
107 const char *declFileName,
Int_t declFileLine,
108 const std::type_info &info,
const Internal::TInitBehavior *action,
111 : fAction(action),
fClass(nullptr), fClassName(fullClassname),
112 fDeclFileName(declFileName), fDeclFileLine(declFileLine),
113 fDictionary(dictionary), fInfo(info),
114 fImplFileName(nullptr), fImplFileLine(0),
117 fMerge(nullptr),fResetAfterMerge(nullptr),fNew(nullptr),fNewArray(nullptr),fDelete(nullptr),fDeleteArray(nullptr),fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamer(nullptr),
118 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fCollectionProxy(nullptr), fSizeof(sizof), fPragmaBits(pragmabits),
119 fCollectionProxyInfo(nullptr), fCollectionStreamerInfo(nullptr)
127 class TForNamespace {};
129 TGenericClassInfo::TGenericClassInfo(
const char *fullClassname,
Int_t version,
130 const char *declFileName,
Int_t declFileLine,
131 const Internal::TInitBehavior *action,
133 : fAction(action),
fClass(nullptr), fClassName(fullClassname),
134 fDeclFileName(declFileName), fDeclFileLine(declFileLine),
135 fDictionary(dictionary), fInfo(typeid(TForNamespace)),
136 fImplFileName(nullptr), fImplFileLine(0),
139 fMerge(nullptr),fResetAfterMerge(nullptr),fNew(nullptr),fNewArray(nullptr),fDelete(nullptr),fDeleteArray(nullptr),fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamer(nullptr),
140 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fCollectionProxy(nullptr), fSizeof(0), fPragmaBits(pragmabits),
141 fCollectionProxyInfo(nullptr), fCollectionStreamerInfo(nullptr)
197 void TGenericClassInfo::Init(
Int_t pragmabits)
203 if (!fAction)
return;
204 GetAction().Register(fClassName,
211 TGenericClassInfo::~TGenericClassInfo()
215 delete fCollectionProxyInfo;
216 delete fCollectionStreamerInfo;
224 for(
auto alt : fAlternate)
227 GetAction().Unregister(GetClassName(),
fClass);
230 const Internal::TInitBehavior &TGenericClassInfo::GetAction()
const
237 TClass *TGenericClassInfo::GetClass()
248 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
256 fClass = GetAction().CreateClass(GetClassName(),
265 fClass->fHasCustomStreamerMember =
true;
268 fClass->SetNewArray(fNewArray);
269 fClass->SetDelete(fDelete);
270 fClass->SetDeleteArray(fDeleteArray);
271 fClass->SetDestructor(fDestructor);
272 fClass->SetDirectoryAutoAdd(fDirAutoAdd);
273 fClass->SetStreamerFunc(fStreamerFunc);
274 fClass->SetConvStreamerFunc(fConvStreamerFunc);
276 fClass->SetResetAfterMerge(fResetAfterMerge);
277 fClass->AdoptStreamer(fStreamer); fStreamer =
nullptr;
280 if (!
fClass->IsZombie()) {
281 if (fCollectionProxy)
fClass->CopyCollectionProxy(*fCollectionProxy);
282 else if (fCollectionProxyInfo) {
283 fClass->SetCollectionProxy(*fCollectionProxyInfo);
286 fClass->SetClassSize(fSizeof);
292 CreateRuleSet( fReadRules,
true );
293 CreateRuleSet( fReadRawRules,
false );
296 fClass->CreateAttributeMap();
301 fClass->GetAttributeMap()->AddProperty(
"rntuple.streamerMode",
"false");
303 fClass->GetAttributeMap()->AddProperty(
"rntuple.streamerMode",
"true");
313 void TGenericClassInfo::CreateRuleSet( std::vector<Internal::TSchemaHelper>& vect,
316 if ( vect.empty() ) {
324 TSchemaRuleSet* rset =
fClass->GetSchemaRules(
kTRUE );
332 std::vector<Internal::TSchemaHelper>::iterator it;
333 for( it = vect.begin(); it != vect.end(); ++it ) {
334 rule =
new TSchemaRule();
335 rule->SetTarget( it->fTarget );
336 rule->SetTargetClass(
fClass->GetName() );
337 rule->SetSourceClass( it->fSourceClass );
338 rule->SetSource( it->fSource );
339 rule->SetCode( it->fCode );
340 rule->SetVersion( it->fVersion );
341 rule->SetChecksum( it->fChecksum );
342 rule->SetEmbed( it->fEmbed );
343 rule->SetInclude( it->fInclude );
344 rule->SetAttributes( it->fAttributes );
346 if( ProcessReadRules ) {
355 ::Warning(
"TGenericClassInfo",
"The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
356 GetClassName(), it->fVersion.c_str(), it->fTarget.c_str(), errmsg.
Data() );
362 const char *TGenericClassInfo::GetClassName()
const
370 Detail::TCollectionProxyInfo *TGenericClassInfo::GetCollectionProxyInfo()
const
374 return fCollectionProxyInfo;
377 Detail::TCollectionProxyInfo *TGenericClassInfo::GetCollectionStreamerInfo()
const
381 return fCollectionProxyInfo;
384 const std::type_info &TGenericClassInfo::GetInfo()
const
391 const std::vector<Internal::TSchemaHelper>& TGenericClassInfo::GetReadRawRules()
const
395 return fReadRawRules;
399 const std::vector<Internal::TSchemaHelper>& TGenericClassInfo::GetReadRules()
const
405 void TGenericClassInfo::SetFromTemplate()
413 Int_t TGenericClassInfo::SetImplFile(
const char *file,
Int_t line)
417 fImplFileName = file;
418 fImplFileLine =
line;
423 Int_t TGenericClassInfo::SetDeclFile(
const char *file,
Int_t line)
427 fDeclFileName = file;
428 fDeclFileLine =
line;
444 fAlternate.push_back(alt);
447 void TGenericClassInfo::AdoptCollectionProxyInfo(TCollectionProxyInfo *info)
452 delete fCollectionProxyInfo;
453 fCollectionProxyInfo = info;
456 void TGenericClassInfo::AdoptCollectionStreamerInfo(TCollectionProxyInfo *info)
461 delete fCollectionStreamerInfo;
462 fCollectionStreamerInfo = info;
470 delete fStreamer; fStreamer =
nullptr;
472 fClass->AdoptStreamer(streamer);
474 fStreamer = streamer;
484 delete fCollectionProxy; fCollectionProxy =
nullptr;
485 fCollectionProxy = collProxy;
486 if (
fClass && fCollectionProxy && !
fClass->IsZombie()) {
487 fClass->CopyCollectionProxy(*fCollectionProxy);
492 void TGenericClassInfo::SetReadRawRules(
const std::vector<Internal::TSchemaHelper>& rules )
495 fReadRawRules = rules;
499 void TGenericClassInfo::SetReadRules(
const std::vector<Internal::TSchemaHelper>& rules )
509 delete fStreamer; fStreamer =
nullptr;
522 fStreamerFunc = streamer;
530 fConvStreamerFunc = streamer;
534 const char *TGenericClassInfo::GetDeclFileName()
const
538 return fDeclFileName;
541 Int_t TGenericClassInfo::GetDeclFileLine()
const
545 return fDeclFileLine;
548 const char *TGenericClassInfo::GetImplFileName()
552 if (!fImplFileName) SetFromTemplate();
553 return fImplFileName;
556 Int_t TGenericClassInfo::GetImplFileLine()
560 if (!fImplFileLine) SetFromTemplate();
561 return fImplFileLine;
564 Int_t TGenericClassInfo::GetVersion()
const
571 TClass *TGenericClassInfo::IsA(
const void *obj)
575 return (*GetIsA())(obj);
585 void TGenericClassInfo::SetNew(
NewFunc_t newFunc)
593 void TGenericClassInfo::SetNewArray(
NewArrFunc_t newArrayFunc)
597 fNewArray = newArrayFunc;
601 void TGenericClassInfo::SetDelete(
DelFunc_t deleteFunc)
605 fDelete = deleteFunc;
609 void TGenericClassInfo::SetDeleteArray(
DelArrFunc_t deleteArrayFunc)
613 fDeleteArray = deleteArrayFunc;
617 void TGenericClassInfo::SetDestructor(
DesFunc_t destructorFunc)
621 fDestructor = destructorFunc;
625 void TGenericClassInfo::SetDirectoryAutoAdd(
DirAutoAdd_t func)
645 fResetAfterMerge = func;
646 if (
fClass)
fClass->SetResetAfterMerge(fResetAfterMerge);
649 NewFunc_t TGenericClassInfo::GetNew()
const
663 DelFunc_t TGenericClassInfo::GetDelete()
const
677 DesFunc_t TGenericClassInfo::GetDestructor()
const
684 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.
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
Defines a common interface to inspect/change the contents of an object that represents a collection.
static constexpr Version_t Class_Version()
R__EXTERN TROOT * gROOTLocal
const TInitBehavior * DefineBehavior(void *, void *)
std::string GetDemangledTypeName(const std::type_info &t)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
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 RemoveClassAlternate(ROOT::TClassAlt *)
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.