Logo ROOT   6.18/05
Reference Guide
RNTupleUtil.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleUtil.hxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2018-10-04
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef ROOT7_RNTupleUtil
17#define ROOT7_RNTupleUtil
18
19#include <cstdint>
20
21#include <string>
22#include <vector>
23
24namespace ROOT {
25namespace Experimental {
26
27
28/**
29 * The fields in the ntuple model tree can carry different structural information about the type system.
30 * Leaf fields contain just data, collection fields resolve to offset columns, record root fields have no
31 * materialization on the primitive column layer.
32 */
37 // unimplemented so far
41};
42
43/// Integer type long enough to hold the maximum number of entries in a column
44using NTupleSize_t = std::uint64_t;
45constexpr NTupleSize_t kInvalidNTupleIndex = std::uint64_t(-1);
46/// Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t
49 explicit constexpr RClusterSize(std::uint32_t value) : fValue(value) {}
50 RClusterSize& operator =(const std::uint32_t value) { fValue = value; return *this; }
51 RClusterSize& operator +=(const std::uint32_t value) { fValue += value; return *this; }
52 RClusterSize operator++(int) { auto result = *this; fValue++; return result; }
53 operator std::uint32_t() const { return fValue; }
54
55 std::uint32_t fValue;
56};
58constexpr ClusterSize_t kInvalidClusterIndex(std::uint32_t(-1));
59
60/// Uniquely identifies a physical column within the scope of the current process, used to tag pages
61using ColumnId_t = std::int64_t;
63
64/// Distriniguishes elements of the same type within a descriptor, e.g. different fields
65using DescriptorId_t = std::uint64_t;
66constexpr DescriptorId_t kInvalidDescriptorId = std::uint64_t(-1);
67
68
69/// 64 possible flags to apply to all versioned entities (so far unused).
70using NTupleFlags_t = std::uint64_t;
71/// For forward and backward compatibility, attach version information to
72/// the consitituents of the file format (column, field, cluster, ntuple).
74private:
75 /// The version used to write an entity
76 std::uint32_t fVersionUse = 0;
77 /// The minimum required version necessary to read an entity
78 std::uint32_t fVersionMin = 0;
80
81public:
82 RNTupleVersion() = default;
83 RNTupleVersion(std::uint32_t versionUse, std::uint32_t versionMin)
84 : fVersionUse(versionUse), fVersionMin(versionMin)
85 {}
86 RNTupleVersion(std::uint32_t versionUse, std::uint32_t versionMin, NTupleFlags_t flags)
87 : fVersionUse(versionUse), fVersionMin(versionMin), fFlags(flags)
88 {}
89
90 std::uint32_t GetVersionUse() const { return fVersionUse; }
91 std::uint32_t GetVersionMin() const { return fVersionMin; }
92 NTupleFlags_t GetFlags() const { return fFlags; }
93};
94
95} // namespace Experimental
96} // namespace ROOT
97
98#endif
For forward and backward compatibility, attach version information to the consitituents of the file f...
Definition: RNTupleUtil.hxx:73
std::uint32_t fVersionMin
The minimum required version necessary to read an entity.
Definition: RNTupleUtil.hxx:78
RNTupleVersion(std::uint32_t versionUse, std::uint32_t versionMin)
Definition: RNTupleUtil.hxx:83
std::uint32_t GetVersionUse() const
Definition: RNTupleUtil.hxx:90
NTupleFlags_t GetFlags() const
Definition: RNTupleUtil.hxx:92
RNTupleVersion(std::uint32_t versionUse, std::uint32_t versionMin, NTupleFlags_t flags)
Definition: RNTupleUtil.hxx:86
std::uint32_t fVersionUse
The version used to write an entity.
Definition: RNTupleUtil.hxx:76
std::uint32_t GetVersionMin() const
Definition: RNTupleUtil.hxx:91
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Definition: RNTupleUtil.hxx:44
std::uint64_t NTupleFlags_t
64 possible flags to apply to all versioned entities (so far unused).
Definition: RNTupleUtil.hxx:70
ENTupleStructure
The fields in the ntuple model tree can carry different structural information about the type system.
Definition: RNTupleUtil.hxx:33
constexpr ColumnId_t kInvalidColumnId
Definition: RNTupleUtil.hxx:62
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
Definition: RNTupleUtil.hxx:65
constexpr NTupleSize_t kInvalidNTupleIndex
Definition: RNTupleUtil.hxx:45
std::int64_t ColumnId_t
Uniquely identifies a physical column within the scope of the current process, used to tag pages.
Definition: RNTupleUtil.hxx:61
constexpr ClusterSize_t kInvalidClusterIndex(std::uint32_t(-1))
constexpr DescriptorId_t kInvalidDescriptorId
Definition: RNTupleUtil.hxx:66
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...
Definition: RNTupleUtil.hxx:47
RClusterSize & operator+=(const std::uint32_t value)
Definition: RNTupleUtil.hxx:51
RClusterSize & operator=(const std::uint32_t value)
Definition: RNTupleUtil.hxx:50
constexpr RClusterSize(std::uint32_t value)
Definition: RNTupleUtil.hxx:49