File indexing completed on 2025-01-18 10:10:31
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ROOT7_Browsable_TObjectElement
0010 #define ROOT7_Browsable_TObjectElement
0011
0012 #include <ROOT/Browsable/RElement.hxx>
0013
0014 class TObject;
0015 class TCollection;
0016
0017 namespace ROOT {
0018 namespace Browsable {
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 class TObjectElement : public RElement {
0031 protected:
0032 std::unique_ptr<RHolder> fObject;
0033 TObject *fObj{nullptr};
0034 std::string fName;
0035 bool fHideChilds{false};
0036
0037 bool IsSame(TObject *obj) const { return obj == fObj; }
0038
0039 void SetObject(TObject *obj);
0040
0041 void ForgetObject() const;
0042
0043 virtual const TObject *CheckObject() const;
0044
0045 virtual std::string GetMTime() const { return ""; }
0046
0047 virtual Long64_t GetSize() const { return -1; }
0048
0049 public:
0050 TObjectElement(TObject *obj, const std::string &name = "", bool _hide_childs = false);
0051
0052 TObjectElement(std::unique_ptr<RHolder> &obj, const std::string &name = "", bool _hide_childs = false);
0053
0054 virtual ~TObjectElement() = default;
0055
0056
0057 std::string GetName() const override;
0058
0059 void SetName(const std::string &name) { fName = name; }
0060
0061
0062 bool IsHideChilds() const { return fHideChilds; }
0063
0064
0065 void SetHideChilds(bool on) { fHideChilds = on; }
0066
0067 bool IsFolder() const override;
0068
0069
0070 std::string GetTitle() const override;
0071
0072
0073 std::unique_ptr<RLevelIter> GetChildsIter() override;
0074
0075
0076 std::unique_ptr<RHolder> GetObject() override;
0077
0078 bool IsObject(void *) override;
0079
0080 bool CheckValid() override;
0081
0082 const TClass *GetClass() const;
0083
0084 EActionKind GetDefaultAction() const override;
0085
0086 bool IsCapable(EActionKind) const override;
0087
0088 std::unique_ptr<RItem> CreateItem() const override;
0089
0090 static std::unique_ptr<RLevelIter> GetCollectionIter(const TCollection *);
0091
0092 };
0093
0094 }
0095 }
0096
0097
0098 #endif