39 : fInfo(nullptr), fClass(cls)
148 if (errorCode != 0) {
149 free(demangledEnumName);
150 std::cerr <<
"ERROR TEnum::GetEnum - A problem occurred while demangling name.\n";
154 const char *constDemangledEnumName = demangledEnumName;
156 free(demangledEnumName);
182 TEnum *theEnum =
nullptr;
189 obj =
l->FindObject(enName);
192 obj = enumTable->GetObject(enName);
194 return static_cast<TEnum *
>(obj);
200 auto searchEnum = [&theEnum, findEnumInList](
const char * scopeName,
const char * enName,
ESearchAction sa_local) {
205 if (scope) en = findEnumInList(scope->GetListOfEnums(
kFALSE), enName, sa_local);
212 if (
auto tClassScope =
static_cast<TClass *
>(
gROOT->GetListOfClasses()->FindObject(scopeName))) {
217 const bool scopeIsNamespace (tClassScope->Property() &
kIsNamespace);
219 const bool autoParseSuspended =
gInterpreter->IsAutoParsingSuspended();
220 const bool suspendAutoParse = autoParseSuspended || scopeIsNamespace;
224 if (scopeIsNamespace && !autoParseSuspended){
228 auto listOfEnums = tClassScope->GetListOfEnums(canLoadEnums);
232 theEnum = findEnumInList(listOfEnums, enName, sa_local);
236 auto listOfEnums = tProtoClassscope->GetListOfEnums();
237 if (listOfEnums) theEnum = findEnumInList(listOfEnums, enName, sa_local);
244 if (strchr(lastPos,
'<')) {
250 if (lastPos != enumName) {
253 const auto enName = lastPos;
254 const auto scopeNameSize = ((
Long64_t)lastPos - (
Long64_t)enumName) /
sizeof(
decltype(*lastPos)) - 2;
256 char *scopeName =
new char[scopeNameSize + 1];
258 char scopeName[scopeNameSize + 1];
260 strncpy(scopeName, enumName, scopeNameSize);
261 scopeName[scopeNameSize] =
'\0';
263 theEnum = searchEnum(scopeName, enName,
kNone);
265 const auto libsLoaded =
gInterpreter->AutoLoad(scopeName);
267 if (libsLoaded == 0){
270 theEnum = searchEnum(scopeName, enName,
kAutoload);
274 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);
283 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kNone);
286 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kAutoload);
290 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
R__EXTERN TVirtualMutex * gInterpreterMutex
#define R__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.
EDataType GetUnderlyingType() const
Get the unterlying integer type of the enum: enum E { kOne }; // ==> int enum F: long; // ==> long Re...
@ 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.
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.
const char * GetUnqualifiedName(const char *name)
Return the start of the unqualified name include in 'original'.
char * DemangleName(const char *mangled_name, int &errorCode)