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
6#include <functional>
7#include <string>
8#include <string_view>
9
10namespace openmsx {
11
12class SectorAccessibleDisk;
13class MSXMotherBoard;
14
16{
17public:
18 DiskContainer() = default;
19 DiskContainer(const 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
40REGISTER_BASE_CLASS_1(DiskContainer, "DiskContainer", std::reference_wrapper<MSXMotherBoard>);
41
42} // namespace openmsx
43
44#endif
virtual ~DiskContainer()=default
virtual std::string_view getContainerName() const =0
DiskContainer & operator=(const DiskContainer &)=delete
void serialize(Archive &, unsigned)
DiskContainer(const DiskContainer &)=delete
virtual bool diskChanged()=0
DiskContainer(DiskContainer &&)=delete
virtual int insertDisk(const std::string &filename)=0
virtual SectorAccessibleDisk * getSectorAccessibleDisk()=0
DiskContainer & operator=(DiskContainer &&)=delete
This file implemented 3 utility functions:
Definition Autofire.cc:11
#define REGISTER_BASE_CLASS_1(CLASS, NAME, TYPE1)