#include <Config.hpp>
Public Member Functions | |
| Config (const std::string &name) | |
| virtual | ~Config () |
| void | set (const std::string &key, const std::string &value) |
| Set/Override an entry in the configuration database. | |
| void | dumpConfig (std::ostream &stream) |
| Dump config DB to given output stream. | |
| void | dumpConfig (TDirectory *const dir, std::string const name="configDB") |
| Dump config DB to given TDirector. | |
Accessor | |
Return the default value if the parameter isn't set | |
| std::string | get (const std::string &key, const std::string &def) |
| Get string value from config DB. | |
| int | get (const std::string &key, int def) |
| Get integer value from config DB. | |
| double | get (const std::string &key, double def) |
| Get floating point value from config DB. | |
| std::vector< std::string > | getVString (const std::string &key, const std::string &delim="") |
| Get list of strings of config DB. | |
| std::vector< float > | getVFloat (const std::string &key, const std::string &delim="") |
| Get list of floats from config DB. | |
| std::vector< int > | getVInt (const std::string &key, const std::string &delim="") |
| Get list of integers from config DB. | |
Static Private Member Functions | |
| TEnv & | getEnv () |
Private Attributes | |
| std::string | _name |
To use it, just instantiate an object of this type. All lookups will be prepended with the 'name' given.
Config config("MyTest"); std::string value = config.get("MyValue","MyDefault");
will look up 'Mytest.MyValue: ...' in the configuration file.
The configuration file is searched in the following places:
Definition at line 35 of file Config.hpp.
|
|
Definition at line 20 of file Config.cpp. |
|
|
Definition at line 24 of file Config.cpp. |
|
||||||||||||
|
Dump config DB to given TDirector.
Definition at line 109 of file Config.cpp. References getEnv(). |
|
|
Dump config DB to given output stream.
Definition at line 94 of file Config.cpp. References getEnv(). Referenced by cafe::ConfigDumper::begin(), and cafe::ConfigDumper::finish(). |
|
||||||||||||
|
Get floating point value from config DB.
Definition at line 37 of file Config.cpp. |
|
||||||||||||
|
Get integer value from config DB.
Definition at line 32 of file Config.cpp. |
|
||||||||||||
|
|
Definition at line 141 of file Config.cpp. References cafe::_cleanup. Referenced by dumpConfig(), get(), and set(). |
|
||||||||||||
|
Get list of floats from config DB.
Definition at line 59 of file Config.cpp. References get(). |
|
||||||||||||
|
Get list of integers from config DB.
Definition at line 74 of file Config.cpp. References get(). |
|
||||||||||||
|
Get list of strings of config DB.
Definition at line 42 of file Config.cpp. References get(). Referenced by cafe::BadLBNs::BadLBNs(), cafe::Stat::begin(), cafe::Controller::Controller(), cafe::EventFlags::EventFlags(), cafe::EventList::EventList(), cafe::GoodRuns::GoodRuns(), cafe::Hist1D::Hist1D(), cafe::Hist2D::Hist2D(), cafe::Hist3D::Hist3D(), cafe::Permute::Permute(), cafe::Plugins::Plugins(), caf_util::ReComputeMET::ReComputeMET(), cafe::RunController::RunController(), cafe::Select::Select(), cafe::SelectUserObjects< T >::SelectUserObjects(), cafe::Trigger::Trigger(), and cafe::Write::Write(). |
|
||||||||||||
|
Set/Override an entry in the configuration database.
Definition at line 89 of file Config.cpp. References getEnv(). Referenced by cafe::Permute::Permute(). |
|
|
Definition at line 75 of file Config.hpp. Referenced by get(). |
1.3.4