OXYGENHUB
◆ main openmsx / src / fdc / DiskContainer.hh
1.2 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef DISKCONTAINER_HH
2
#define DISKCONTAINER_HH
3
4
#include "serialize_meta.hh"
5
6
#include <functional>
7
#include <string>
8
#include <string_view>
9
10
namespace openmsx {
11
12
class SectorAccessibleDisk;
13
class MSXMotherBoard;
14
15
class DiskContainer
16
{
17
public:
18
	DiskContainer() = default;
19
	DiskContainer(const DiskContainer&) = delete;
20
	DiskContainer(DiskContainer&&) = delete;
21
	DiskContainer& operator=(const DiskContainer&) = delete;
22
	DiskContainer& operator=(DiskContainer&&) = delete;
23
	virtual ~DiskContainer() = default;
24
25
	[[nodiscard]] virtual SectorAccessibleDisk* getSectorAccessibleDisk() = 0;
26
	[[nodiscard]] virtual std::string_view getContainerName() const = 0;
27
	virtual bool diskChanged() = 0;
28
29
	// for nowind
30
	//  - error handling with return values instead of exceptions
31
	virtual int insertDisk(const std::string& filename) = 0;
32
	// for nowind
33
	[[nodiscard]] bool isRomDisk() const;
34
35
	template<typename Archive>
36
	void serialize(Archive& /*ar*/, unsigned /*version*/) {}
37
};
38
39
// Subclass 'DiskChanger' needs (global) 'MSXMotherBoard' constructor parameter
40
REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper<MSXMotherBoard>);
41
42
} // namespace openmsx
43
44
#endif