69 Bool_t isowner =
src.fConstantList.IsOwner();
93 Bool_t isowner =
src.fConstantList.IsOwner();
133 return newId !=
nullptr;
135 return fInfo !=
nullptr;
186 if (errorCode != 0) {
187 free(demangledEnumName);
188 std::cerr <<
"ERROR TEnum::GetEnum - A problem occurred while demangling name.\n";
192 const char *constDemangledEnumName = demangledEnumName;
194 free(demangledEnumName);
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);
bool Bool_t
Boolean (0=false, 1=true) (bool).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
externTClassTable * gClassTable
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
#define R__WRITE_LOCKGUARD(mutex)
#define R__READ_LOCKGUARD(mutex)
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.
Bool_t UpdateInterpreterStateMarker()
TDictionary & operator=(const TDictionary &other)
The TEnumConstant class implements the constants of the enum type.
TEnum & operator=(const TEnum &)
Assign operator.
TClass * GetClass() const
void AddConstant(TEnumConstant *constant)
Add a EnumConstant to the list of constants of the Enum Type.
ClassInfo_t * fInfo
!Interpreter information, owned by TEnum
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
@ kBitIsValid
The TEnum object was read from file (assumed valid).
@ kBitIsScopedEnum
The enum is an enum class.
TClass * fClass
!Owning class
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
virtual ~TEnum()
Destructor.
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
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.
TObject()
TObject constructor.
Persistent version of a TClass.
externTVirtualRWMutex * 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)
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.