The tcDspStorageProxy class is used with other tcDspStorageBase derived classes to provide an interface that presents a given sector size. More...
#include <core/DspStorageProxy.h>
Public Member Functions | |
tcDspStorageProxy (tcDspStorageBase *apDevice, void *apOffset, unsigned int anSize, unsigned int anSectorSize=512) | |
This constructor is used to create a proxy with the specified sector size for the underlying tcDspStorageBase-derived class instance. | |
virtual | ~tcDspStorageProxy () |
Default destructor. | |
virtual int | write (void *apAddr, void *apData, int anBytes) |
This routine writes an arbitrary amount of data to the underlying storage device, after offsetting the request to the proper location and ensuring that it fits in the available space. | |
virtual int | write (unsigned int anSector, unsigned int anOffset, void *apData, int anBytes) |
Sector-based version of the write method. | |
virtual int | read (void *apStartAddr, void *apBuffer, int anBytes) |
This routine reads an arbitrary amount of data from the underlying storage device, after offsetting the request to the proper location and ensuring that it fits in the available space. | |
virtual int | read (unsigned int anSector, unsigned int anOffset, void *apBuffer, int anBytes) |
Sector-based version of the read method. | |
Protected Attributes | |
tcDspStorageBase * | mpDevice |
Pointer to underlying device. | |
unsigned int | mnDeviceOffset |
Offset on proxied device. | |
unsigned int | mnSectorSize |
Sector size (bytes). |
The tcDspStorageProxy class is used with other tcDspStorageBase derived classes to provide an interface that presents a given sector size.
This is useful to allow something like a filesystem to be hosted on a couple of sectors of a larger-sectored device.
tcDspStorageProxy::tcDspStorageProxy | ( | tcDspStorageBase * | apDevice, | |
void * | apOffset, | |||
unsigned int | anSize, | |||
unsigned int | anSectorSize = 512 | |||
) |
This constructor is used to create a proxy with the specified sector size for the underlying tcDspStorageBase-derived class instance.
[in] | apDevice | Pointer to the underlying tcDspStorageBase device. |
[in] | apOffset | Starting offset on underlying device. |
[in] | anSize | Bytes available on underlying device. |
[in] | anSectorSize | Sector size to present externally. |
tcDspStorageProxy::~tcDspStorageProxy | ( | ) | [virtual] |
int tcDspStorageProxy::write | ( | void * | apAddr, | |
void * | apData, | |||
int | anBytes | |||
) | [virtual] |
This routine writes an arbitrary amount of data to the underlying storage device, after offsetting the request to the proper location and ensuring that it fits in the available space.
[in] | apAddr | Pointer to the offset position on the proxied device. |
[in] | apData | A buffer containing the data to be written. |
[in] | anBytes | Size of the data to be written in bytes. |
Implements MityDSP::tcDspStorageBase.
int tcDspStorageProxy::write | ( | unsigned int | anSector, | |
unsigned int | anOffset, | |||
void * | apData, | |||
int | anBytes | |||
) | [virtual] |
Sector-based version of the write method.
[in] | anSector | The sector to write to. |
[in] | anOffset | The offset from the start of the sector. |
[in] | apData | A buffer containing the data to be written. |
[in] | anBytes | Size of the data to be written in bytes. |
Implements MityDSP::tcDspStorageBase.
int tcDspStorageProxy::read | ( | void * | apStartAddr, | |
void * | apBuffer, | |||
int | anBytes | |||
) | [virtual] |
This routine reads an arbitrary amount of data from the underlying storage device, after offsetting the request to the proper location and ensuring that it fits in the available space.
[in] | apStartAddr | Pointer to the data offset on the proxied device. |
[out] | apBuffer | A buffer to hold the data that is read. |
[in] | anBytes | Size of the data to be read in bytes. |
Implements MityDSP::tcDspStorageBase.
int tcDspStorageProxy::read | ( | unsigned int | anSector, | |
unsigned int | anOffset, | |||
void * | apBuffer, | |||
int | anBytes | |||
) | [virtual] |
Sector-based version of the read method.
[in] | anSector | The sector to copy from. |
[in] | anOffset | The offset from the start of the sector. |
[out] | apBuffer | A buffer to hold the data that is read. |
[in] | anBytes | Size of the data to be read in bytes. |
Implements MityDSP::tcDspStorageBase.
tcDspStorageBase* MityDSP::tcDspStorageProxy::mpDevice [protected] |
Pointer to underlying device.
unsigned int MityDSP::tcDspStorageProxy::mnDeviceOffset [protected] |
Offset on proxied device.
unsigned int MityDSP::tcDspStorageProxy::mnSectorSize [protected] |
Sector size (bytes).