File indexing completed on 2025-01-18 10:12:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TListOfEnums
0013 #define ROOT_TListOfEnums
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include "THashList.h"
0026
0027 #include "TDictionary.h"
0028
0029 class TExMap;
0030 class TEnum;
0031
0032 class TListOfEnums : public THashList
0033 {
0034 private:
0035 friend class TCling;
0036 friend class TClass;
0037 friend class TProtoClass;
0038 friend class TROOT;
0039
0040 TClass *fClass;
0041
0042 TExMap *fIds;
0043 THashList *fUnloaded;
0044 Bool_t fIsLoaded;
0045 ULong64_t fLastLoadMarker;
0046
0047 TListOfEnums(const TListOfEnums&) = delete;
0048 TListOfEnums& operator=(const TListOfEnums&) = delete;
0049
0050 void MapObject(TObject *obj);
0051 void UnmapObject(TObject *obj);
0052
0053 void Load();
0054 void Unload();
0055 void Unload(TEnum *e);
0056 void SetClass(TClass* cl) { fClass = cl; }
0057
0058 public:
0059 typedef TDictionary::DeclId_t DeclId_t;
0060
0061 protected:
0062 TClass *GetClass() const {return fClass;}
0063 TExMap *GetIds() { return fIds;}
0064 TEnum *FindUnloaded(const char* name) { return (TEnum*)fUnloaded->FindObject(name);}
0065 TEnum *Get(DeclId_t id, const char *name);
0066
0067 public:
0068 TListOfEnums(TClass *cl = nullptr);
0069 ~TListOfEnums() override;
0070
0071 TEnum *Find(DeclId_t id) const;
0072 virtual TEnum *GetObject(const char*) const;
0073
0074 TObject *FindObject(const char*) const override;
0075 using THashList::FindObject;
0076
0077 void Clear(Option_t *option) override;
0078 void Delete(Option_t *option="") override;
0079
0080 Bool_t IsLoaded() const { return fIsLoaded; }
0081 void AddFirst(TObject *obj) override;
0082 void AddFirst(TObject *obj, Option_t *opt) override;
0083 void AddLast(TObject *obj) override;
0084 void AddLast(TObject *obj, Option_t *opt) override;
0085 void AddAt(TObject *obj, Int_t idx) override;
0086 void AddAfter(const TObject *after, TObject *obj) override;
0087 void AddAfter(TObjLink *after, TObject *obj) override;
0088 void AddBefore(const TObject *before, TObject *obj) override;
0089 void AddBefore(TObjLink *before, TObject *obj) override;
0090
0091 void RecursiveRemove(TObject *obj) override;
0092 TObject *Remove(TObject *obj) override;
0093 TObject *Remove(TObjLink *lnk) override;
0094
0095 ClassDefOverride(TListOfEnums,2);
0096 };
0097
0098 #endif