openMSX
DiskContainer.hh
Go to the documentation of this file.
1 #ifndef DISKCONTAINER_HH
2 #define DISKCONTAINER_HH
3 
4 #include "serialize_meta.hh"
5 #include <functional>
6 #include <string>
7 #include <string_view>
8 
9 namespace openmsx {
10 
11 class SectorAccessibleDisk;
12 class MSXMotherBoard;
13 
15 {
16 public:
17  virtual ~DiskContainer() = default;
18 
19  [[nodiscard]] virtual SectorAccessibleDisk* getSectorAccessibleDisk() = 0;
20  [[nodiscard]] virtual const std::string& getContainerName() const = 0;
21  virtual bool diskChanged() = 0;
22 
23  // for nowind
24  // - error handling with return values instead of exceptions
25  virtual int insertDisk(std::string_view filename) = 0;
26  // for nowind
27  [[nodiscard]] bool isRomdisk() const;
28 
29  template<typename Archive>
30  void serialize(Archive& /*ar*/, unsigned /*version*/) {}
31 };
32 
33 // Subclass 'DiskChanger' needs (global) 'MSXMotherBoard' constructor parameter
34 REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper<MSXMotherBoard>);
35 
36 } // namespace openmsx
37 
38 #endif
openmsx::SectorAccessibleDisk
Definition: SectorAccessibleDisk.hh:16
openmsx::DiskContainer
Definition: DiskContainer.hh:15
openmsx::REGISTER_BASE_CLASS_1
REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper< MSXMotherBoard >)
openmsx::DiskContainer::serialize
void serialize(Archive &, unsigned)
Definition: DiskContainer.hh:30
serialize_meta.hh
openmsx::DiskContainer::isRomdisk
bool isRomdisk() const
Definition: DiskContainer.cc:6
openmsx::DiskContainer::getSectorAccessibleDisk
virtual SectorAccessibleDisk * getSectorAccessibleDisk()=0
openmsx::DiskContainer::~DiskContainer
virtual ~DiskContainer()=default
openmsx::filename
constexpr const char *const filename
Definition: FirmwareSwitch.cc:10
openmsx::DiskContainer::getContainerName
virtual const std::string & getContainerName() const =0
openmsx::DiskContainer::insertDisk
virtual int insertDisk(std::string_view filename)=0
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::DiskContainer::diskChanged
virtual bool diskChanged()=0