Logo ROOT  
Reference Guide
RNTupleOptions.cxx
Go to the documentation of this file.
1/// \file RNTupleOptions.cxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2021-07-28
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-2021, 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
23void EnsureValidTunables(std::size_t zippedClusterSize, std::size_t unzippedClusterSize, std::size_t unzippedPageSize)
24{
25 using RException = ROOT::Experimental::RException;
26 if (zippedClusterSize == 0) {
27 throw RException(R__FAIL("invalid target cluster size: 0"));
28 }
29 if (unzippedPageSize == 0) {
30 throw RException(R__FAIL("invalid target page size: 0"));
31 }
32 if (zippedClusterSize > unzippedClusterSize) {
33 throw RException(R__FAIL("compressed target cluster size must not be larger than "
34 "maximum uncompressed cluster size"));
35 }
36 if (unzippedPageSize > unzippedClusterSize) {
37 throw RException(R__FAIL("target page size must not be larger than "
38 "maximum uncompressed cluster size"));
39 }
40}
41
42} // anonymous namespace
43
44std::unique_ptr<ROOT::Experimental::RNTupleWriteOptions>
46{
47 return std::make_unique<RNTupleWriteOptions>(*this);
48}
49
51{
52 EnsureValidTunables(val, fMaxUnzippedClusterSize, fApproxUnzippedPageSize);
53 fApproxZippedClusterSize = val;
54}
55
57{
58 EnsureValidTunables(fApproxZippedClusterSize, val, fApproxUnzippedPageSize);
59 fMaxUnzippedClusterSize = val;
60}
61
63{
64 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val);
65 fApproxUnzippedPageSize = val;
66}
#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:291
Base class for all ROOT issued exceptions.
Definition: RError.hxx:114
void SetApproxZippedClusterSize(std::size_t val)
virtual std::unique_ptr< RNTupleWriteOptions > Clone() const
void SetApproxUnzippedPageSize(std::size_t val)
void SetMaxUnzippedClusterSize(std::size_t val)