@@ -307,6 +307,68 @@ public:
307307 }
308308 };
309309
310+ // clang-format off
311+ /* *
312+ \class ROOT::Experimental::RClusterDescriptor::RPageInfo
313+ \ingroup NTuple
314+ \brief Information about a single page in the context of a cluster's page range.
315+ */
316+ // clang-format on
317+ // NOTE: We do not need to store the element size / uncompressed page size because we know to which column
318+ // the page belongs
319+ struct RPageInfo {
320+ protected:
321+ // / The sum of the elements of all the pages must match the corresponding fNElements field in fColumnRanges
322+ std::uint32_t fNElements = std::uint32_t (-1 );
323+ // / The meaning of fLocator depends on the storage backend.
324+ RNTupleLocator fLocator ;
325+ // / If true, the 8 bytes following the serialized page are an xxhash of the on-disk page data
326+ bool fHasChecksum = false ;
327+
328+ public:
329+ RPageInfo () = default;
330+ RPageInfo (std::uint32_t nElements, const RNTupleLocator &locator, bool hasChecksum)
331+ : fNElements(nElements), fLocator(locator), fHasChecksum(hasChecksum)
332+ {
333+ }
334+
335+ bool operator ==(const RPageInfo &other) const
336+ {
337+ return fNElements == other.fNElements && fLocator == other.fLocator ;
338+ }
339+
340+ std::uint32_t GetNElements () const { return fNElements ; }
341+ void SetNElements (std::uint32_t n) { fNElements = n; }
342+
343+ const RNTupleLocator &GetLocator () const { return fLocator ; }
344+ RNTupleLocator &GetLocator () { return fLocator ; }
345+ void SetLocator (const RNTupleLocator &locator) { fLocator = locator; }
346+
347+ bool HasChecksum () const { return fHasChecksum ; }
348+ void SetHasChecksum (bool hasChecksum) { fHasChecksum = hasChecksum; }
349+ };
350+
351+ struct RPageInfoExtended : RPageInfo {
352+ private:
353+ // / Index (in cluster) of the first element in page.
354+ ROOT::NTupleSize_t fFirstElementIndex = 0 ;
355+ // / Page number in the corresponding RPageRange.
356+ ROOT::NTupleSize_t fPageNumber = 0 ;
357+
358+ public:
359+ RPageInfoExtended () = default ;
360+ RPageInfoExtended (const RPageInfo &pageInfo, ROOT::NTupleSize_t firstElementIndex, ROOT::NTupleSize_t pageNumber)
361+ : RPageInfo(pageInfo), fFirstElementIndex (firstElementIndex), fPageNumber (pageNumber)
362+ {
363+ }
364+
365+ ROOT::NTupleSize_t GetFirstElementIndex () const { return fFirstElementIndex ; }
366+ void SetFirstElementIndex (ROOT::NTupleSize_t firstInPage) { fFirstElementIndex = firstInPage; }
367+
368+ ROOT::NTupleSize_t GetPageNumber () const { return fPageNumber ; }
369+ void SetPageNumber (ROOT::NTupleSize_t pageNumber) { fPageNumber = pageNumber; }
370+ };
371+
310372 // clang-format off
311373 /* *
312374 \class ROOT::Experimental::RClusterDescriptor::RPageRange
@@ -317,63 +379,6 @@ public:
317379 class RPageRange {
318380 friend class Internal ::RClusterDescriptorBuilder;
319381
320- public:
321- // / We do not need to store the element size / uncompressed page size because we know to which column
322- // / the page belongs
323- struct RPageInfo {
324- protected:
325- // / The sum of the elements of all the pages must match the corresponding fNElements field in fColumnRanges
326- std::uint32_t fNElements = std::uint32_t (-1 );
327- // / The meaning of fLocator depends on the storage backend.
328- RNTupleLocator fLocator ;
329- // / If true, the 8 bytes following the serialized page are an xxhash of the on-disk page data
330- bool fHasChecksum = false ;
331-
332- public:
333- RPageInfo () = default;
334- RPageInfo (std::uint32_t nElements, const RNTupleLocator &locator, bool hasChecksum)
335- : fNElements(nElements), fLocator(locator), fHasChecksum(hasChecksum)
336- {
337- }
338-
339- bool operator ==(const RPageInfo &other) const
340- {
341- return fNElements == other.fNElements && fLocator == other.fLocator ;
342- }
343-
344- std::uint32_t GetNElements () const { return fNElements ; }
345- void SetNElements (std::uint32_t n) { fNElements = n; }
346-
347- const RNTupleLocator &GetLocator () const { return fLocator ; }
348- RNTupleLocator &GetLocator () { return fLocator ; }
349- void SetLocator (const RNTupleLocator &locator) { fLocator = locator; }
350-
351- bool HasChecksum () const { return fHasChecksum ; }
352- void SetHasChecksum (bool hasChecksum) { fHasChecksum = hasChecksum; }
353- };
354-
355- struct RPageInfoExtended : RPageInfo {
356- private:
357- // / Index (in cluster) of the first element in page.
358- ROOT::NTupleSize_t fFirstElementIndex = 0 ;
359- // / Page number in the corresponding RPageRange.
360- ROOT::NTupleSize_t fPageNumber = 0 ;
361-
362- public:
363- RPageInfoExtended () = default ;
364- RPageInfoExtended (const RPageInfo &pageInfo, ROOT::NTupleSize_t firstElementIndex,
365- ROOT::NTupleSize_t pageNumber)
366- : RPageInfo(pageInfo), fFirstElementIndex (firstElementIndex), fPageNumber (pageNumber)
367- {
368- }
369-
370- ROOT::NTupleSize_t GetFirstElementIndex () const { return fFirstElementIndex ; }
371- void SetFirstElementIndex (ROOT::NTupleSize_t firstInPage) { fFirstElementIndex = firstInPage; }
372-
373- ROOT::NTupleSize_t GetPageNumber () const { return fPageNumber ; }
374- void SetPageNumber (ROOT::NTupleSize_t pageNumber) { fPageNumber = pageNumber; }
375- };
376-
377382 private:
378383 // / Extend this RPageRange to fit the given RColumnRange, i.e. prepend as many synthetic RPageInfos as needed to
379384 // / cover the range in `columnRange`. `RPageInfo`s are constructed to contain as many elements of type `element`
0 commit comments