Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleFillStatus.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleFillStatus.hxx
2/// \ingroup NTuple
3/// \author Jonas Hahnfeld <jonas.hahnfeld@cern.ch>
4/// \date 2024-04-15
5
6/*************************************************************************
7 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
8 * All rights reserved. *
9 * *
10 * For the licensing terms see $ROOTSYS/LICENSE. *
11 * For the list of contributors see $ROOTSYS/README/CREDITS. *
12 *************************************************************************/
13
14#ifndef ROOT_RNTupleFillStatus
15#define ROOT_RNTupleFillStatus
16
17#include <ROOT/RNTupleTypes.hxx>
18
19#include <cstddef>
20
21namespace ROOT {
22
23class RNTupleFillContext;
24
25// clang-format off
26/**
27\class ROOT::RNTupleFillStatus
28\ingroup NTuple
29\brief A status object after filling an entry
30
31After passing an instance to RNTupleWriter::FillNoFlush() or RNTupleFillContext::FillNoFlush(), the caller must check
32ShouldFlushCluster() and call RNTupleWriter::FlushCluster() or RNTupleFillContext::FlushCluster() if necessary.
33*/
34// clang-format on
36 friend class RNTupleFillContext;
37
38private:
39 /// Number of entries written into the current cluster
41 /// Number of bytes written into the current cluster
42 std::size_t fUnzippedClusterSize = 0;
43 /// Number of bytes written for the last entry
44 std::size_t fLastEntrySize = 0;
45 bool fShouldFlushCluster = false;
46
47public:
48 /// Return the number of entries written into the current cluster.
50 /// Return the number of bytes written into the current cluster.
51 std::size_t GetUnzippedClusterSize() const { return fUnzippedClusterSize; }
52 /// Return the number of bytes for the last entry.
53 std::size_t GetLastEntrySize() const { return fLastEntrySize; }
54 /// Return true if the caller should call FlushCluster.
55 bool ShouldFlushCluster() const { return fShouldFlushCluster; }
56};
57
58} // namespace ROOT
59
60#endif // ROOT_RNTupleFillStatus
A context for filling entries (data) into clusters of an RNTuple.
A status object after filling an entry.
std::size_t GetUnzippedClusterSize() const
Return the number of bytes written into the current cluster.
ROOT::NTupleSize_t fNEntriesSinceLastFlush
Number of entries written into the current cluster.
ROOT::NTupleSize_t GetNEntries() const
Return the number of entries written into the current cluster.
std::size_t fUnzippedClusterSize
Number of bytes written into the current cluster.
std::size_t fLastEntrySize
Number of bytes written for the last entry.
bool ShouldFlushCluster() const
Return true if the caller should call FlushCluster.
std::size_t GetLastEntrySize() const
Return the number of bytes for the last entry.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.