70 Bool_t isowner =
src.fConstantList.IsOwner();
94 Bool_t isowner =
src.fConstantList.IsOwner();
131 return newId !=
nullptr;
133 return fInfo !=
nullptr;
180 if (errorCode != 0) {
181 free(demangledEnumName);
182 std::cerr <<
"ERROR TEnum::GetEnum - A problem occurred while demangling name.\n";
186 const char *constDemangledEnumName = demangledEnumName;
188 free(demangledEnumName);
214 TEnum *theEnum =
nullptr;
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();
250 const bool suspendAutoParse = autoParseSuspended || scopeIsNamespace;
254 if (scopeIsNamespace && !autoParseSuspended){
258 auto listOfEnums = tClassScope->GetListOfEnums(canLoadEnums);
262 theEnum = findEnumInList(listOfEnums, enName, sa_local);
266 auto listOfEnums = tProtoClassscope->GetListOfEnums();
267 if (listOfEnums) theEnum = findEnumInList(listOfEnums, enName, sa_local);
274 if (strchr(lastPos,
'<')) {
280 std::string normalizedName;
287 if (normalizedName != enumName) {
288 enumName = normalizedName.c_str();
297 if (lastPos != enumName) {
300 const auto enName = lastPos;
301 const auto scopeNameSize = ((
Long64_t)lastPos - (
Long64_t)enumName) /
sizeof(
decltype(*lastPos)) - 2;
303 char *scopeName =
new char[scopeNameSize + 1];
305 char scopeName[scopeNameSize + 1];
307 strncpy(scopeName, enumName, scopeNameSize);
308 scopeName[scopeNameSize] =
'\0';
310 theEnum = searchEnum(scopeName, enName,
kNone);
312 const auto libsLoaded =
gInterpreter->AutoLoad(scopeName);
314 if (libsLoaded == 0){
317 theEnum = searchEnum(scopeName, 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);
330 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kNone);
333 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kAutoload);
337 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
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)
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.
This class defines an abstract interface that must be implemented by all classes that contain diction...
Bool_t UpdateInterpreterStateMarker()
the Cling ID of the transaction that last updated the object
TDictionary & operator=(const TDictionary &other)
The TEnumConstant class implements the constants of the enum type.
The TEnum class implements the enum type.
TEnum & operator=(const TEnum &)
Assign operator.
@ 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 override
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.
void Clear(Option_t *option="") override
Remove all objects from the list.
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
void Add(TObject *obj) override
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.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
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)
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.