29 if (TClass* cl = (TClass*)gROOT->GetListOfClasses()->FindObject(cname.c_str())) {
30 if (cl->IsLoaded() && cl->HasDictionary())
return cl;
44 TClass* cl = TClass::GetClass (cname.c_str());
45 if (cl->HasDictionary())
65 const std::string& name,
66 const std::string& elementTypeName,
67 const std::string& branchTypeName,
79 auxid =
r.getAuxID (ti, name,
"", flags, linked_auxid);
86 std::string tn = elementTypeName;
87 if (tn.starts_with(
"std::vector<"))
89 std::string fac_class_name =
"SG::AuxTypeVectorFactory<" +
90 tn +
",allocator<" + tn;
91 if (fac_class_name[fac_class_name.size()-1] ==
'>')
92 fac_class_name +=
' ';
93 fac_class_name +=
"> >";
99 int offs = fac_class->GetBaseClassOffset (base_class);
101 void* fac_vp = fac_class->New();
104 const std::type_info* tiAlloc = fac->
tiAlloc();
105 r.addFactory (ti, *tiAlloc, std::unique_ptr<SG::IAuxTypeVectorFactory> (fac));
106 auxid =
r.getAuxID(*fac->
tiAlloc(), ti, name,
"", flags, linked_auxid);
115 msg <<
"dynamic ROOT vector factory not implemented for linked types: "
116 << name <<
" " << branchTypeName <<
"\n";
120 std::string vec_name = branchTypeName;
122 vec_name =
"std::vector<" + branchTypeName;
123 if (vec_name[vec_name.size()-1] ==
'>')
127 TClass* vec_class = TClass::GetClass (vec_name.c_str());
130 auto facp = std::make_unique<SG::RootAuxVectorFactory> (vec_class);
131 std::string tiAllocName = facp->tiAllocName();
132 (void)
r.addFactory (ti, tiAllocName, std::move (facp));
133 auxid =
r.getAuxID(tiAllocName, ti, name,
"", flags);
Handle mappings between names and auxid_t.
Dynamic implementation of IAuxVectorFactory, relying on root's vector proxy.
Handle mappings between names and auxid_t.
static bool isLinkedName(const std::string &name)
Test if a variable name corresponds to a linked variable.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Interface for factory objects that create vectors.
virtual const std::type_info * tiAlloc() const =0
Return the type_info of the vector allocator.
Helper class to use to report a message.
Helper for emitting error messages.
Find the auxid for a dynamic branch.
AuxVarFlags
Additional flags to qualify an auxiliary variable.
@ Linked
Mark that this variable is linked to another one.
static const auxid_t null_auxid
To signal no aux data item.
SG::auxid_t getDynamicAuxID(const std::type_info &ti, const std::string &name, const std::string &elementTypeName, const std::string &branch_type_name, bool standalone, SG::auxid_t linked_auxid)
Find the auxid for a dynamic branch.
TClass * getClassIfDictionaryExists(const std::string &cname)
Look up a TClass given a name.
size_t auxid_t
Identifier for a particular aux data item.