NAGASH 0.9.8
Next Generation Analysis System
|
provide interface to config objects in NAGASH. More...
#include "NAGASH/ConfigTool.h"
Public Member Functions | |
ConfigTool () | |
ConfigTool (ConfigTool &&c)=default | |
ConfigTool (const char *inputfilename) | |
Constructor. | |
ConfigTool (const ConfigTool &c)=default | |
template<typename T > | |
void | BookPar (const TString &name, const T &value) |
Book parameter with given name and value. | |
template<class T > | |
T | GetPar (const TString &name, bool *doexist=nullptr) const |
Get the parameter with given name and type. | |
std::shared_ptr< MSGTool > | MSGUser () const |
Get the MSGTool pointer. | |
ConfigTool & | operator= (ConfigTool &&c)=default |
ConfigTool & | operator= (const ConfigTool &c)=default |
void | RemovePar (const TString &name) |
Remove the parameter with given name. | |
void | SetMSG (std::shared_ptr< MSGTool > MSG) |
Set the MSGTool. | |
Private Member Functions | |
template<typename T > | |
void | BookParFile (const TString &name, const T &value) |
Book parameter from input file. | |
std::string | Exec (std::string command) |
void | ReadConfigFromFile (const TString &filename) |
Read config info from given file. | |
Private Attributes | |
std::vector< TString > | InputMD5Sum |
std::shared_ptr< MSGTool > | msg = nullptr |
std::map< TString, std::any > | ParMap |
std::map< TString, std::any > | ParMapFile |
provide interface to config objects in NAGASH.
This class is intended to book and get parameters as well as read parameters from outside config file. Also, this class maintains a MSGTool so that after reading the input config file, correct MSGTool can be constructed (output level, log file name, etc).
This tool can read config info from given config file. The config file should be organized like following:
After construction, parameters can be get by GetPar() method.
Definition at line 13 of file ConfigTool.h.
|
inline |
Definition at line 16 of file ConfigTool.h.
ConfigTool::ConfigTool | ( | const char * | inputfilename | ) |
Constructor.
inputfilename | name of the config file. |
Definition at line 47 of file ConfigTool.cxx.
|
default |
|
default |
|
inline |
Book parameter with given name and value.
T | type of the parameter. |
name | name of the parameter. |
value | value of the parameter. |
Definition at line 63 of file ConfigTool.h.
|
inlineprivate |
Book parameter from input file.
T | type of the parameter. |
name | name of the parameter. |
value | value of the parameter. |
Definition at line 87 of file ConfigTool.h.
|
private |
Definition at line 274 of file ConfigTool.cxx.
|
inline |
Get the parameter with given name and type.
For parameters read from config file, you should get them like :
T | the type of the parameter. |
[in] | name | the name of the parameter. |
[out] | doexist | the parameter exist or not. |
Definition at line 129 of file ConfigTool.h.
|
inline |
|
default |
|
default |
|
private |
Read config info from given file.
filename | input file name |
Definition at line 107 of file ConfigTool.cxx.
|
inline |
Remove the parameter with given name.
name | the name of the parameter to be removed. |
Definition at line 52 of file ConfigTool.h.
|
inline |
Set the MSGTool.
MSG | input pointer of MSGTool. |
Definition at line 48 of file ConfigTool.h.
|
private |
Definition at line 34 of file ConfigTool.h.
|
mutableprivate |
Definition at line 35 of file ConfigTool.h.
|
private |
Definition at line 32 of file ConfigTool.h.
|
private |
Definition at line 33 of file ConfigTool.h.