openMSX
ImGuiWatchExpr.hh
Go to the documentation of this file.
1#ifndef IMGUI_WATCH_EXPR_HH
2#define IMGUI_WATCH_EXPR_HH
3
4#include "ImGuiPart.hh"
5
6#include "TclObject.hh"
7
8#include <expected>
9#include <vector>
10
11namespace openmsx {
12
13class SymbolManager;
14
15class ImGuiWatchExpr final : public ImGuiPart
16{
17public:
19
20 [[nodiscard]] zstring_view iniName() const override { return "watch expr"; }
21 void save(ImGuiTextBuffer& buf) override;
22 void loadStart() override;
23 void loadLine(std::string_view name, zstring_view value) override;
24 void paint(MSXMotherBoard* motherBoard) override;
25 void refreshSymbols();
26
27private:
28 void drawRow(int row);
29 void checkSort();
30
31public:
32 bool show = false;
33
34private:
35 SymbolManager& symbolManager;
36
37 struct WatchExpr {
38 // added constructors: workaround clang-14 bug(?)
39 WatchExpr() = default;
40 WatchExpr(std::string d, std::string e, TclObject f)
41 : description(std::move(d)), exprStr(std::move(e)), format(std::move(f)) {}
42 std::string description;
43 std::string exprStr;
44 std::optional<TclObject> expression; // cache, generate from 'expression'
46 };
47 std::vector<WatchExpr> watches;
48
49 [[nodiscard]] std::expected<TclObject, std::string> evalExpr(WatchExpr& watch, Interpreter& interp) const;
50
51 int selectedRow = -1;
52
53 static constexpr auto persistentElements = std::tuple{
55 // manually handle 'watches'
56 };
57};
58
59} // namespace openmsx
60
61#endif
ImGuiManager & manager
Definition ImGuiPart.hh:30
void save(ImGuiTextBuffer &buf) override
zstring_view iniName() const override
void loadStart() override
void loadLine(std::string_view name, zstring_view value) override
void paint(MSXMotherBoard *motherBoard) override
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
void format(SectorAccessibleDisk &disk, MSXBootSectorType bootType)
Format the given disk (= a single partition).
This file implemented 3 utility functions:
Definition Autofire.cc:11