openMSX
DeviceConfig.cc
Go to the documentation of this file.
1 #include "DeviceConfig.hh"
2 #include "XMLElement.hh"
3 #include "HardwareConfig.hh"
4 #include "MSXMotherBoard.hh"
5 #include "Reactor.hh"
6 
7 namespace openmsx {
8 
10 {
12 }
14 {
16 }
17 
19 {
20  return getMotherBoard().getMSXCliComm();
21 }
23 {
25 }
27 {
28  return getMotherBoard().getScheduler();
29 }
31 {
32  return getMotherBoard().getReactor();
33 }
35 {
36  return getReactor().getGlobalSettings();
37 }
38 
40 {
41  return getXML()->getChild(name);
42 }
43 const std::string& DeviceConfig::getChildData(string_view name) const
44 {
45  return getXML()->getChildData(name);
46 }
48  string_view defaultValue) const
49 {
50  return getXML()->getChildData(name, defaultValue);
51 }
52 int DeviceConfig::getChildDataAsInt(string_view name, int defaultValue) const
53 {
54  return getXML()->getChildDataAsInt(name, defaultValue);
55 }
57  bool defaultValue) const
58 {
59  return getXML()->getChildDataAsBool(name, defaultValue);
60 }
62 {
63  return getXML()->findChild(name);
64 }
65 const std::string& DeviceConfig::getAttribute(string_view attName) const
66 {
67  return getXML()->getAttribute(attName);
68 }
69 int DeviceConfig::getAttributeAsInt(string_view attName, int defaultValue) const
70 {
71  return getXML()->getAttributeAsInt(attName, defaultValue);
72 }
73 
74 } // namespace openmsx
int getChildDataAsInt(string_view name, int defaultValue=0) const
Definition: DeviceConfig.cc:52
Contains the main loop of openMSX.
Definition: Reactor.hh:66
const std::string & getChildData(string_view name) const
Definition: DeviceConfig.cc:43
GlobalSettings & getGlobalSettings() const
Definition: DeviceConfig.cc:34
const XMLElement * findChild(string_view name) const
Definition: DeviceConfig.cc:61
const std::string & getAttribute(string_view attName) const
Definition: DeviceConfig.cc:65
const XMLElement * findChild(string_view name) const
Definition: XMLElement.cc:94
MSXMotherBoard & getMotherBoard() const
const FileContext & getFileContext() const
Definition: DeviceConfig.cc:9
CliComm & getCliComm() const
Definition: DeviceConfig.cc:18
int getAttributeAsInt(string_view attName, int defaultValue=0) const
Definition: XMLElement.cc:234
Reactor & getReactor() const
Definition: DeviceConfig.cc:30
GlobalSettings & getGlobalSettings()
Definition: Reactor.hh:103
const FileContext & getFileContext() const
bool getChildDataAsBool(string_view name, bool defaultValue=false) const
Definition: DeviceConfig.cc:56
int getAttributeAsInt(string_view attName, int defaultValue=0) const
Definition: DeviceConfig.cc:69
CommandController & getCommandController() const
Definition: DeviceConfig.cc:22
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
CommandController & getCommandController()
const std::string & getChildData(string_view name) const
Definition: XMLElement.cc:169
const HardwareConfig & getHardwareConfig() const
Definition: DeviceConfig.hh:42
int getChildDataAsInt(string_view name, int defaultValue=0) const
Definition: XMLElement.cc:187
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
const XMLElement * getXML() const
Definition: DeviceConfig.hh:47
Scheduler & getScheduler() const
Definition: DeviceConfig.cc:26
This class contains settings that are used by several other class (including some singletons)...
bool getChildDataAsBool(string_view name, bool defaultValue=false) const
Definition: XMLElement.cc:181
const std::string & getAttribute(string_view attName) const
Definition: XMLElement.cc:212
const XMLElement & getChild(string_view name) const
Definition: XMLElement.cc:143
MSXMotherBoard & getMotherBoard() const
Definition: DeviceConfig.cc:13
const XMLElement & getChild(string_view name) const
Definition: DeviceConfig.cc:39