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\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
23*/
24
25class RGroup : public RElement {
26
27 std::string fName;
28 std::string fTitle;
29 std::vector<std::shared_ptr<RElement>> fChilds;
30
31public:
32
33 RGroup(const std::string &name, const std::string &title = "") : RElement(), fName(name), fTitle(title) {}
34
35 virtual ~RGroup() = default;
36
37 /** Name of browsable, must be provided in derived classes */
38 std::string GetName() const override { return fName; }
39
40 /** Title of browsable (optional) */
41 std::string GetTitle() const override { return fTitle; }
42
43 /** Create iterator for childs elements if any */
44 std::unique_ptr<RLevelIter> GetChildsIter() override;
45
46 void Add(std::shared_ptr<RElement> elem) { fChilds.emplace_back(elem); }
47
48 auto &GetChilds() const { return fChilds; }
49};
50
51} // namespace Browsable
52} // namespace ROOT
53
54#endif
char name[80]
Definition TGX11.cxx:110
Basic element of browsable hierarchy.
Definition RElement.hxx:34
Group of browsable elements - combines several different elements together.
Definition RGroup.hxx:25
void Add(std::shared_ptr< RElement > elem)
Definition RGroup.hxx:46
std::vector< std::shared_ptr< RElement > > fChilds
Definition RGroup.hxx:29
RGroup(const std::string &name, const std::string &title="")
Definition RGroup.hxx:33
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:48
std::string GetName() const override
Name of browsable, must be provided in derived classes.
Definition RGroup.hxx:38
std::string GetTitle() const override
Title of browsable (optional)
Definition RGroup.hxx:41
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...