2#include <libconfig.h++>
8const char*
const none =
"\033[0m";
9const char*
const redL =
"\033[1;31m";
18bool GetParam(
const libconfig::Setting& confObj, A& param,
const std::string& name)
noexcept(
false)
20 if (!confObj.lookupValue(name, param)){
21 std::cerr <<
tc::redL <<
"GetParam() Error: <" << name <<
"> lookup failed." <<
tc::none << std::endl;
30bool GetParam(
const libconfig::Config& confObj, A& param,
const std::string& name)
noexcept(
false)
32 if (!confObj.lookupValue(name, param)){
33 std::cerr <<
tc::redL <<
"GetParam() Error: <" << name <<
"> lookup failed." <<
tc::none << std::endl;
46bool GetParamVector(
const libconfig::Setting& confObj, A& param,
const std::string& name)
noexcept(
false)
49 const libconfig::Setting& settings = confObj.lookup(name);
50 param.resize(settings.getLength());
51 for (
int n = 0; n < settings.getLength(); n++) {
53 param(n) = settings[n];
55 }
catch (
const libconfig::SettingNotFoundException) {
56 std::cerr <<
tc::redL <<
"GetParamVector() Error: <" << name <<
"> lookup failed." << std::endl;
65bool GetParamVector(
const libconfig::Config& confObj, A& param,
const std::string& name)
noexcept(
false)
68 const libconfig::Setting& settings = confObj.lookup(name);
69 param.resize(settings.getLength());
70 for (
int n = 0; n < settings.getLength(); n++) {
72 param(n) = settings[n];
74 }
catch (
const libconfig::SettingNotFoundException) {
75 std::cerr <<
tc::redL <<
"GetParamVector() Error: <" << name <<
"> lookup failed." << std::endl;
const char *const redL
Definition ConfHelpers.h:9
const char *const none
Definition ConfHelpers.h:8
bool GetParam(const libconfig::Setting &confObj, A ¶m, const std::string &name) noexcept(false)
SetParam functor.
Definition ConfHelpers.h:18
bool GetParamVector(const libconfig::Setting &confObj, A ¶m, const std::string &name) noexcept(false)
SetParam functor.
Definition ConfHelpers.h:46