The Gaudi Framework  v36r1 (3e2fb5a8)
RootHistCnv::RootCompressionSettings Class Reference

#include </builds/gaudi/Gaudi/RootHistCnv/src/RootCompressionSettings.h>

Public Member Functions

 RootCompressionSettings (const std::string &settings)
 Standard constructor. More...
 
int level () const
 Get the level. More...
 

Private Attributes

int m_level
 The cached ROOT compression level int. More...
 

Detailed Description

Simple class to decode a ROOT compression settings string, of the form '<Alg>:<level>' into the integer code to pass to ROOT.

Author
Chris Jones
Date
2013-10-24

Definition at line 29 of file RootCompressionSettings.h.

Constructor & Destructor Documentation

◆ RootCompressionSettings()

RootHistCnv::RootCompressionSettings::RootCompressionSettings ( const std::string settings)

Standard constructor.

Definition at line 29 of file RootCompressionSettings.cpp.

30  : m_level( ROOT::CompressionSettings( ROOT::kZLIB, 1 ) ) {
31  const std::string::size_type idx = settings.find( ':' );
32  if ( idx != std::string::npos ) {
33  // Get compression algorithm type
34  const std::string alg = settings.substr( 0, idx );
35  ROOT::ECompressionAlgorithm alg_code = ROOT::kUseGlobalSetting;
36  if ( alg == "ZLIB" ) {
37  alg_code = ROOT::kZLIB;
38  } else if ( alg == "LZMA" ) {
39  alg_code = ROOT::kLZMA;
40  } else {
41  throw std::runtime_error( "ERROR: Unknown ROOT compression algorithm:" + alg );
42  }
43 
44  // get compression level
45  const std::string slev = settings.substr( idx + 1 );
46  const int ilev = std::stoi( slev );
47 
48  // set the level
49  m_level = ROOT::CompressionSettings( alg_code, ilev );
50  }
51 }

Member Function Documentation

◆ level()

int RootHistCnv::RootCompressionSettings::level ( ) const
inline

Get the level.

Definition at line 38 of file RootCompressionSettings.h.

38 { return m_level; }

Member Data Documentation

◆ m_level

int RootHistCnv::RootCompressionSettings::m_level
private

The cached ROOT compression level int.

Definition at line 31 of file RootCompressionSettings.h.


The documentation for this class was generated from the following files:
std::string
STL class.
std::string::find
T find(T... args)
RootHistCnv::RootCompressionSettings::m_level
int m_level
The cached ROOT compression level int.
Definition: RootCompressionSettings.h:31
basic.alg
alg
Definition: basic.py:15
std::stoi
T stoi(T... args)
std::runtime_error
STL class.
std::string::substr
T substr(T... args)