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
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> ROOT::Experimental::RNTupleWriteOptions::Clone() const
45{
46 return std::make_unique<RNTupleWriteOptions>(*this);
47}
48
50{
51 EnsureValidTunables(val, fMaxUnzippedClusterSize, fApproxUnzippedPageSize);
52 fApproxZippedClusterSize = val;
53}
54
56{
57 EnsureValidTunables(fApproxZippedClusterSize, val, fApproxUnzippedPageSize);
58 fMaxUnzippedClusterSize = val;
59}
60
62{
63 EnsureValidTunables(fApproxZippedClusterSize, fMaxUnzippedClusterSize, val);
64 fApproxUnzippedPageSize = val;
65}
#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
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
virtual std::unique_ptr< RNTupleWriteOptions > Clone() const