26 const std::string& machineID_)
27 : globalCommandController(globalCommandController_)
29 , motherboard(motherboard_)
30 , msxEventDistributor(msxEventDistributor_)
31 , machineID(machineID_)
35 machineInfoCommand = make_unique<InfoCommand>(*
this,
"machine_info");
36 machineInfoCommand->setAllowedInEmptyMachine(
true);
45 machineInfoCommand.reset();
48 for (
auto& p : commandMap) {
49 std::cout <<
"Command not unregistered: " << p.first() << std::endl;
51 for (
auto& p : settingMap) {
52 std::cout <<
"Setting not unregistered: " << p.first() << std::endl;
54 assert(commandMap.empty());
55 assert(settingMap.empty());
63 return globalCommandController;
68 return *machineInfoCommand;
76 string MSXCommandController::getFullName(
string_ref name)
78 return "::" + machineID +
"::" + name;
84 commandMap[str] = &command;
86 string fullname = getFullName(str);
96 commandMap.
erase(str);
99 string fullname = getFullName(str);
106 string fullname = getFullName(str);
113 string fullname = getFullName(str);
119 const string& name = setting.
getName();
121 settingMap[name] = &setting;
124 string fullname = getFullName(name);
132 const string& name = setting.
getName();
134 settingMap.
erase(name);
137 string fullname = getFullName(name);
145 string fullname = getFullName(setting.
getName());
151 auto it = commandMap.
find(name);
152 return (it != commandMap.
end()) ? it->
second :
nullptr;
157 auto it = settingMap.
find(name);
158 return (it != settingMap.
end()) ? it->
second :
nullptr;
174 return globalCommandController.
executeCommand(command, connection);
179 return globalCommandController.
splitList(list);
187 void MSXCommandController::signalEvent(
193 for (
auto& p : settingMap) {
196 }
catch (MSXException&) {
209 for (
auto& p : settingMap) {
210 if (
auto* fromSetting = from.
findSetting(p.first())) {
211 if (!fromSetting->needTransfer())
continue;