Warning, file /include/root/TEnum.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TEnum
0013 #define ROOT_TEnum
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "TDataType.h"
0024 #include "TDictionary.h"
0025 #include "THashList.h"
0026
0027 #include <string>
0028
0029 class ClassInfo_t;
0030 class TClass;
0031 class TEnumConstant;
0032
0033 class TEnum : public TDictionary {
0034
0035 private:
0036 THashList fConstantList;
0037 ClassInfo_t *fInfo = nullptr;
0038 TClass *fClass = nullptr;
0039 std::string fQualName;
0040 EDataType fUnderlyingType = kInt_t;
0041
0042 enum EBits {
0043 kBitIsScopedEnum = BIT(14)
0044 };
0045
0046 public:
0047
0048 enum ESearchAction {kNone = 0,
0049 kAutoload = 1,
0050 kInterpLookup = 2,
0051 kALoadAndInterpLookup = 3
0052 };
0053
0054 TEnum() : TDictionary() {}
0055 TEnum(const char *name, DeclId_t declid, TClass *cls);
0056 TEnum(const TEnum &);
0057 TEnum& operator=(const TEnum &);
0058
0059 virtual ~TEnum();
0060
0061 void AddConstant(TEnumConstant *constant);
0062 TClass *GetClass() const { return fClass; }
0063 const TSeqCollection *GetConstants() const { return &fConstantList; }
0064 const TEnumConstant *GetConstant(const char *name) const { return (TEnumConstant *)fConstantList.FindObject(name); }
0065 DeclId_t GetDeclId() const;
0066
0067
0068
0069
0070
0071 EDataType GetUnderlyingType() const { return fUnderlyingType; };
0072
0073 Bool_t IsValid();
0074 Long_t Property() const override;
0075 void SetClass(TClass *cl) { fClass = cl; }
0076 void Update(DeclId_t id);
0077 const char* GetQualifiedName() const { return fQualName.c_str(); }
0078 static TEnum *GetEnum(const std::type_info &ti, ESearchAction sa = kALoadAndInterpLookup);
0079 static TEnum *GetEnum(const char *enumName, ESearchAction sa = kALoadAndInterpLookup);
0080
0081 ClassDefOverride(TEnum, 2)
0082 };
0083
0084 #endif