43 fConstantList.SetOwner(
kTRUE);
47 if (0 != strcmp(
"",GetTitle())){
48 fQualName = std::string(GetTitle()) +
"::" + GetName();
51 fQualName = std::string(
GetClass()->GetName()) +
"::" + GetName();
54 fQualName = GetName();
113 if (errorCode != 0) {
114 if (!demangledEnumName) {
115 free(demangledEnumName);
117 std::cerr <<
"ERROR TEnum::GetEnum - A problem occurred while demangling name.\n";
121 const char *constDemangledEnumName = demangledEnumName;
123 free(demangledEnumName);
149 TEnum *theEnum =
nullptr;
159 obj = enumTable->GetObject(enName);
167 auto searchEnum = [&theEnum, findEnumInList](
const char * scopeName,
const char * enName,
ESearchAction sa_local) {
172 if (scope) en = findEnumInList(scope->GetListOfEnums(), enName, sa_local);
179 if (
auto tClassScope = static_cast<TClass *>(
gROOT->GetListOfClasses()->FindObject(scopeName))) {
184 const bool scopeIsNamespace (tClassScope->Property() &
kIsNamespace);
186 const bool autoParseSuspended =
gInterpreter->IsAutoParsingSuspended();
187 const bool suspendAutoParse = autoParseSuspended || scopeIsNamespace;
191 if (scopeIsNamespace && !autoParseSuspended){
195 auto listOfEnums = tClassScope->GetListOfEnums(canLoadEnums);
199 theEnum = findEnumInList(listOfEnums, enName, sa_local);
203 auto listOfEnums = tProtoClassscope->GetListOfEnums();
204 if (listOfEnums) theEnum = findEnumInList(listOfEnums, enName, sa_local);
211 if (strchr(lastPos,
'<')) {
217 if (lastPos != enumName) {
220 const auto enName = lastPos;
221 const auto scopeNameSize = ((
Long64_t)lastPos - (
Long64_t)enumName) /
sizeof(decltype(*lastPos)) - 2;
223 char *scopeName =
new char[scopeNameSize + 1];
225 char scopeName[scopeNameSize + 1];
227 strncpy(scopeName, enumName, scopeNameSize);
228 scopeName[scopeNameSize] =
'\0';
230 theEnum = searchEnum(scopeName, enName,
kNone);
232 const auto libsLoaded =
gInterpreter->AutoLoad(scopeName);
234 if (libsLoaded == 0){
237 theEnum = searchEnum(scopeName, enName, kAutoload);
241 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);
243 theEnum = searchEnum(scopeName, enName, kALoadAndInterpLookup);
250 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kNone);
253 theEnum = findEnumInList(
gROOT->GetListOfEnums(), enumName,
kAutoload);
257 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);
The TEnum class implements the enum type.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
R__EXTERN TClassTable * gClassTable
Bool_t UpdateInterpreterStateMarker()
the Cling ID of the transaction that last updated the object
static TProtoClass * GetProtoNorm(const char *cname)
Given the class normalized name returns the TClassProto object for the class.
R__EXTERN TVirtualMutex * gInterpreterMutex
TClass * fClass
interpreter implementation provided declaration
virtual ~TEnum()
Destructor.
char * DemangleName(const char *mangled_name, int &errorCode)
TClass * fClass
pointer to the foreign object
Collection abstract base class.
The TEnumConstant class implements the constants of the enum type.
The ROOT global object gROOT contains a list of all defined classes.
ClassImp(TEnum) TEnum
Constructor for TEnum class.
void AddConstant(TEnumConstant *constant)
Add a EnumConstant to the list of constants of the Enum Type.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
Bool_t IsValid()
Return true if this enum object is pointing to a currently loaded enum.
#define R__LOCKGUARD(mutex)
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.
Mother of all ROOT objects.
static TEnum * GetEnum(const std::type_info &ti, ESearchAction sa=kALoadAndInterpLookup)
const char * GetUnqualifiedName(const char *name)
Return the start of the unqualified name include in 'original'.
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)
Long_t Property() const
Get property description word. For meaning of bits see EProperty.