15 std::string_view name,
17 std::string_view defaultValue,
19 bool isMessageCallback_)
20 : callbackSetting2(
std::in_place,
21 controller, name, description, defaultValue,
23 , callbackSetting(*callbackSetting2)
24 , isMessageCallback(isMessageCallback_)
30 , isMessageCallback(false)
42 if (callback.empty())
return {};
45 return executeCommon(command);
51 if (callback.empty())
return {};
54 return executeCommon(command);
60 if (callback.empty())
return {};
63 return executeCommon(command);
69 if (callback.empty())
return {};
72 return executeCommon(command);
78 if (callback.empty())
return {};
81 return executeCommon(command);
88 }
catch (CommandException& e) {
90 "Error executing callback function \"",
91 getSetting().getFullName(),
"\": ", e.getMessage());
93 if (!isMessageCallback) {
96 if (checked_cast<GlobalCommandController&>(commandController).getReactor().isFullyStarted()) {
97 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::Save saveSetting, bool isMessageCallback=false)
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)