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 "string_ref.hh"
6 #include <functional>
7 #include <string>
8 
9 namespace openmsx {
10 
11 class SectorAccessibleDisk;
12 class MSXMotherBoard;
13 
15 {
16 public:
17  virtual ~DiskContainer() = default;
18 
20  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(string_ref filename) = 0;
26  // for nowind
27  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
bool isRomdisk() const
Definition: DiskContainer.cc:6
REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper< MSXMotherBoard >)
virtual int insertDisk(string_ref filename)=0
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
void serialize(Archive &, unsigned)
virtual const std::string & getContainerName() const =0
virtual ~DiskContainer()=default
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
virtual bool diskChanged()=0
virtual SectorAccessibleDisk * getSectorAccessibleDisk()=0