@@ -40,8 +40,16 @@ class RPageSource;
40
40
41
41
namespace Experimental {
42
42
43
- enum class ENTupleInspectorPrintFormat { kTable , kCSV };
44
- enum class ENTupleInspectorHist { kCount , kNElems , kCompressedSize , kUncompressedSize };
43
+ enum class ENTupleInspectorPrintFormat {
44
+ kTable ,
45
+ kCSV
46
+ };
47
+ enum class ENTupleInspectorHist {
48
+ kCount ,
49
+ kNElems ,
50
+ kCompressedSize ,
51
+ kUncompressedSize
52
+ };
45
53
46
54
// clang-format off
47
55
/* *
@@ -93,15 +101,16 @@ public:
93
101
: fColumnDescriptor (colDesc),
94
102
fCompressedPageSizes (compressedPageSizes),
95
103
fElementSize(elemSize),
96
- fNElements(nElems) {};
104
+ fNElements(nElems){};
97
105
~RColumnInspector () = default ;
98
106
99
107
const ROOT::RColumnDescriptor &GetDescriptor () const { return fColumnDescriptor ; }
100
108
const std::vector<std::uint64_t > &GetCompressedPageSizes () const { return fCompressedPageSizes ; }
101
109
std::uint64_t GetNPages () const { return fCompressedPageSizes .size (); }
102
110
std::uint64_t GetCompressedSize () const
103
111
{
104
- return std::accumulate (fCompressedPageSizes .begin (), fCompressedPageSizes .end (), static_cast <std::uint64_t >(0 ));
112
+ return std::accumulate (fCompressedPageSizes .begin (), fCompressedPageSizes .end (),
113
+ static_cast <std::uint64_t >(0 ));
105
114
}
106
115
std::uint64_t GetUncompressedSize () const { return fElementSize * fNElements ; }
107
116
std::uint64_t GetElementSize () const { return fElementSize ; }
@@ -123,7 +132,7 @@ public:
123
132
124
133
public:
125
134
RFieldTreeInspector (const ROOT::RFieldDescriptor &fieldDesc, std::uint64_t onDiskSize, std::uint64_t inMemSize)
126
- : fRootFieldDescriptor (fieldDesc), fCompressedSize (onDiskSize), fUncompressedSize (inMemSize) {};
135
+ : fRootFieldDescriptor (fieldDesc), fCompressedSize (onDiskSize), fUncompressedSize (inMemSize){};
127
136
~RFieldTreeInspector () = default ;
128
137
129
138
const ROOT::RFieldDescriptor &GetDescriptor () const { return fRootFieldDescriptor ; }
@@ -469,6 +478,23 @@ public:
469
478
{
470
479
return GetFieldsByName (std::regex{std::string (fieldNamePattern)}, searchInSubfields);
471
480
}
481
+ // ///////////////////////////////////////////////////////////////////////////
482
+ // / \brief Print a .dot string that represents the tree of the (sub)fields of an RNTuple
483
+ // /
484
+ // / \param[in] fieldDescriptor The descriptor of the root field (this method works recursively)
485
+ // /
486
+
487
+ void PrintFieldsTreeAsDot (const ROOT::RFieldDescriptor &fieldDescriptor, std::ostream &output = std::cout) const ;
488
+
489
+ // ///////////////////////////////////////////////////////////////////////////
490
+ // / \brief Print the tree of all the (sub)fields of an RNTuple
491
+ // / \param[in] output
492
+ // /
493
+ // / \see PrintFieldsTreeAsDot(const ROOT::RFieldDescriptor &fieldDescriptor, std::ostream &output=std::cout) const
494
+ void PrintFieldsTreeAsDot (std::ostream &output = std::cout) const
495
+ {
496
+ PrintFieldsTreeAsDot (GetDescriptor ().GetFieldZero (), output);
497
+ }
472
498
};
473
499
} // namespace Experimental
474
500
} // namespace ROOT
0 commit comments