220 TEnum *theEnum =
nullptr;
227 obj =
l->FindObject(enName);
230 obj = enumTable->GetObject(enName);
232 return static_cast<TEnum *
>(obj);
238 auto searchEnum = [&theEnum, findEnumInList](
const char * scopeName,
const char * enName,
ESearchAction sa_local) {
243 if (scope) en = findEnumInList(scope->GetListOfEnums(
kFALSE), enName, sa_local);
248 if (
auto tClassScope =
static_cast<TClass *
>(
gROOT->GetListOfClasses()->FindObject(scopeName))) {
253 const bool scopeIsNamespace (tClassScope->Property() &
kIsNamespace);
255 const bool autoParseSuspended =
gInterpreter->IsAutoParsingSuspended();
257 if (scopeIsNamespace && !autoParseSuspended) {
262 auto listOfEnums = tClassScope->GetListOfEnums(
true);
265 theEnum = findEnumInList(listOfEnums, enName, sa_local);
267 auto listOfEnums = tClassScope->GetListOfEnums(canLoadEnums);
268 theEnum = findEnumInList(listOfEnums, enName, sa_local);
273 auto listOfEnums = tProtoClassscope->GetListOfEnums();
274 if (listOfEnums) theEnum = findEnumInList(listOfEnums, enName, sa_local);
281 if (strchr(lastPos,
'<')) {
287 std::string normalizedName;
294 if (normalizedName != enumName) {
295 enumName = normalizedName.c_str();
304 if (lastPos != enumName) {
306 const auto enName = lastPos;
307 const auto scopeNameSize = (lastPos - enumName) /
sizeof(
decltype(*lastPos)) - 2;
308 std::string scopeName{enumName, scopeNameSize};
310 theEnum = searchEnum(scopeName.c_str(), enName,
kNone);
312 const auto libsLoaded =
gInterpreter->AutoLoad(scopeName.c_str());
314 if (libsLoaded == 0){
317 theEnum = searchEnum(scopeName.c_str(), enName,
kAutoload);
321 printf(
"TEnum::GetEnum: Header Parsing - The enumerator %s is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file.\n", enumName);
327 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kNone);
330 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kAutoload);
334 printf(
"TEnum::GetEnum: Header Parsing - The enumerator %s is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file.\n", enumName);
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.