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