OXYGENHUB
◆ main openmsx / src / events / MSXCliComm.hh
931 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef MSXCLICOMM_HH
2
#define MSXCLICOMM_HH
3
4
#include "CliComm.hh"
5
6
#include "hash_map.hh"
7
#include "stl.hh"
8
#include "xxhash.hh"
9
10
#include <array>
11
12
namespace openmsx {
13
14
class MSXMotherBoard;
15
class GlobalCliComm;
16
17
class MSXCliComm final : public CliComm
18
{
19
public:
20
	MSXCliComm(MSXMotherBoard& motherBoard, GlobalCliComm& cliComm);
21
22
	void log(LogLevel level, std::string_view message, float fraction) override;
23
	void update(UpdateType type, std::string_view name,
24
	            std::string_view value) override;
25
	void updateFiltered(UpdateType type, std::string_view name,
26
	            std::string_view value) override;
27
28
	// enable/disable message suppression
29
	void setSuppressMessages(bool enable);
30
31
private:
32
	MSXMotherBoard& motherBoard;
33
	GlobalCliComm& cliComm;
34
	array_with_enum_index<CliComm::UpdateType, hash_map<std::string, std::string, XXHasher>> prevValues;
35
	bool suppressMessages = false;
36
};
37
38
} // namespace openmsx
39
40
#endif