45 std::unique_ptr<ROOT::Internal::RColumnElementBase>
fElement;
79 return static_cast<std::uint16_t
>(
fElement->GetBitsOnStorage());
117 template <
typename CppT>
118 static std::unique_ptr<RReadColumn>
121 auto column = std::unique_ptr<RReadColumn>(
new RReadColumn(
type, columnIdx, representationIdx));
122 column->fElement = ROOT::Internal::RColumnElementBase::Generate<CppT>(
type);
136 const auto elemSize =
fElement->GetSize();
139 std::memcpy(to, from, elemSize);
147 const auto elemSize =
fElement->GetSize();
150 std::memcpy(to, from, elemSize);
155 const auto elemSize =
fElement->GetSize();
156 auto tail =
static_cast<unsigned char *
>(to);
167 std::memcpy(tail, from, elemSize * nBatch);
169 tail += nBatch * elemSize;
171 globalIndex += nBatch;
177 const auto elemSize =
fElement->GetSize();
178 auto tail =
static_cast<unsigned char *
>(to);
189 std::memcpy(tail, from, elemSize * nBatch);
191 tail += nBatch * elemSize;
197 template <
typename CppT>
201 return MapV<CppT>(globalIndex, nItems);
204 template <
typename CppT>
208 return MapV<CppT>(localIndex, nItems);
211 template <
typename CppT>
223 template <
typename CppT>
262 idxStart = *Map<ROOT::Internal::RColumnIndex>(globalIndex - 1);
263 idxEnd = *Map<ROOT::Internal::RColumnIndex>(globalIndex);
267 idxEnd = *Map<ROOT::Internal::RColumnIndex>(globalIndex);
269 idxStart = (globalIndex == selfOffset) ? 0 : *Map<ROOT::Internal::RColumnIndex>(globalIndex - 1);
272 idxEnd = *Map<ROOT::Internal::RColumnIndex>(globalIndex);
274 *collectionSize = idxEnd - idxStart;
282 auto idxStart = (
index == 0) ? 0 : *Map<ROOT::Internal::RColumnIndex>(localIndex - 1);
283 auto idxEnd = *Map<ROOT::Internal::RColumnIndex>(localIndex);
284 *collectionSize = idxEnd - idxStart;
291 auto varSwitch = Map<ROOT::Internal::RColumnSwitch>(globalIndex);
293 *tag = varSwitch->GetTag();
336 if (expandedPage.IsNull()) {
355 template <
typename CppT>
356 static std::unique_ptr<RWriteColumn>
359 auto column = std::unique_ptr<RWriteColumn>(
new RWriteColumn(
type, columnIdx, representationIdx));
360 column->fElement = ROOT::Internal::RColumnElementBase::Generate<CppT>(
type);
384 void AppendV(
const void *from, std::size_t count)
386 auto src =
reinterpret_cast<const unsigned char *
>(from);
389 if (nElementsRemaining == 0) {
394 assert(nElementsRemaining > 0);
395 auto nBatch = std::min(count, nElementsRemaining);
#define R__unlikely(expr)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
The available trivial, native content types of a column.
A column element encapsulates the translation between basic C++ types and their column representation...
A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into ...
RColumn(ROOT::ENTupleColumnType type, std::uint32_t columnIndex, std::uint16_t representationIndex)
std::optional< std::pair< double, double > > GetValueRange() const
RColumn & operator=(const RColumn &)=delete
std::uint16_t GetRepresentationIndex() const
RColumn(const RColumn &)=delete
std::uint16_t fRepresentationIndex
Fields can have multiple column representations, distinguished by representation index.
ROOT::Internal::RColumnElementBase * GetElement() const
void SetBitsOnStorage(std::size_t bits)
ROOT::ENTupleColumnType GetType() const
void SetValueRange(double min, double max)
ROOT::DescriptorId_t GetOnDiskId() const
RReadColumn * ForReading()
RWriteColumn * ForWriting()
ROOT::DescriptorId_t fOnDiskId
The column id in the column descriptor, once connected to a sink or source.
std::uint32_t fIndex
Columns belonging to the same field are distinguished by their order.
virtual ~RColumn()=default
std::uint16_t GetBitsOnStorage() const
std::uint32_t GetIndex() const
std::unique_ptr< ROOT::Internal::RColumnElementBase > fElement
Used to pack and unpack pages on writing/reading.
ROOT::ENTupleColumnType fType
Abstract interface to write data into an ntuple.
const ROOT::RNTupleWriteOptions & GetWriteOptions() const
virtual ROOT::Internal::RPage ReservePage(RWriteColumn &column, std::size_t nElements)
Get a new, empty page for the given column that can be filled with up to nElements; nElements must be...
Abstract interface to read data from an ntuple.
ROOT::NTupleSize_t GetIndexOffset() const
ROOT::DescriptorId_t GetId() const
A page is a slice of a column that is mapped into memory.
ROOT::NTupleSize_t GetGlobalRangeLast() const
std::uint32_t GetNElements() const
std::size_t GetNBytes() const
The space taken by column elements in the buffer.
void * GrowUnchecked(std::uint32_t nElements)
Increases the number elements in the page.
ROOT::NTupleSize_t GetLocalRangeLast() const
std::uint32_t GetMaxElements() const
std::size_t GetCapacity() const
bool Contains(ROOT::NTupleSize_t globalIndex) const
const RClusterInfo & GetClusterInfo() const
ROOT::NTupleSize_t GetGlobalRangeFirst() const
ROOT::NTupleSize_t GetLocalRangeFirst() const
void MergeTeams(RReadColumn &other)
std::unique_ptr< RTeam > fTeam
As an optimization, if unset the team contains consists of this column only.
CppT * MapV(RNTupleLocalIndex localIndex, ROOT::NTupleSize_t &nItems)
RReadColumn(ROOT::ENTupleColumnType type, std::uint32_t columnIndex, std::uint16_t representationIndex)
void GetSwitchInfo(ROOT::NTupleSize_t globalIndex, RNTupleLocalIndex *varIndex, std::uint32_t *tag)
Get the currently active cluster id.
ROOT::Internal::RPageSource * fPageSource
CppT * Map(const ROOT::NTupleSize_t globalIndex)
bool TryMapPage(ROOT::NTupleSize_t globalIndex)
void ConnectPageSource(ROOT::DescriptorId_t fieldId, ROOT::Internal::RPageSource &pageSource)
Connect the column to a page source.
void ReadV(ROOT::NTupleSize_t globalIndex, ROOT::NTupleSize_t count, void *to)
void ReadV(RNTupleLocalIndex localIndex, ROOT::NTupleSize_t count, void *to)
const RPageSource * GetPageSource() const
void GetCollectionInfo(RNTupleLocalIndex localIndex, RNTupleLocalIndex *collectionStart, ROOT::NTupleSize_t *collectionSize)
void GetCollectionInfo(const ROOT::NTupleSize_t globalIndex, RNTupleLocalIndex *collectionStart, ROOT::NTupleSize_t *collectionSize)
For offset columns only, look at the two adjacent values that define a collection's coordinates.
void MapPage(RNTupleLocalIndex localIndex)
void Read(const ROOT::NTupleSize_t globalIndex, void *to)
ROOT::NTupleSize_t GetGlobalIndex(RNTupleLocalIndex clusterIndex)
static std::unique_ptr< RReadColumn > Create(ROOT::ENTupleColumnType type, std::uint32_t columnIdx, std::uint16_t representationIdx)
ROOT::Internal::RPageRef fReadPageRef
The currently mapped page for reading.
RNTupleLocalIndex GetClusterIndex(ROOT::NTupleSize_t globalIndex)
void MapPage(ROOT::NTupleSize_t globalIndex)
CppT * MapV(const ROOT::NTupleSize_t globalIndex, ROOT::NTupleSize_t &nItems)
CppT * Map(RNTupleLocalIndex localIndex)
void Read(RNTupleLocalIndex localIndex, void *to)
ROOT::Internal::RPageSink * fPageSink
ROOT::NTupleSize_t fNElements
The number of elements written.
ROOT::Internal::RPage fWritePage
The page into which new elements are being written.
void HandleWritePageIfFull()
Used when trying to append to a full write page.
std::size_t GetWritePageCapacity() const
ROOT::NTupleSize_t GetFirstElementIndex() const
void AppendV(const void *from, std::size_t count)
RWriteColumn(ROOT::ENTupleColumnType type, std::uint32_t columnIndex, std::uint16_t representationIndex)
ROOT::NTupleSize_t fFirstElementIndex
Global index of the first element in this column; usually == 0, unless it is a deferred column.
static std::unique_ptr< RWriteColumn > Create(ROOT::ENTupleColumnType type, std::uint32_t columnIdx, std::uint16_t representationIdx)
void ConnectPageSink(ROOT::DescriptorId_t fieldId, ROOT::Internal::RPageSink &pageSink, ROOT::NTupleSize_t firstElementIndex=0U)
Connect the column to a page sink.
void Append(const void *from)
ROOT::NTupleSize_t fInitialNElements
The initial number of elements in a page.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
ROOT::NTupleSize_t GetIndexInCluster() const
ROOT::DescriptorId_t GetClusterId() const
std::size_t GetMaxUnzippedPageSize() const
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId
The column team is a set of columns that serve the same column index for different representation IDs...
std::size_t fLastGoodTeamIdx
std::vector< RReadColumn * > fMembers