Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::TIOFeatures Class Reference

TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TTree.

This class allows access to experimental and non-default features.

When one of these features are activated, forward compatibility breaks may occur. That is, older versions of ROOT may not be able to read files written by this version of ROOT that have enabled these non-default features.

To utilize TIOFeatures, create the object, set the desired feature flags, then attach it to a TTree. All subsequently created branches (and their baskets) will be serialized using those particular features.

Example usage:

ttree_ref.SetIOFeatures(features);
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
bool Set(EIOFeatures bits)
Set a specific IO feature.

The method TTree::SetIOFeatures creates a copy of the feature set; subsequent changes to the TIOFeatures object do not propagate to the TTree.

Definition at line 69 of file TIOFeatures.hxx.

Public Member Functions

 TIOFeatures ()
 
void Clear (EIOFeatures bits)
 Clear a specific IO feature from this set.
 
void Clear (Experimental::EIOFeatures bits)
 Clear a specific IO feature from this set.
 
void Clear (Experimental::EIOUnsupportedFeatures bits)
 Clear a specific IO feature from this set.
 
void Print () const
 Print a human-readable representation of the TIOFeatures to stdout.
 
bool Set (const std::string &)
 Given a IO feature string, set the corresponding feature.
 
bool Set (EIOFeatures bits)
 Set a specific IO feature.
 
bool Set (Experimental::EIOFeatures bits)
 Set a specific IO feature.
 
bool Test (EIOFeatures bits) const
 Test to see if a given feature is set.
 
bool Test (Experimental::EIOFeatures bits) const
 Test to see if a given feature is set.
 
bool Test (Experimental::EIOUnsupportedFeatures bits) const
 

Static Public Attributes

static constexpr int kIOFeatureCount = 1
 

Private Member Functions

 TIOFeatures (UChar_t IOBits)
 
UChar_t GetFeatures () const
 
void Set (UChar_t newBits)
 

Private Attributes

UChar_t fIOBits {0}
 

Friends

class ::TBasket
 
class ::TBranch
 
class ::TTree
 

#include <ROOT/TIOFeatures.hxx>

Constructor & Destructor Documentation

◆ TIOFeatures() [1/2]

ROOT::TIOFeatures::TIOFeatures ( )
inline

Definition at line 75 of file TIOFeatures.hxx.

◆ TIOFeatures() [2/2]

ROOT::TIOFeatures::TIOFeatures ( UChar_t  IOBits)
inlineprivate

Definition at line 96 of file TIOFeatures.hxx.

Member Function Documentation

◆ Clear() [1/3]

void TIOFeatures::Clear ( EIOFeatures  input_bits)

Clear a specific IO feature from this set.

Parameters
[in]input_bitsThe specific feature to disable.

Removes a feature from the TIOFeatures object; emits an Error message if the IO feature is not supported by this version of ROOT.

Definition at line 80 of file TIOFeatures.cxx.

◆ Clear() [2/3]

void TIOFeatures::Clear ( Experimental::EIOFeatures  input_bits)

Clear a specific IO feature from this set.

Parameters
[in]input_bitsThe specific feature to disable.

Removes a feature from the TIOFeatures object; emits an Error message if the IO feature is not supported by this version of ROOT.

Definition at line 58 of file TIOFeatures.cxx.

◆ Clear() [3/3]

void TIOFeatures::Clear ( Experimental::EIOUnsupportedFeatures  input_bits)

Clear a specific IO feature from this set.

Parameters
[in]input_bitsThe specific feature to disable.

Removes a feature from the TIOFeatures object; emits an Error message if the IO feature is not supported by this version of ROOT.

Definition at line 69 of file TIOFeatures.cxx.

◆ GetFeatures()

UChar_t TIOFeatures::GetFeatures ( ) const
private

Definition at line 250 of file TIOFeatures.cxx.

◆ Print()

void TIOFeatures::Print ( ) const

Print a human-readable representation of the TIOFeatures to stdout.

Prints a string with the names of all enabled IO features.

Definition at line 197 of file TIOFeatures.cxx.

◆ Set() [1/4]

bool TIOFeatures::Set ( const std::string &  value)

Given a IO feature string, set the corresponding feature.

Parameters
[in]valueFeature name to test.

This allows one to set a feature given a specific string from the TBasket::EIOBits enum.

NOTE this function is quite slow and users are strongly encouraged to use the type-safe Set version instead. This has been added for better CLI interfaces.

Returns true only if a new feature was set; otherwise emits an error message and returns false.

Definition at line 172 of file TIOFeatures.cxx.

◆ Set() [2/4]

bool TIOFeatures::Set ( EIOFeatures  input_bits)

Set a specific IO feature.

Parameters
[in]input_bitsThe specific feature to enable.

Sets a feature in the TIOFeatures object; emits an Error message if the IO feature is not supported by this version of ROOT.

If the feature is supported by ROOT, this function returns true; otherwise, it returns false.

Definition at line 139 of file TIOFeatures.cxx.

◆ Set() [3/4]

bool TIOFeatures::Set ( Experimental::EIOFeatures  input_bits)

Set a specific IO feature.

Parameters
[in]input_bitsThe specific feature to enable.

Sets a feature in the TIOFeatures object; emits an Error message if the IO feature is not supported by this version of ROOT.

If the feature is supported by ROOT, this function returns true; otherwise, it returns false.

Definition at line 125 of file TIOFeatures.cxx.

◆ Set() [4/4]

void ROOT::TIOFeatures::Set ( UChar_t  newBits)
inlineprivate

Definition at line 98 of file TIOFeatures.hxx.

◆ Test() [1/3]

bool TIOFeatures::Test ( EIOFeatures  input_bits) const

Test to see if a given feature is set.

Parameters
[in]input_bitsThe specific feature to test.

Returns true if the feature is enables in this object and supported by this version of ROOT.

Definition at line 239 of file TIOFeatures.cxx.

◆ Test() [2/3]

bool TIOFeatures::Test ( Experimental::EIOFeatures  input_bits) const

Test to see if a given feature is set.

Parameters
[in]input_bitsThe specific feature to test.

Returns true if the feature is enables in this object and supported by this version of ROOT.

Definition at line 228 of file TIOFeatures.cxx.

◆ Test() [3/3]

bool ROOT::TIOFeatures::Test ( Experimental::EIOUnsupportedFeatures  bits) const

Friends And Related Symbol Documentation

◆ ::TBasket

friend class ::TBasket
friend

Definition at line 72 of file TIOFeatures.hxx.

◆ ::TBranch

friend class ::TBranch
friend

Definition at line 71 of file TIOFeatures.hxx.

◆ ::TTree

friend class ::TTree
friend

Definition at line 70 of file TIOFeatures.hxx.

Member Data Documentation

◆ fIOBits

UChar_t ROOT::TIOFeatures::fIOBits {0}
private

Definition at line 100 of file TIOFeatures.hxx.

◆ kIOFeatureCount

constexpr int ROOT::TIOFeatures::kIOFeatureCount = 1
staticconstexpr

Definition at line 89 of file TIOFeatures.hxx.

Libraries for ROOT::TIOFeatures:

The documentation for this class was generated from the following files: