MarlinMT  0.1.0
marlinmt::ConfigHelper Class Reference

ConfigHelper class A simple class with helper methods for configuration. More...

#include <Configuration.h>

Static Public Member Functions

static std::pair< std::string, std::string > splitPluginInput (const std::string &str)
 Split the string to a pair "plugin, input". More...
 
static void readConfig (const std::string &str, Configuration &cfg)
 Read the configuration using a ConfigReader plugin. More...
 
static void writeConfig (const std::string &str, Configuration &cfg)
 Write the configuration using a ConfigWriter plugin. More...
 

Private Member Functions

 ConfigHelper ()=delete
 
 ~ConfigHelper ()=delete
 

Detailed Description

ConfigHelper class A simple class with helper methods for configuration.

Definition at line 386 of file Configuration.h.

Constructor & Destructor Documentation

◆ ConfigHelper()

marlinmt::ConfigHelper::ConfigHelper ( )
privatedelete

◆ ~ConfigHelper()

marlinmt::ConfigHelper::~ConfigHelper ( )
privatedelete

Member Function Documentation

◆ readConfig()

void marlinmt::ConfigHelper::readConfig ( const std::string &  str,
Configuration cfg 
)
static

Read the configuration using a ConfigReader plugin.

Parameters
strthe reader descriptor (file name, database config, ...)
cfgthe configuration object to populate

Definition at line 221 of file Configuration.cc.

References marlinmt::PluginManager::create(), marlinmt::PluginManager::instance(), MARLINMT_THROW, and splitPluginInput().

◆ splitPluginInput()

std::pair< std::string, std::string > marlinmt::ConfigHelper::splitPluginInput ( const std::string &  str)
static

Split the string to a pair "plugin, input".

The separator is a colon ':' character. For example:

  • "XMLConfigReader:/path/to/myfile.xml"
  • "XMLConfigWriter:/path/to/myfile.xml"
Parameters
strthe input string to split

Definition at line 214 of file Configuration.cc.

Referenced by readConfig(), and writeConfig().

◆ writeConfig()

void marlinmt::ConfigHelper::writeConfig ( const std::string &  str,
Configuration cfg 
)
static

Write the configuration using a ConfigWriter plugin.

Parameters
strthe writer descriptor (file name, database config, ...)
cfgthe configuration object to write

Definition at line 243 of file Configuration.cc.

References marlinmt::PluginManager::create(), marlinmt::PluginManager::instance(), MARLINMT_THROW, and splitPluginInput().


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