Logo ROOT   6.12/07
Reference Guide
List of all members | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
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 62 of file TIOFeatures.hxx.

Public Member Functions

 TIOFeatures ()
 
void Clear (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 Clear (Experimental::EIOFeatures 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 (EIOFeatures bits)
 Set a specific IO feature. More...
 
bool Set (Experimental::EIOFeatures bits)
 Set a specific IO feature. More...
 
bool Set (const std::string &)
 Given a IO feature string, set the corresponding 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 68 of file TIOFeatures.hxx.

◆ TIOFeatures() [2/2]

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

Definition at line 89 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 78 of file TIOFeatures.cxx.

◆ Clear() [2/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 67 of file TIOFeatures.cxx.

◆ Clear() [3/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 56 of file TIOFeatures.cxx.

◆ GetFeatures()

UChar_t TIOFeatures::GetFeatures ( ) const
private

Definition at line 248 of file TIOFeatures.cxx.

◆ Print()

void TIOFeatures::Print ( void  ) 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 195 of file TIOFeatures.cxx.

◆ Set() [1/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 137 of file TIOFeatures.cxx.

◆ Set() [2/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 123 of file TIOFeatures.cxx.

◆ Set() [3/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 170 of file TIOFeatures.cxx.

◆ Set() [4/4]

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

Definition at line 91 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 237 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 226 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 65 of file TIOFeatures.hxx.

◆ ::TBranch

friend class ::TBranch
friend

Definition at line 64 of file TIOFeatures.hxx.

◆ ::TTree

friend class ::TTree
friend

Definition at line 63 of file TIOFeatures.hxx.

Member Data Documentation

◆ fIOBits

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

Definition at line 93 of file TIOFeatures.hxx.

◆ kIOFeatureCount

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

Definition at line 82 of file TIOFeatures.hxx.


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