Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TObjectElement.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_Browsable_TObjectElement
10#define ROOT7_Browsable_TObjectElement
11
13
14class TObject;
15class TCollection;
16
17namespace ROOT {
18namespace Experimental {
19namespace Browsable {
20
21
22/** \class TObjectElement
23\ingroup rbrowser
24\brief Access to TObject basic properties for RBrowsable
25\author Sergey Linev <S.Linev@gsi.de>
26\date 2021-01-11
27\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
28*/
29
30
31class TObjectElement : public RElement {
32protected:
33 std::unique_ptr<RHolder> fObject;
34 TObject *fObj{nullptr};
35 std::string fName;
36
37 bool IsSame(TObject *obj) const { return obj == fObj; }
38
39public:
40 TObjectElement(TObject *obj, const std::string &name = "");
41
42 TObjectElement(std::unique_ptr<RHolder> &obj, const std::string &name = "");
43
44 virtual ~TObjectElement() = default;
45
46 /** Name of TObject */
47 std::string GetName() const override;
48
49 void SetName(const std::string &name) { fName = name; }
50
51 /** Title of TObject */
52 std::string GetTitle() const override;
53
54 /** Size of TObject */
55 virtual Long64_t GetSize() const { return -1; }
56
57 bool IsFolder() const;
58
59 /** Create iterator for childs elements if any */
60 std::unique_ptr<RLevelIter> GetChildsIter() override;
61
62 /** Return copy of TObject holder - if possible */
63 std::unique_ptr<RHolder> GetObject() override;
64
65 const TClass *GetClass() const;
66
67 EActionKind GetDefaultAction() const override;
68
69 bool IsCapable(EActionKind) const override;
70
71 static std::unique_ptr<RLevelIter> GetCollectionIter(const TCollection *);
72
73};
74
75} // namespace Browsable
76} // namespace Experimental
77} // namespace ROOT
78
79
80#endif
long long Long64_t
Definition RtypesCore.h:80
char name[80]
Definition TGX11.cxx:110
Basic element of browsable hierarchy.
Definition RElement.hxx:33
EActionKind
Possible actions on double-click.
Definition RElement.hxx:49
Access to TObject basic properties for RBrowsable.
std::unique_ptr< RHolder > GetObject() override
Return copy of TObject holder - if possible.
const TClass * GetClass() const
Returns class for contained object.
bool IsCapable(EActionKind) const override
Check object capability.
static std::unique_ptr< RLevelIter > GetCollectionIter(const TCollection *)
Creates iterator for TCollection object.
bool IsFolder() const
Returns IsFolder of contained TObject.
std::string GetTitle() const override
Title of TObject.
std::unique_ptr< RLevelIter > GetChildsIter() override
Create iterator for childs elements if any.
virtual Long64_t GetSize() const
Size of TObject.
EActionKind GetDefaultAction() const override
Provides default action which can be performed with the object.
std::string GetName() const override
Name of TObject.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
Collection abstract base class.
Definition TCollection.h:65
Mother of all ROOT objects.
Definition TObject.h:41
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...