MityDSP Documentation Index

MityDSP::tcDspStorageProxy Class Reference

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>

Inheritance diagram for MityDSP::tcDspStorageProxy:
MityDSP::tcDspStorageBase

List of all members.

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

tcDspStorageBasempDevice
 Pointer to underlying device.
unsigned int mnDeviceOffset
 Offset on proxied device.
unsigned int mnSectorSize
 Sector size (bytes).

Detailed Description

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.

See also:
tcDspStorageProxy Page

Constructor & Destructor Documentation

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.

Parameters:
[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.
Returns:
None.
See also:
DspStorageProxy.h
tcDspStorageProxy::~tcDspStorageProxy (  )  [virtual]

Default destructor.

Returns:
None.
See also:
DspStorageProxy.h

Member Function Documentation

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.

Parameters:
[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.
Returns:
The number of bytes successfully written.
See also:
DspStorageProxy.h

Implements MityDSP::tcDspStorageBase.

int tcDspStorageProxy::write ( unsigned int  anSector,
unsigned int  anOffset,
void *  apData,
int  anBytes 
) [virtual]

Sector-based version of the write method.

Parameters:
[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.
Returns:
The number of bytes successfully written.
See also:
DspStorageProxy.h

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.

Parameters:
[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.
Returns:
The number of bytes successfully read.
See also:
DspStorageProxy.h

Implements MityDSP::tcDspStorageBase.

int tcDspStorageProxy::read ( unsigned int  anSector,
unsigned int  anOffset,
void *  apBuffer,
int  anBytes 
) [virtual]

Sector-based version of the read method.

Parameters:
[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.
Returns:
The number of bytes successfully read.
See also:
DspStorageProxy.h

Implements MityDSP::tcDspStorageBase.


Member Data Documentation

Pointer to underlying device.

Offset on proxied device.

unsigned int MityDSP::tcDspStorageProxy::mnSectorSize [protected]

Sector size (bytes).


  
Generated on Fri Sep 23 16:33:55 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.