22using namespace std::string_literals;
39 std::shared_ptr<ROOT::Experimental::Detail::RPageSource>
fNtplSource;
47 RFieldElement(std::shared_ptr<ROOT::Experimental::Detail::RPageSource> ntplSource,
48 const std::string &parent_name,
57 return fNtplSource->GetSharedDescriptorGuard()->GetFieldDescriptor(
fFieldId).GetFieldName();
63 auto descriptorGuard =
fNtplSource->GetSharedDescriptorGuard();
64 auto &fld = descriptorGuard->GetFieldDescriptor(
fFieldId);
65 return "RField name "s + fld.GetFieldName() +
" type "s + fld.GetTypeName();
71 const TClass *
GetClass()
const {
return TClass::GetClass<ROOT::Experimental::RNTuple>(); }
80 auto descriptorGuard =
fNtplSource->GetSharedDescriptorGuard();
81 auto range = descriptorGuard->GetFieldIterable(
fFieldId);
82 if (range.begin() != range.end())
return kActNone;
108 std::shared_ptr<ROOT::Experimental::Detail::RPageSource>
fNtplSource;
127 std::string
GetTitle()
const override {
return "RNTuple title"s; }
132 const TClass *
GetClass()
const {
return TClass::GetClass<ROOT::Experimental::RNTuple>(); }
136 auto item = std::make_unique<RItem>(
GetName(), -1,
"sap-icon://table-chart");
160 std::shared_ptr<ROOT::Experimental::Detail::RPageSource>
fNtplSource;
161 std::vector<ROOT::Experimental::DescriptorId_t>
fFieldIds;
167 std::vector<ROOT::Experimental::DescriptorId_t> &&ids,
168 const std::string &parent_name =
""s)
187 auto descriptorGuard =
fNtplSource->GetSharedDescriptorGuard();
189 return subrange.begin() != subrange.end();
197 std::string fieldName;
198 std::string typeName;
201 auto descriptorGuard =
fNtplSource->GetSharedDescriptorGuard();
208 fieldName = field.GetFieldName();
209 typeName = field.GetTypeName();
212 auto item = std::make_unique<RItem>(fieldName, nchilds, nchilds > 0 ?
"sap-icon://split" :
"sap-icon://e-care");
214 item->SetTitle(
"RField name "s + fieldName +
" type "s + typeName);
228 std::vector<ROOT::Experimental::DescriptorId_t> ids;
232 auto descriptorGuard =
fNtplSource->GetSharedDescriptorGuard();
234 for (
auto &
f : descriptorGuard->GetFieldIterable(
fFieldId))
235 ids.emplace_back(
f.GetId());
241 auto &fld = descriptorGuard->GetFieldDescriptor(
fFieldId);
242 prefix.append(fld.GetFieldName());
246 return std::make_unique<RFieldsIterator>(
fNtplSource, std::move(ids), prefix);
251 std::vector<ROOT::Experimental::DescriptorId_t> ids;
254 auto descriptorGuard =
fNtplSource->GetSharedDescriptorGuard();
255 for (
auto &
f : descriptorGuard->GetTopLevelFields())
256 ids.emplace_back(
f.GetId());
259 if (ids.size() == 0)
return nullptr;
260 return std::make_unique<RFieldsIterator>(
fNtplSource, std::move(ids));
281 auto elem = std::make_shared<RNTupleElement>(tuple_name,
filename);
282 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.
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
std::shared_ptr< ROOT::Experimental::Detail::RPageSource > fNtplSource
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.
RFieldElement(std::shared_ptr< ROOT::Experimental::Detail::RPageSource > ntplSource, const std::string &parent_name, const ROOT::Experimental::DescriptorId_t id)
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.
std::shared_ptr< ROOT::Experimental::Detail::RPageSource > fNtplSource
bool Next() override
Shift to next entry.
virtual ~RFieldsIterator()=default
RFieldsIterator(std::shared_ptr< ROOT::Experimental::Detail::RPageSource > ntplSource, std::vector< ROOT::Experimental::DescriptorId_t > &&ids, const std::string &parent_name=""s)
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.
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.
std::shared_ptr< ROOT::Experimental::Detail::RPageSource > fNtplSource
virtual ~RNTupleElement()=default
bool IsNull() const
Returns true if no ntuple found.
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< RPageSource > Create(std::string_view ntupleName, std::string_view location, const RNTupleReadOptions &options=RNTupleReadOptions())
Guess the concrete derived page source from the file name (location)
Common user-tunable settings for reading ntuples.
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.