Logo ROOT  
Reference Guide
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);

The method TTree::SetIOFeatures creates a copy of the feature set; subsequent changes to the TIOFeatures object do not propogate 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. More...
 
void Clear (Experimental::EIOFeatures bits)
 Clear a specific IO feature from this set. More...
 
void Clear (Experimental::EIOUnsupportedFeatures bits)
 Clear a specific IO feature from this set. More...
 
void Print () const
 Print a human-readable representation of the TIOFeatures to stdout. More...
 
bool Set (const std::string &)
 Given a IO feature string, set the corresponding feature. More...
 
bool Set (EIOFeatures bits)
 Set a specific IO feature. More...
 
bool Set (Experimental::EIOFeatures bits)
 Set a specific IO feature. More...
 
bool Test (EIOFeatures bits) const
 Test to see if a given feature is set. More...
 
bool Test (Experimental::EIOFeatures bits) const
 Test to see if a given feature is set. More...
 
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]enum_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]enum_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]enum_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 kTRUE only if a new feature was set; otherwise emits an error message and returns kFALSE.

Definition at line 172 of file TIOFeatures.cxx.

◆ Set() [2/4]

bool TIOFeatures::Set ( EIOFeatures  input_bits)

Set a specific IO feature.

Parameters
[in]enum_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 kTRUE; otherwise, it returns kFALSE.

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]enum_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 kTRUE; otherwise, it returns kFALSE.

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]enum_bitsThe specific feature to test.

Returns kTRUE 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]enum_bitsThe specific feature to test.

Returns kTRUE 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 Function 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:
[legend]

The documentation for this class was generated from the following files:
ROOT::TIOFeatures
Definition: TIOFeatures.hxx:69
ROOT::Experimental::EIOFeatures::kGenerateOffsetMap
@ kGenerateOffsetMap
ROOT::TIOFeatures::Set
bool Set(EIOFeatures bits)
Set a specific IO feature.
Definition: TIOFeatures.cxx:139