Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleWriteOptions.cxx
Go to the documentation of this file.
1/// \file RNTupleWriteOptions.cxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2024-02-22
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-2024, 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/RError.hxx>
18
19#include <utility>
20
21namespace {
22
24 std::size_t initialNElementsPerPage, std::size_t maxUnzippedPageSize)
25{
26 using RException = ROOT::Experimental::RException;
27 if (zippedClusterSize == 0) {
28 throw RException(R__FAIL("invalid target cluster size: 0"));
29 }
30 if (maxUnzippedPageSize == 0) {
31 throw RException(R__FAIL("invalid maximum page size: 0"));
32 }
33 if (initialNElementsPerPage == 0) {
34 throw RException(R__FAIL("invalid initial number of elements per page: 0"));
35 }
37 throw RException(R__FAIL("compressed target cluster size must not be larger than "
38 "maximum uncompressed cluster size"));
39 }
41 throw RException(R__FAIL("maximum page size must not be larger than "
42 "maximum uncompressed cluster size"));
43 }
44}
45
46} // anonymous namespace
47
48std::unique_ptr<ROOT::Experimental::RNTupleWriteOptions> ROOT::Experimental::RNTupleWriteOptions::Clone() const
49{
50 return std::make_unique<RNTupleWriteOptions>(*this);
51}
52
54{
55 EnsureValidTunables(val, fMaxUnzippedClusterSize, fInitialNElementsPerPage, fMaxUnzippedPageSize);
56 fApproxZippedClusterSize = val;
57}
58
60{
61 EnsureValidTunables(fApproxZippedClusterSize, val, fInitialNElementsPerPage, fMaxUnzippedPageSize);
62 fMaxUnzippedClusterSize = val;
63}
64
66{
67 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val, fMaxUnzippedPageSize);
68 fInitialNElementsPerPage = val;
69}
70
72{
73 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, fInitialNElementsPerPage, val);
74 fMaxUnzippedPageSize = val;
75}
76
78{
79 if (fPageBufferBudget != 0)
80 return fPageBufferBudget;
81
82 return GetApproxZippedClusterSize() + (GetCompression() != 0) * GetApproxZippedClusterSize();
83}
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
Definition RError.hxx:290
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
virtual std::unique_ptr< RNTupleWriteOptions > Clone() const