137 if (errorCode != 0) {
138 free(demangledEnumName);
139 std::cerr <<
"ERROR TEnum::GetEnum - A problem occurred while demangling name.\n";
143 const char *constDemangledEnumName = demangledEnumName;
145 free(demangledEnumName);
171 TEnum *theEnum =
nullptr;
178 obj =
l->FindObject(enName);
181 obj = enumTable->GetObject(enName);
183 return static_cast<TEnum *
>(obj);
189 auto searchEnum = [&theEnum, findEnumInList](
const char * scopeName,
const char * enName,
ESearchAction sa_local) {
194 if (scope) en = findEnumInList(scope->GetListOfEnums(
kFALSE), enName, sa_local);
199 if (
auto tClassScope =
static_cast<TClass *
>(
gROOT->GetListOfClasses()->FindObject(scopeName))) {
204 const bool scopeIsNamespace (tClassScope->Property() &
kIsNamespace);
206 const bool autoParseSuspended =
gInterpreter->IsAutoParsingSuspended();
207 const bool suspendAutoParse = autoParseSuspended || scopeIsNamespace;
211 if (scopeIsNamespace && !autoParseSuspended){
215 auto listOfEnums = tClassScope->GetListOfEnums(canLoadEnums);
219 theEnum = findEnumInList(listOfEnums, enName, sa_local);
223 auto listOfEnums = tProtoClassscope->GetListOfEnums();
224 if (listOfEnums) theEnum = findEnumInList(listOfEnums, enName, sa_local);
231 if (strchr(lastPos,
'<')) {
241 if (lastPos != enumName) {
244 const auto enName = lastPos;
245 const auto scopeNameSize = ((
Long64_t)lastPos - (
Long64_t)enumName) /
sizeof(
decltype(*lastPos)) - 2;
247 char *scopeName =
new char[scopeNameSize + 1];
249 char scopeName[scopeNameSize + 1];
251 strncpy(scopeName, enumName, scopeNameSize);
252 scopeName[scopeNameSize] =
'\0';
254 theEnum = searchEnum(scopeName, enName,
kNone);
256 const auto libsLoaded =
gInterpreter->AutoLoad(scopeName);
258 if (libsLoaded == 0){
261 theEnum = searchEnum(scopeName, enName,
kAutoload);
265 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);
274 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kNone);
277 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kAutoload);
281 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);
R__EXTERN TClassTable * gClassTable
#define R__READ_LOCKGUARD(mutex)
static TProtoClass * GetProtoNorm(const char *cname)
Given the class normalized name returns the TClassProto object for the class.
TClass instances represent classes, structs and namespaces in the ROOT type system.
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.
Collection abstract base class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Bool_t UpdateInterpreterStateMarker()
the Cling ID of the transaction that last updated the object
The TEnumConstant class implements the constants of the enum type.
The TEnum class implements the enum type.
@ kBitIsScopedEnum
The enum is an enum class.
TClass * GetClass() const
void AddConstant(TEnumConstant *constant)
Add a EnumConstant to the list of constants of the Enum Type.
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
TClass * fClass
Interpreter information, owned by TEnum.
static TEnum * GetEnum(const std::type_info &ti, ESearchAction sa=kALoadAndInterpLookup)
Bool_t IsValid()
Return true if this enum object is pointing to a currently loaded enum.
EDataType fUnderlyingType
DeclId_t GetDeclId() const
std::string fQualName
Owning class.
virtual ~TEnum()
Destructor.
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
virtual void Add(TObject *obj)
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Persistent version of a TClass.
R__EXTERN TVirtualRWMutex * gCoreMutex
const char * GetUnqualifiedName(const char *name)
Return the start of the unqualified name include in 'original'.
char * DemangleName(const char *mangled_name, int &errorCode)