Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TIOFeatures.hxx
Go to the documentation of this file.
1// Author: Brian Bockelman UNL 09/2017
2
3/*************************************************************************
4 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_TIO_FEATURES
12#define ROOT_TIO_FEATURES
13
14#include "Rtypes.h"
15
16class TBasket;
17class TBranch;
18class TTree;
19
20// keep it here to have a note that was removed
21// #ifndef R__LESS_INCLUDES
22// #include "TBasket.h"
23// #include <memory>
24// #include <sstream>
25// #include <initializer_list>
26// #include <typeinfo>
27// #include <type_traits> // is_same, enable_if
28// #endif
29
30namespace ROOT {
31
32
33// These are the known, supported, and enabled-by-default features for ROOT IO.
34//
35// Note that the `kSupported` members for EIOFeatures, Experimental::EIOFeatures, and
36// Experiment::EIOUnsupportedFeatures should have no intersection and a union of equal
37// to BITS(kIOFeatureCount).
38//
39enum class EIOFeatures {
40 kSupported = 0 // Union of all known, supported, and enabled-by-default features (currently none).
41};
42
43
44namespace Experimental {
45
46// These are the known and supported "experimental" features, not enabled by default.
47// When these are enabled by default, they will move to `ROOT::EIOFeatures`.
48//
49// Note that these all show up in TBasket::EIOBits, but it is desired to have the enum be at
50// the "ROOT-IO-wide" level and not restricted to TBasket -- even if all the currently-foreseen
51// usage of this mechanism somehow involves baskets currently.
52enum class EIOFeatures {
54 kSupported = kGenerateOffsetMap // Union of all features in this enum.
55};
56
57
58// These are previous experimental features that are not supported in this series.
59// NOTE: the intent is that there is never an IO feature that goes into the ROOT:: namespace
60// but is unsupported.
62 kUnsupported = 0 // Union of all features in this enum.
63};
64
65
66} // namespace Experimental
67
68
70friend class ::TTree;
71friend class ::TBranch;
72friend class ::TBasket;
73
74public:
76
77 void Clear(EIOFeatures bits);
80 bool Set(EIOFeatures bits);
82 bool Set(const std::string &);
83 bool Test(EIOFeatures bits) const;
84 bool Test(Experimental::EIOFeatures bits) const;
86 void Print() const;
87
88 // The number of known, defined IO features (supported / unsupported / experimental).
89 static constexpr int kIOFeatureCount = 1;
90
91private:
92 // These methods allow access to the raw bitset underlying
93 // this object, breaking type safety. They are necessary for
94 // efficient interaction with TTree / TBranch / TBasket, but left
95 // private to prevent users from interacting with the raw bits.
96 TIOFeatures(UChar_t IOBits) : fIOBits(IOBits) {}
97 UChar_t GetFeatures() const;
98 void Set(UChar_t newBits) {fIOBits = newBits;}
99
101};
102
103} // namespace ROOT
104
105#endif // ROOT_TIO_FEATURES
unsigned char UChar_t
Definition RtypesCore.h:38
#define BIT(n)
Definition Rtypes.h:85
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
UChar_t GetFeatures() const
TIOFeatures(UChar_t IOBits)
bool Test(Experimental::EIOUnsupportedFeatures bits) const
void Print() const
Print a human-readable representation of the TIOFeatures to stdout.
bool Set(EIOFeatures bits)
Set a specific IO feature.
bool Test(EIOFeatures bits) const
Test to see if a given feature is set.
void Clear(EIOFeatures bits)
Clear a specific IO feature from this set.
static constexpr int kIOFeatureCount
void Set(UChar_t newBits)
Manages buffers for branches of a Tree.
Definition TBasket.h:34
A TTree is a list of TBranches.
Definition TBranch.h:93
A TTree represents a columnar dataset.
Definition TTree.h:79
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.