Back to home page

EIC code displayed by LXR

 
 

    


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

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_RLevelIter
0010 #define ROOT7_Browsable_RLevelIter
0011 
0012 #include <memory>
0013 #include <string>
0014 
0015 namespace ROOT {
0016 namespace Browsable {
0017 
0018 class RElement;
0019 class RItem;
0020 
0021 /** \class RLevelIter
0022 \ingroup rbrowser
0023 \brief Iterator over single level hierarchy like any array, keys list, ...
0024 \author Sergey Linev <S.Linev@gsi.de>
0025 \date 2019-10-14
0026 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
0027 */
0028 
0029 class RLevelIter {
0030 public:
0031    virtual ~RLevelIter() = default;
0032 
0033    /** Shift to next entry */
0034    virtual bool Next() = 0;
0035 
0036    /** Returns current entry name  */
0037    virtual std::string GetItemName() const = 0;
0038 
0039    /** Returns true if current item can have childs */
0040    virtual bool CanItemHaveChilds() const { return false; }
0041 
0042    /** Create RElement for current entry - may take much time to load object or open file */
0043    virtual std::shared_ptr<RElement> GetElement() = 0;
0044 
0045    virtual std::unique_ptr<RItem> CreateItem();
0046 
0047    virtual bool Find(const std::string &name, int indx = -1);
0048 
0049 };
0050 
0051 
0052 } // namespace Browsable
0053 } // namespace ROOT
0054 
0055 #endif