openMSX
TclCallback.hh
Go to the documentation of this file.
1 #ifndef TCLCALLBACK_HH
2 #define TCLCALLBACK_HH
3 
4 #include "static_string_view.hh"
5 #include "StringSetting.hh"
6 #include "TclObject.hh"
7 #include <optional>
8 #include <string_view>
9 
10 namespace openmsx {
11 
12 class CommandController;
13 
15 {
16 public:
17  TclCallback(CommandController& controller,
18  std::string_view name,
19  static_string_view description,
20  bool useCliComm = true,
21  bool save = true);
23 
25  TclObject execute(int arg1);
26  TclObject execute(int arg1, int arg2);
27  TclObject execute(int arg1, std::string_view arg2);
28  TclObject execute(std::string_view arg1, std::string_view arg2);
29 
30  [[nodiscard]] TclObject getValue() const;
31  [[nodiscard]] StringSetting& getSetting() const { return callbackSetting; }
32 
33 private:
34  TclObject executeCommon(TclObject& command);
35 
36  std::optional<StringSetting> callbackSetting2;
37  StringSetting& callbackSetting;
38  const bool useCliComm;
39 };
40 
41 } // namespace openmsx
42 
43 #endif
BaseSetting * setting
Definition: Interpreter.cc:27
TclObject execute()
Definition: TclCallback.cc:35
TclObject getValue() const
Definition: TclCallback.cc:30
StringSetting & getSetting() const
Definition: TclCallback.hh:31
TclCallback(CommandController &controller, std::string_view name, static_string_view description, bool useCliComm=true, bool save=true)
Definition: TclCallback.cc:10
static_string_view
This file implemented 3 utility functions:
Definition: Autofire.cc:9