openMSX
commands
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
14
class
TclCallback
15
{
16
public
:
17
friend
class
TclCallbackMessages
;
18
19
TclCallback
(
CommandController
& controller,
20
std::string_view name,
21
static_string_view
description,
22
std::string_view defaultValue,
23
Setting::Save
saveSetting,
24
bool
isMessageCallback =
false
);
25
explicit
TclCallback
(
StringSetting
&
setting
);
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
36
private
:
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
setting
BaseSetting * setting
Definition
Interpreter.cc:32
StringSetting.hh
TclObject.hh
openmsx::CommandController
Definition
CommandController.hh:19
openmsx::Setting::Save
Save
Definition
Setting.hh:120
openmsx::StringSetting
Definition
StringSetting.hh:9
openmsx::TclCallbackMessages
Definition
TclCallbackMessages.hh:13
openmsx::TclCallback
Definition
TclCallback.hh:15
openmsx::TclCallback::getValue
TclObject getValue() const
Definition
TclCallback.cc:34
openmsx::TclCallback::execute
TclObject execute() const
Definition
TclCallback.cc:39
openmsx::TclCallback::getSetting
StringSetting & getSetting() const
Definition
TclCallback.hh:34
openmsx::TclObject
Definition
TclObject.hh:27
static_string_view
static_string_view
Definition
static_string_view.hh:28
openmsx
This file implemented 3 utility functions:
Definition
Autofire.cc:11
static_string_view.hh
Generated on Wed Sep 11 2024 21:13:36 for openMSX by
1.9.8