Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:30

0001 /*************************************************************************
0002  * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 #ifndef ROOT7_Browsable_RGroup
0010 #define ROOT7_Browsable_RGroup
0011 
0012 #include <ROOT/Browsable/RElement.hxx>
0013 
0014 namespace ROOT {
0015 namespace Browsable {
0016 
0017 /** \class RGroup
0018 \ingroup rbrowser
0019 \brief Group of browsable elements - combines several different elements together.
0020 \author Sergey Linev <S.Linev@gsi.de>
0021 \date 2019-11-22
0022 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
0023 */
0024 
0025 class RGroup : public RElement {
0026 
0027    std::string fName;
0028    std::string fTitle;
0029    std::vector<std::shared_ptr<RElement>> fChilds;
0030 
0031 public:
0032 
0033    RGroup(const std::string &name, const std::string &title = "") : RElement(), fName(name), fTitle(title) {}
0034 
0035    virtual ~RGroup() = default;
0036 
0037    /** Name of browsable, must be provided in derived classes */
0038    std::string GetName() const override { return fName; }
0039 
0040    /** Title of browsable (optional) */
0041    std::string GetTitle() const override { return fTitle; }
0042 
0043    /** Create iterator for childs elements if any */
0044    std::unique_ptr<RLevelIter> GetChildsIter() override;
0045 
0046    void Add(std::shared_ptr<RElement> elem) { fChilds.emplace_back(elem); }
0047 
0048    auto &GetChilds() const { return fChilds; }
0049 };
0050 
0051 } // namespace Browsable
0052 } // namespace ROOT
0053 
0054 #endif