1 #ifndef HARDWARECONFIG_HH
2 #define HARDWARECONFIG_HH
11 #include <string_view>
39 std::string_view slotname);
42 std::string slotname, std::span<const TclObject> options);
54 [[nodiscard]]
const std::string&
getName()
const {
return name; }
55 [[nodiscard]]
const std::string&
getConfigName()
const {
return hwName; }
68 [[nodiscard]]
const auto&
getDevices()
const {
return devices; };
75 template<
typename Archive>
76 void serialize(Archive& ar,
unsigned version);
80 void load(std::string_view type);
83 const XMLElement* primary,
const XMLElement* secondary);
84 void createExternalSlot(
int ps);
85 void createExternalSlot(
int ps,
int ss);
86 void createExpandedSlot(
int ps);
87 [[nodiscard]]
int getAnyFreePrimarySlot();
88 [[nodiscard]]
int getSpecificFreePrimarySlot(
unsigned slot);
89 void addDevice(std::unique_ptr<MSXDevice> device);
90 void setName(std::string_view proposedName);
91 void setSlot(std::string_view slotname);
94 MSXMotherBoard& motherBoard;
101 bool externalSlots[4][4];
102 bool externalPrimSlots[4];
103 bool expandedSlots[4];
104 bool allocatedPrimarySlots[4];
106 std::vector<std::unique_ptr<MSXDevice>> devices;
116 using type = std::tuple<std::string>;
118 template<
typename Archive>
121 ar.serialize(
"hwname", config.hwName);
124 template<
typename Archive>
128 ar.serialize(
"hwname", name);
129 return std::tuple(name);
static std::unique_ptr< HardwareConfig > createRomConfig(MSXMotherBoard &motherBoard, std::string romfile, std::string slotname, std::span< const TclObject > options)
const XMLElement & getConfig() const
const auto & getDevices() const
HardwareConfig(const HardwareConfig &)=delete
XMLDocument & getXMLDocument()
const std::string & getConfigName() const
MSXMotherBoard & getMotherBoard() const
static std::unique_ptr< HardwareConfig > createMachineConfig(MSXMotherBoard &motherBoard, std::string machineName)
const std::string & getName() const
void serialize(Archive &ar, unsigned version)
void setFileContext(FileContext &&ctxt)
HardwareConfig & operator=(const HardwareConfig &)=delete
static std::unique_ptr< HardwareConfig > createExtensionConfig(MSXMotherBoard &motherBoard, std::string extensionName, std::string_view slotname)
const FileContext & getFileContext() const
byte parseSlotMap() const
Parses a slot mapping.
static void loadConfig(XMLDocument &doc, std::string_view type, std::string_view name)
void testRemove() const
Checks whether this HardwareConfig can be deleted.
const XMLElement & getDevicesElem() const
const XMLElement * getRoot() const
void setRoot(XMLElement *root_)
This file implemented 3 utility functions:
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
type load(Archive &ar, unsigned)
void save(Archive &ar, const HardwareConfig &config)
std::tuple< std::string > type
Serialize (local) constructor arguments.