Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RNTupleExporter.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleExporter.hxx
2/// \author Giacomo Parolini <giacomo.parolini@cern.ch>
3/// \date 2024-12-10
4/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
5/// is welcome!
6
7/*************************************************************************
8 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
9 * All rights reserved. *
10 * *
11 * For the licensing terms see $ROOTSYS/LICENSE. *
12 * For the list of contributors see $ROOTSYS/README/CREDITS. *
13 *************************************************************************/
14
15#ifndef ROOT7_RNTupleExporter
16#define ROOT7_RNTupleExporter
17
18#include <ROOT/RNTupleTypes.hxx>
19
20#include <cstdint>
21#include <string>
22#include <vector>
23#include <unordered_set>
24
25namespace ROOT::Internal {
26class RPageSource;
27}
28
30
32public:
33 enum class EFilterType {
34 /// Don't export items contained in the filter's set
36 /// Export only items contained in the filter's set
38 };
39
40 template <typename T>
41 struct RFilter {
42 std::unordered_set<T> fSet;
44 };
45
48 kNone = 0x0,
50 /// If enabled, the exporter will report the current progress on the stderr
52 /// If enabled, uncompress (but don't unpack) the page (mutually exclusive with kIncludeChecksums)
54
56 };
57
58 std::string fOutputPath;
59 std::uint64_t fFlags;
60
61 /// Optional filter that determines which columns are included or excluded from being exported.
62 /// By default, export all columns. If you only want to include certain column types, add them
63 /// to `fColumnTypeFilter.fSet` and change `fColumnTypeFilter.fType` to kWhitelist.
65
67 };
68
69 struct RPagesResult {
70 std::vector<std::string> fExportedFileNames;
71 };
72
73 /// Given a page source, writes all its pages to individual files (1 per page).
74 /// If the source is not already attached, it will be attached by this process.
75 static RPagesResult ExportPages(ROOT::Internal::RPageSource &source, const RPagesOptions &options = {});
76};
77
78} // namespace ROOT::Experimental::Internal
79
80#endif
@ kWhitelist
Export only items contained in the filter's set.
@ kBlacklist
Don't export items contained in the filter's set.
static RPagesResult ExportPages(ROOT::Internal::RPageSource &source, const RPagesOptions &options={})
Given a page source, writes all its pages to individual files (1 per page).
Abstract interface to read data from an ntuple.
RFilter< ENTupleColumnType > fColumnTypeFilter
Optional filter that determines which columns are included or excluded from being exported.
@ kDecompress
If enabled, uncompress (but don't unpack) the page (mutually exclusive with kIncludeChecksums).
@ kShowProgressBar
If enabled, the exporter will report the current progress on the stderr.