12 std::string_view name,
14 std::string_view defaultValue,
17 : callbackSetting2(
std::in_place,
18 controller, name, description, defaultValue,
20 , callbackSetting(*callbackSetting2)
21 , useCliComm(useCliComm_)
39 if (callback.empty())
return {};
42 return executeCommon(command);
48 if (callback.empty())
return {};
51 return executeCommon(command);
57 if (callback.empty())
return {};
60 return executeCommon(command);
66 if (callback.empty())
return {};
69 return executeCommon(command);
75 if (callback.empty())
return {};
78 return executeCommon(command);
85 }
catch (CommandException&
e) {
87 "Error executing callback function \"",
88 getSetting().getFullName(),
"\": ",
e.getMessage());
93 std::cerr << message <<
'\n';
void printWarning(std::string_view message)
virtual CliComm & getCliComm()=0
CommandController & getCommandController() const
Interpreter & getInterpreter() const
const TclObject & getValue() const final
Gets the current value of this setting as a TclObject.
TclObject getValue() const
TclObject execute() const
TclCallback(CommandController &controller, std::string_view name, static_string_view description, std::string_view defaultValue, Setting::SaveSetting saveSetting, bool useCliComm=true)
StringSetting & getSetting() const
TclObject executeCommand(Interpreter &interp, bool compile=false)
Interpret this TclObject as a command and execute it.
This file implemented 3 utility functions:
TclObject makeTclList(Args &&... args)
std::string strCat(Ts &&...ts)