21using namespace std::string_literals;
38 std::shared_ptr<ROOT::Experimental::RNTupleReader>
fNtplReader;
45 RFieldElement(std::shared_ptr<ROOT::Experimental::RNTupleReader> ntplReader,
const std::string &parent_name,
63 return "RField name "s + fld.GetFieldName() +
" type "s + fld.GetTypeName();
79 if (range.begin() != range.end())
return kActNone;
122 std::string
GetTitle()
const override {
return "RNTuple title"s; }
131 auto item = std::make_unique<RItem>(
GetName(), -1,
"sap-icon://table-chart");
156 std::vector<ROOT::Experimental::DescriptorId_t>
fFieldIds;
162 std::vector<ROOT::Experimental::DescriptorId_t> &&ids,
const std::string &parent_name =
""s)
182 return subrange.begin() != subrange.end();
197 std::make_unique<RItem>(field.GetFieldName(), nchilds, nchilds > 0 ?
"sap-icon://split" :
"sap-icon://e-care");
199 item->SetTitle(
"RField name "s + field.GetFieldName() +
" type "s + field.GetTypeName());
213 std::vector<ROOT::Experimental::DescriptorId_t> ids;
217 ids.emplace_back(
f.GetId());
224 prefix.append(fld.GetFieldName());
227 return std::make_unique<RFieldsIterator>(
fNtplReader, std::move(ids), prefix);
232 std::vector<ROOT::Experimental::DescriptorId_t> ids;
234 for (
auto &
f :
fNtplReader->GetDescriptor().GetTopLevelFields())
235 ids.emplace_back(
f.GetId());
237 if (ids.size() == 0)
return nullptr;
238 return std::make_unique<RFieldsIterator>(
fNtplReader, std::move(ids));
259 auto elem = std::make_shared<RNTupleElement>(tuple_name,
filename);
260 return elem->IsNull() ? nullptr : elem;
RNTupleBrowseProvider newRNTupleBrowseProvider
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Browsing element representing of RField.
std::shared_ptr< ROOT::Experimental::RNTupleReader > fNtplReader
EActionKind GetDefaultAction() const override
Get default action.
bool IsCapable(EActionKind kind) const override
Check if want to perform action.
ROOT::Experimental::DescriptorId_t fFieldId
virtual ~RFieldElement()=default
RFieldElement(std::shared_ptr< ROOT::Experimental::RNTupleReader > ntplReader, const std::string &parent_name, const ROOT::Experimental::DescriptorId_t id)
std::unique_ptr< RHolder > GetObject() override
Access object.
std::string GetTitle() const override
Title of RField.
std::unique_ptr< RLevelIter > GetChildsIter() override
Create iterator for childs elements if any.
const TClass * GetClass() const
Return class of field - for a moment using RNTuple class as dummy.
std::string GetName() const override
Name of RField.
Iterator over RNTuple fields.
std::unique_ptr< RItem > CreateItem() override
Create element for the browser.
std::shared_ptr< RElement > GetElement() override
Create RElement for current entry - may take much time to load object or open file.
bool Next() override
Shift to next entry.
std::shared_ptr< ROOT::Experimental::RNTupleReader > fNtplReader
virtual ~RFieldsIterator()=default
std::vector< ROOT::Experimental::DescriptorId_t > fFieldIds
std::string GetItemName() const override
Returns current entry name
bool CanItemHaveChilds() const override
Returns true if current item can have childs.
RFieldsIterator(std::shared_ptr< ROOT::Experimental::RNTupleReader > ntplReader, std::vector< ROOT::Experimental::DescriptorId_t > &&ids, const std::string &parent_name=""s)
Provider for browsing RNTuple classes.
virtual ~RNTupleBrowseProvider()
Browsing element representing of RNTuple.
std::string GetName() const override
Name of NTuple.
std::unique_ptr< RLevelIter > GetChildsIter() override
Create iterator for childs elements if any.
virtual ~RNTupleElement()=default
bool IsNull() const
Returns true if no ntuple found.
std::shared_ptr< ROOT::Experimental::RNTupleReader > fNtplReader
std::unique_ptr< RItem > CreateItem() const override
Returns item with element description.
RNTupleElement(const std::string &ntplName, const std::string &filename)
std::string GetTitle() const override
Title of NTuple.
const TClass * GetClass() const
Basic element of browsable hierarchy.
EActionKind
Possible actions on double-click.
@ kActDraw6
can be drawn inside ROOT6 canvas
@ kActDraw7
can be drawn inside ROOT7 canvas
Iterator over single level hierarchy like any array, keys list, ...
Provider of different browsing methods for supported classes.
void RegisterNTupleFunc(BrowseNTupleFunc_t func)
static std::unique_ptr< RNTupleReader > Open(std::string_view ntupleName, std::string_view storage, const RNTupleReadOptions &options=RNTupleReadOptions())
Open an RNTuple for reading.
TClass instances represent classes, structs and namespaces in the ROOT type system.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.