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  DiskContainer(const DiskContainer&) = delete;
19 
20  DiskContainer() = default;
21  virtual ~DiskContainer() = default;
22 
23  [[nodiscard]] virtual SectorAccessibleDisk* getSectorAccessibleDisk() = 0;
24  [[nodiscard]] virtual std::string_view getContainerName() const = 0;
25  virtual bool diskChanged() = 0;
26 
27  // for nowind
28  // - error handling with return values instead of exceptions
29  virtual int insertDisk(const std::string& filename) = 0;
30  // for nowind
31  [[nodiscard]] bool isRomdisk() const;
32 
33  template<typename Archive>
34  void serialize(Archive& /*ar*/, unsigned /*version*/) {}
35 };
36 
37 // Subclass 'DiskChanger' needs (global) 'MSXMotherBoard' constructor parameter
38 REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper<MSXMotherBoard>);
39 
40 } // namespace openmsx
41 
42 #endif
virtual ~DiskContainer()=default
virtual std::string_view getContainerName() const =0
DiskContainer & operator=(const DiskContainer &)=delete
virtual SectorAccessibleDisk * getSectorAccessibleDisk()=0
bool isRomdisk() const
Definition: DiskContainer.cc:6
void serialize(Archive &, unsigned)
DiskContainer(const DiskContainer &)=delete
virtual bool diskChanged()=0
virtual int insertDisk(const std::string &filename)=0
This file implemented 3 utility functions:
Definition: Autofire.cc:9
constexpr const char *const filename
REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper< MSXMotherBoard >)