Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RGroup.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2020, 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_RGroup
10#define ROOT7_Browsable_RGroup
11
13
14namespace ROOT {
15namespace Browsable {
16
17/** \class RGroup
18\ingroup rbrowser
19\brief Group of browsable elements - combines several different elements together.
20\author Sergey Linev <S.Linev@gsi.de>
21\date 2019-11-22
22*/
23
24class RGroup : public RElement {
25
26 std::string fName;
27 std::string fTitle;
28 std::vector<std::shared_ptr<RElement>> fChilds;
29
30public:
31
32 RGroup(const std::string &name, const std::string &title = "") : RElement(), fName(name), fTitle(title) {}
33
34 virtual ~RGroup() = default;
35
36 /** Name of browsable, must be provided in derived classes */
37 std::string GetName() const override { return fName; }
38
39 /** Title of browsable (optional) */
40 std::string GetTitle() const override { return fTitle; }
41
42 /** Create iterator for childs elements if any */
43 std::unique_ptr<RLevelIter> GetChildsIter() override;
44
45 void Add(std::shared_ptr<RElement> elem) { fChilds.emplace_back(elem); }
46
47 auto &GetChilds() const { return fChilds; }
48};
49
50} // namespace Browsable
51} // namespace ROOT
52
53#endif
char name[80]
Definition TGX11.cxx:148
Basic element of browsable hierarchy.
Definition RElement.hxx:33
Group of browsable elements - combines several different elements together.
Definition RGroup.hxx:24
void Add(std::shared_ptr< RElement > elem)
Definition RGroup.hxx:45
std::vector< std::shared_ptr< RElement > > fChilds
Definition RGroup.hxx:28
RGroup(const std::string &name, const std::string &title="")
Definition RGroup.hxx:32
virtual ~RGroup()=default
std::unique_ptr< RLevelIter > GetChildsIter() override
Create iterator for childs elements if any.
Definition RGroup.cxx:78
auto & GetChilds() const
Definition RGroup.hxx:47
std::string GetName() const override
Name of browsable, must be provided in derived classes.
Definition RGroup.hxx:37
std::string GetTitle() const override
Title of browsable (optional)
Definition RGroup.hxx:40