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 }
39 {
40  assert(hwConf);
41  return const_cast<HardwareConfig*>(hwConf)->getXMLDocument();
42 }
43 
44 const XMLElement& DeviceConfig::getChild(std::string_view name) const
45 {
46  return getXML()->getChild(name);
47 }
48 std::string_view DeviceConfig::getChildData(std::string_view name) const
49 {
50  return getXML()->getChildData(name);
51 }
52 std::string_view DeviceConfig::getChildData(std::string_view name,
53  std::string_view defaultValue) const
54 {
55  return getXML()->getChildData(name, defaultValue);
56 }
57 int DeviceConfig::getChildDataAsInt(std::string_view name, int defaultValue) const
58 {
59  return getXML()->getChildDataAsInt(name, defaultValue);
60 }
61 bool DeviceConfig::getChildDataAsBool(std::string_view name,
62  bool defaultValue) const
63 {
64  return getXML()->getChildDataAsBool(name, defaultValue);
65 }
66 const XMLElement* DeviceConfig::findChild(std::string_view name) const
67 {
68  return getXML()->findChild(name);
69 }
70 std::string_view DeviceConfig::getAttributeValue(std::string_view attName) const
71 {
72  return getXML()->getAttributeValue(attName);
73 }
74 int DeviceConfig::getAttributeValueAsInt(std::string_view attName, int defaultValue) const
75 {
76  return getXML()->getAttributeValueAsInt(attName, defaultValue);
77 }
78 
79 } // namespace openmsx
Reactor & getReactor() const
Definition: DeviceConfig.cc:30
bool getChildDataAsBool(std::string_view name, bool defaultValue=false) const
Definition: DeviceConfig.cc:61
CliComm & getCliComm() const
Definition: DeviceConfig.cc:18
const FileContext & getFileContext() const
Definition: DeviceConfig.cc:9
const XMLElement * findChild(std::string_view name) const
Definition: DeviceConfig.cc:66
GlobalSettings & getGlobalSettings() const
Definition: DeviceConfig.cc:34
int getChildDataAsInt(std::string_view name, int defaultValue) const
Definition: DeviceConfig.cc:57
XMLDocument & getXMLDocument()
Definition: DeviceConfig.cc:38
MSXMotherBoard & getMotherBoard() const
Definition: DeviceConfig.cc:13
CommandController & getCommandController() const
Definition: DeviceConfig.cc:22
std::string_view getChildData(std::string_view name) const
Definition: DeviceConfig.cc:48
const HardwareConfig & getHardwareConfig() const
Definition: DeviceConfig.hh:43
Scheduler & getScheduler() const
Definition: DeviceConfig.cc:26
const XMLElement & getChild(std::string_view name) const
Definition: DeviceConfig.cc:44
int getAttributeValueAsInt(std::string_view attName, int defaultValue) const
Definition: DeviceConfig.cc:74
std::string_view getAttributeValue(std::string_view attName) const
Definition: DeviceConfig.cc:70
const XMLElement * getXML() const
Definition: DeviceConfig.hh:48
This class contains settings that are used by several other class (including some singletons).
MSXMotherBoard & getMotherBoard() const
const FileContext & getFileContext() const
CommandController & getCommandController()
Contains the main loop of openMSX.
Definition: Reactor.hh:68
GlobalSettings & getGlobalSettings()
Definition: Reactor.hh:104
int getChildDataAsInt(std::string_view childName, int defaultValue) const
Definition: XMLElement.cc:81
const XMLElement * findChild(std::string_view childName) const
Definition: XMLElement.cc:19
std::string_view getAttributeValue(std::string_view attrName) const
Definition: XMLElement.cc:114
int getAttributeValueAsInt(std::string_view attrName, int defaultValue) const
Definition: XMLElement.cc:134
const XMLElement & getChild(std::string_view childName) const
Definition: XMLElement.cc:53
std::string_view getChildData(std::string_view childName) const
Definition: XMLElement.cc:62
bool getChildDataAsBool(std::string_view childName, bool defaultValue) const
Definition: XMLElement.cc:75
This file implemented 3 utility functions:
Definition: Autofire.cc:9