24 void BookPar(
const TString &name,
const T &value);
26 T
GetPar(
const TString &name,
bool *doexist =
nullptr)
const;
27 std::shared_ptr<MSGTool>
MSGUser()
const;
28 void SetMSG(std::shared_ptr<MSGTool> MSG);
35 mutable std::shared_ptr<MSGTool>
msg =
nullptr;
37 void BookParFile(
const TString &name,
const T &value);
39 std::string
Exec(std::string command);
65 static_assert(!std::is_pointer<T>::value,
"class ConfigTool : Can not book parameter in pointer type");
66 static_assert(std::is_default_constructible<T>::value,
"class ConfigTool : Can not book parameter in not_default_constructible type");
68 std::any temp = std::make_any<T>(value);
71 MSGUser()->StartTitle(
"ConfigTool::BookPar");
78 ParMap.insert(std::pair<TString, std::any>(name, temp));
89 static_assert(!std::is_pointer<T>::value,
"class ConfigTool : Can not book parameter in pointer type");
90 static_assert(std::is_default_constructible<T>::value,
"class ConfigTool : Can not book parameter in not_default_constructible type");
92 std::any temp = std::make_any<T>(value);
95 MSGUser()->StartTitle(
"ConfigTool::BookPar");
102 ParMapFile.insert(std::pair<TString, std::any>(name, temp));
131 static_assert(std::is_default_constructible<T>::value,
"class ConfigTool : Can not get parameter in no_default_constructible type");
132 auto re =
ParMap.find(name);
138 auto par = std::any_cast<T>(reF->second);
139 if (doexist !=
nullptr)
143 catch (
const std::bad_any_cast &e)
145 MSGUser()->StartTitle(
"ConfigTool::GetPar");
151 else if (re !=
ParMap.end())
155 auto par = std::any_cast<T>(re->second);
156 if (doexist !=
nullptr)
160 catch (
const std::bad_any_cast &e)
162 MSGUser()->StartTitle(
"ConfigTool::GetPar");
170 MSGUser()->StartTitle(
"ConfigTool::GetPar");
173 if (doexist !=
nullptr)