openMSX
Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
openmsx::SectorAccessibleDisk Class Referenceabstract

#include <SectorAccessibleDisk.hh>

Inheritance diagram for openmsx::SectorAccessibleDisk:
Inheritance graph
[legend]

Public Member Functions

void readSector (size_t sector, SectorBuffer &buf)
 
void writeSector (size_t sector, const SectorBuffer &buf)
 
size_t getNbSectors () const
 
bool isWriteProtected () const
 
void forceWriteProtect ()
 
virtual bool isDummyDisk () const
 
void applyPatch (Filename patchFile)
 
std::vector< FilenamegetPatches () const
 
bool hasPatches () const
 
Sha1Sum getSha1Sum (FilePool &filepool)
 Calculate SHA1 of the content of this disk. More...
 
int readSectors (SectorBuffer *buffers, size_t startSector, size_t nbSectors)
 
int writeSectors (const SectorBuffer *buffers, size_t startSector, size_t nbSectors)
 

Static Public Attributes

static const size_t SECTOR_SIZE = sizeof(SectorBuffer)
 

Protected Member Functions

 SectorAccessibleDisk ()
 
 ~SectorAccessibleDisk ()
 
void setPeekMode (bool peek)
 
bool isPeekMode () const
 
virtual void checkCaches ()
 
virtual void flushCaches ()
 
virtual Sha1Sum getSha1SumImpl (FilePool &filepool)
 

Friends

class EmptyDiskPatch
 

Detailed Description

Definition at line 15 of file SectorAccessibleDisk.hh.

Constructor & Destructor Documentation

◆ SectorAccessibleDisk()

openmsx::SectorAccessibleDisk::SectorAccessibleDisk ( )
protected

Definition at line 18 of file SectorAccessibleDisk.cc.

References ~SectorAccessibleDisk().

◆ ~SectorAccessibleDisk()

openmsx::SectorAccessibleDisk::~SectorAccessibleDisk ( )
protecteddefault

Referenced by SectorAccessibleDisk().

Member Function Documentation

◆ applyPatch()

void openmsx::SectorAccessibleDisk::applyPatch ( Filename  patchFile)

Definition at line 66 of file SectorAccessibleDisk.cc.

◆ checkCaches()

void openmsx::SectorAccessibleDisk::checkCaches ( )
protectedvirtual

Reimplemented in openmsx::DirAsDSK.

Definition at line 150 of file SectorAccessibleDisk.cc.

Referenced by getSha1Sum(), isPeekMode(), and openmsx::SectorBasedDisk::SectorBasedDisk().

◆ flushCaches()

void openmsx::SectorAccessibleDisk::flushCaches ( )
protectedvirtual

◆ forceWriteProtect()

void openmsx::SectorAccessibleDisk::forceWriteProtect ( )

Definition at line 139 of file SectorAccessibleDisk.cc.

Referenced by openmsx::HD::serialize().

◆ getNbSectors()

size_t openmsx::SectorAccessibleDisk::getNbSectors ( ) const

◆ getPatches()

std::vector< Filename > openmsx::SectorAccessibleDisk::getPatches ( ) const

Definition at line 71 of file SectorAccessibleDisk.cc.

Referenced by openmsx::DiskChanger::serialize().

◆ getSha1Sum()

Sha1Sum openmsx::SectorAccessibleDisk::getSha1Sum ( FilePool filepool)

Calculate SHA1 of the content of this disk.

This value is cached (and flushed on writes).

Definition at line 81 of file SectorAccessibleDisk.cc.

References checkCaches(), openmsx::Sha1Sum::empty(), and getSha1SumImpl().

Referenced by openmsx::DiskCommand::needRecord(), and openmsx::HD::serialize().

◆ getSha1SumImpl()

Sha1Sum openmsx::SectorAccessibleDisk::getSha1SumImpl ( FilePool filepool)
protectedvirtual

◆ hasPatches()

bool openmsx::SectorAccessibleDisk::hasPatches ( ) const

◆ isDummyDisk()

bool openmsx::SectorAccessibleDisk::isDummyDisk ( ) const
virtual

Reimplemented in openmsx::DummyDisk.

Definition at line 145 of file SectorAccessibleDisk.cc.

Referenced by readSector(), and writeSector().

◆ isPeekMode()

bool openmsx::SectorAccessibleDisk::isPeekMode ( ) const
inlineprotected

Definition at line 58 of file SectorAccessibleDisk.hh.

References checkCaches(), flushCaches(), and getSha1SumImpl().

Referenced by openmsx::DirAsDSK::readSectorImpl().

◆ isWriteProtected()

bool openmsx::SectorAccessibleDisk::isWriteProtected ( ) const

◆ readSector()

void openmsx::SectorAccessibleDisk::readSector ( size_t  sector,
SectorBuffer buf 
)

◆ readSectors()

int openmsx::SectorAccessibleDisk::readSectors ( SectorBuffer buffers,
size_t  startSector,
size_t  nbSectors 
)

Definition at line 108 of file SectorAccessibleDisk.cc.

References readSector(), and xrange().

Referenced by openmsx::NowindHost::write().

◆ setPeekMode()

void openmsx::SectorAccessibleDisk::setPeekMode ( bool  peek)
inlineprotected

Definition at line 57 of file SectorAccessibleDisk.hh.

Referenced by getSha1SumImpl().

◆ writeSector()

void openmsx::SectorAccessibleDisk::writeSector ( size_t  sector,
const SectorBuffer buf 
)

◆ writeSectors()

int openmsx::SectorAccessibleDisk::writeSectors ( const SectorBuffer buffers,
size_t  startSector,
size_t  nbSectors 
)

Definition at line 121 of file SectorAccessibleDisk.cc.

References writeSector(), and xrange().

Referenced by openmsx::NowindHost::write().

Friends And Related Function Documentation

◆ EmptyDiskPatch

friend class EmptyDiskPatch
friend

Definition at line 75 of file SectorAccessibleDisk.hh.

Member Data Documentation

◆ SECTOR_SIZE

const size_t openmsx::SectorAccessibleDisk::SECTOR_SIZE = sizeof(SectorBuffer)
static

The documentation for this class was generated from the following files: