214 TEnum *theEnum =
nullptr;
221 obj =
l->FindObject(enName);
224 obj = enumTable->GetObject(enName);
226 return static_cast<TEnum *
>(obj);
232 auto searchEnum = [&theEnum, findEnumInList](
const char * scopeName,
const char * enName,
ESearchAction sa_local) {
237 if (scope) en = findEnumInList(scope->GetListOfEnums(
kFALSE), enName, sa_local);
242 if (
auto tClassScope =
static_cast<TClass *
>(
gROOT->GetListOfClasses()->FindObject(scopeName))) {
247 const bool scopeIsNamespace (tClassScope->Property() &
kIsNamespace);
249 const bool autoParseSuspended =
gInterpreter->IsAutoParsingSuspended();
251 if (scopeIsNamespace && !autoParseSuspended) {
256 auto listOfEnums = tClassScope->GetListOfEnums(
true);
259 theEnum = findEnumInList(listOfEnums, enName, sa_local);
261 auto listOfEnums = tClassScope->GetListOfEnums(canLoadEnums);
262 theEnum = findEnumInList(listOfEnums, enName, sa_local);
267 auto listOfEnums = tProtoClassscope->GetListOfEnums();
268 if (listOfEnums) theEnum = findEnumInList(listOfEnums, enName, sa_local);
275 if (strchr(lastPos,
'<')) {
281 std::string normalizedName;
288 if (normalizedName != enumName) {
289 enumName = normalizedName.c_str();
298 if (lastPos != enumName) {
301 const auto enName = lastPos;
302 const auto scopeNameSize = ((
Long64_t)lastPos - (
Long64_t)enumName) /
sizeof(
decltype(*lastPos)) - 2;
304 char *scopeName =
new char[scopeNameSize + 1];
306 char scopeName[scopeNameSize + 1];
308 strncpy(scopeName, enumName, scopeNameSize);
309 scopeName[scopeNameSize] =
'\0';
311 theEnum = searchEnum(scopeName, enName,
kNone);
313 const auto libsLoaded =
gInterpreter->AutoLoad(scopeName);
315 if (libsLoaded == 0){
318 theEnum = searchEnum(scopeName, enName,
kAutoload);
322 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);
331 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kNone);
334 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kAutoload);
338 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.