#include <RandomAccessDevice.h>
Inheritance diagram for RandomAccessDevice:
Public Member Functions | |
virtual | ~RandomAccessDevice () |
virtual FileSize | getSizeInBytes ()=0 |
Gets the current size of this device. | |
virtual void | setSizeInBytes (FileSize cbNew)=0 |
Sets the size of this device, truncating or extending the device as necessary. | |
virtual void | transfer (RandomAccessRequest const &request)=0 |
Synchronously reads or writes a range of bytes from the device. | |
virtual void | prepareTransfer (RandomAccessRequest &request)=0 |
Prepares for an asynchronous transfer by associating required information about this device (e.g. | |
virtual void | flush ()=0 |
Forces any buffered writes to permanent storage (e.g. | |
virtual int | getHandle ()=0 |
|
For more information, see DeviceDesign.
Definition at line 39 of file RandomAccessDevice.h.
RandomAccessDevice::~RandomAccessDevice | ( | ) | [virtual] |
virtual FileSize RandomAccessDevice::getSizeInBytes | ( | ) | [pure virtual] |
Gets the current size of this device.
Implemented in RandomAccessFileDevice, and RandomAccessNullDevice.
virtual void RandomAccessDevice::setSizeInBytes | ( | FileSize | cbNew | ) | [pure virtual] |
Sets the size of this device, truncating or extending the device as necessary.
Contents of extended portion are undefined.
cbNew | new device size in bytes |
Implemented in RandomAccessFileDevice, and RandomAccessNullDevice.
virtual void RandomAccessDevice::transfer | ( | RandomAccessRequest const & | request | ) | [pure virtual] |
Synchronously reads or writes a range of bytes from the device.
Never returns an error state; instead, a completion notification method is called (via RandomAccessRequestBinding::notifyTransferCompletion).
request | the encapsulated request parameters |
Implemented in RandomAccessFileDevice, and RandomAccessNullDevice.
Referenced by RandomAccessRequest::execute().
virtual void RandomAccessDevice::prepareTransfer | ( | RandomAccessRequest & | request | ) | [pure virtual] |
Prepares for an asynchronous transfer by associating required information about this device (e.g.
file handle) with the given request. The actual asynchronous transfer is initiated by a calling DeviceAccessScheduler rather than this RandomAccessDevice itself.
request | the encapsulated request parameters |
Implemented in RandomAccessFileDevice, and RandomAccessNullDevice.
Referenced by AioSignalScheduler::schedule(), AioPollingScheduler::schedule(), and AioLinuxScheduler::schedule().
virtual void RandomAccessDevice::flush | ( | ) | [pure virtual] |
Forces any buffered writes to permanent storage (e.g.
fsync for a file device).
Implemented in RandomAccessFileDevice, and RandomAccessNullDevice.
virtual int RandomAccessDevice::getHandle | ( | ) | [pure virtual] |
Implemented in RandomAccessFileDevice, and RandomAccessNullDevice.
Referenced by IoCompletionPortScheduler::schedule().