Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:29:46

0001 /*************************************************************************
0002  * Copyright (C) 1995-2025, 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_RNTupleItem
0010 #define ROOT7_Browsable_RNTupleItem
0011 
0012 #include <ROOT/Browsable/RItem.hxx>
0013 
0014 namespace ROOT {
0015 namespace Browsable {
0016 
0017 /** \class RNTupleItem
0018 \ingroup rbrowser
0019 \brief Representation of an RNTuple item in the browser
0020 \author Patryk Tymoteusz Pilichowski
0021 */
0022 
0023 class RNTupleItem : public RItem {
0024 public:
0025    enum ECategory {
0026       kField,
0027       kVisualization
0028    };
0029 
0030    RNTupleItem() = default;
0031    RNTupleItem(const std::string &_name, int _nchilds = 0, const std::string &_icon = "", ECategory _category = kField)
0032       : RItem(_name, _nchilds, _icon), category(_category)
0033    {
0034    }
0035    // must be here, one needs virtual table for correct streaming of sub-classes
0036    virtual ~RNTupleItem() = default;
0037 
0038    bool IsVisualization() const { return category == kVisualization; }
0039    bool IsField() const { return category == kField; }
0040 
0041    bool Compare(const RItem *b, const std::string &s) const override
0042    {
0043       auto tuple_b = dynamic_cast<const RNTupleItem *>(b);
0044       if (tuple_b != nullptr && (IsVisualization() || tuple_b->IsVisualization()))
0045          return IsVisualization();
0046       return RItem::Compare(b, s);
0047    }
0048 
0049 protected:
0050    ECategory category{kField};
0051 };
0052 
0053 } // namespace Browsable
0054 } // namespace ROOT
0055 
0056 #endif