Logo ROOT   6.18/05
Reference Guide
RColumn.cxx
Go to the documentation of this file.
1/// \file RColumn.cxx
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#include <ROOT/RColumn.hxx>
17#include <ROOT/RColumnModel.hxx>
18#include <ROOT/RPagePool.hxx>
19#include <ROOT/RPageStorage.hxx>
20
21#include <TError.h>
22
23
25 : fModel(model), fPageSink(nullptr), fPageSource(nullptr), fHeadPage(), fNElements(0),
26 fCurrentPage(),
27 fColumnIdSource(kInvalidColumnId),
28 fOffsetColumn(nullptr)
29{
30}
31
33{
34 switch (pageStorage->GetType()) {
36 fPageSink = static_cast<RPageSink*>(pageStorage); // the page sink initializes fHeadPage on AddColumn
37 fHandleSink = fPageSink->AddColumn(this);
38 fHeadPage = fPageSink->GetPagePool()->ReservePage(this);
39 break;
41 fPageSource = static_cast<RPageSource*>(pageStorage);
42 fHandleSource = fPageSource->AddColumn(this);
43 fNElements = fPageSource->GetNElements(fHandleSource);
44 fColumnIdSource = fPageSource->GetColumnId(fHandleSource);
45 break;
46 default:
47 R__ASSERT(false);
48 }
49}
50
52{
53 if (fHeadPage.GetSize() == 0) return;
54
55 fPageSink->CommitPage(fHandleSink, fHeadPage);
56 fHeadPage.Reset(fNElements);
57}
58
60{
61 fPageSource->GetPagePool()->ReleasePage(fCurrentPage);
62 fCurrentPage = fPageSource->GetPagePool()->GetPage(this, index);
63}
#define R__ASSERT(e)
Definition: TError.h:96
void MapPage(const NTupleSize_t index)
Definition: RColumn.cxx:59
RColumn(const RColumnModel &model)
Definition: RColumn.cxx:24
void Connect(RPageStorage *pageStorage)
Definition: RColumn.cxx:32
Abstract interface to write data into a tree.
Abstract interface to read data from a tree.
Manages tree meta-data, which is common for sinks and sources.
virtual EPageStorageType GetType()=0
virtual ColumnHandle_t AddColumn(RColumn *column)=0
Register a new column.
Holds the static meta-data of a column in a tree.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Definition: RNTupleUtil.hxx:44
constexpr ColumnId_t kInvalidColumnId
Definition: RNTupleUtil.hxx:62