MIXAL
|
#include <io.h>
Public Member Functions | |
IODevice (int32_t blockSize, bool allowRead, bool allowWrite) | |
IODeviceType | type () const |
int | blockSize () const |
bool | allowRead () const |
bool | allowWrite () const |
virtual bool | ready (int32_t elapsed) |
virtual void | control (int32_t) |
virtual void | read (ComputerWord *memory, int32_t address)=0 |
virtual void | write (const ComputerWord *memory, int32_t address)=0 |
virtual ComputerWord & | wordAt (int32_t index)=0 |
Protected Member Functions | |
virtual void | doRead ()=0 |
virtual void | doWrite ()=0 |
Protected Attributes | |
IODeviceType | _type |
int32_t | _blockSize |
bool | _allowRead |
bool | _allowWrite |
int32_t | _timestamp |
double | _readyRate |
The IO device.
Once read or write, the device will not be ready immediately. The reading or writing operation is saved, the actual reading or writing is performed only when the device is explicitly being queried.
mixal::IODevice::IODevice | ( | int32_t | blockSize, |
bool | allowRead, | ||
bool | allowWrite | ||
) |
|
inline |
|
inline |
|
inline |
The number of bytes in one reading or writing.
Definition at line 54 of file io.h.
References _blockSize.
|
inlinevirtual |
Special control of the device.
Reimplemented in mixal::IODevicePaperTape, mixal::IODeviceLinePrinter, mixal::IODeviceDisk, and mixal::IODeviceTape.
|
protectedpure virtual |
Perform the actual reading.
Implemented in mixal::IODeviceStorage.
|
protectedpure virtual |
Perform the actual writing.
Implemented in mixal::IODeviceStorage.
|
pure virtual |
Read one block from the device.
Implemented in mixal::IODeviceStorage.
|
virtual |
Whether the device is ready for reading or writing.
Reimplemented in mixal::IODeviceStorage.
Definition at line 14 of file io.cpp.
References _readyRate, and _timestamp.
Referenced by mixal::IODeviceStorage::ready(), and mixal::Computer::waitDevice().
|
inline |
|
pure virtual |
Get a word from the storage of the device.
Implemented in mixal::IODeviceStorage.
Referenced by mixal::Computer::getDeviceWordAt().
|
pure virtual |
Write one block to the device.
Implemented in mixal::IODeviceStorage.
|
protected |
|
protected |
|
protected |
The number of bytes in one reading or writing.
Definition at line 74 of file io.h.
Referenced by blockSize(), mixal::IODeviceTape::control(), mixal::IODeviceLinePrinter::control(), mixal::IODeviceStorage::doRead(), mixal::IODeviceStorage::doWrite(), mixal::IODeviceLinePrinter::line(), mixal::IODeviceLinePrinter::pageOffsetAt(), and mixal::IODeviceStorage::read().
|
protected |
|
protected |
The latest time that the device being triggered.
Definition at line 77 of file io.h.
Referenced by mixal::IODeviceStorage::read(), and ready().
|
protected |