Base class for generic read/write data source/target. More...
#include <mi32/genericrw.h>

Public Types | |
| enum | CAPABILITIES { CAPABILITY_None = 0x0000, CAPABILITY_Read = 0x0001, CAPABILITY_Write = 0x0002, CAPABILITY_Seek = 0x0004, CAPABILITY_Resize = 0x0008, CAPABILITY_Accept = 0x0010, CAPABILITY_Bind = 0x0020, CAPABILITY_NonBlocking = 0x0040, CAPABILITY_Size = 0x0080, CAPABILITIES_All = 0x00FF } |
| enum | SEEKFROM { SEEKFROM_Beginning = 0, SEEKFROM_Current, SEEKFROM_End } |
Public Member Functions | |
| virtual | ~GENERICRW () |
| CAPABILITIES | GetCapabilities () const |
| void * | GetMappedMemory (INT64 &size, INT64 offset=0) |
| INT64 | GetSize () const |
| INT64 | GetSizeLimit () const |
| INT32 | Read (void *buffer, INT32 numbytes, bool AllowPartial=false) |
| ERRVALUE | ReadAll (SIMPLE_ARRAY< UINT8 > &buffer) |
| ERRVALUE | Resize (INT64 newsize) |
| INT64 | Seek (INT64 offset, SEEKFROM from=SEEKFROM_Beginning) |
| ERRVALUE | SeekAndRead (INT64 offset, void *buffer, INT32 numbytes) |
| ERRVALUE | SeekAndWrite (INT64 offset, const void *buffer, INT32 numbytes) |
| INT64 | Tell () const |
| ERRVALUE | Write (const void *buffer, INT32 numbytes) |
Private Member Functions | |
| virtual CAPABILITIES | v_GetCapabilities () const =0 |
| virtual void * | v_GetMappedMemory (INT64 &size, INT64 offset) |
| virtual INT64 | v_GetSize () const =0 |
| virtual INT64 | v_GetSizeLimit () const =0 |
| virtual INT32 | v_Read (void *buffer, INT32 numbytes, bool AllowPartial)=0 |
| virtual ERRVALUE | v_Resize (INT64 newsize)=0 |
| virtual INT64 | v_Seek (INT64 offset, SEEKFROM from)=0 |
| virtual INT64 | v_Tell () const =0 |
| virtual ERRVALUE | v_Write (const void *buffer, INT32 numbytes)=0 |
Base class for generic read/write data source/target.
Enumeration for instance capabilities.
| enum GENERICRW::SEEKFROM |
| virtual GENERICRW::~GENERICRW | ( | ) | [virtual] |
Destructor.
| CAPABILITIES GENERICRW::GetCapabilities | ( | ) | const |
Get instance capabilities.
Get memory-mapped buffer containing data.
| size | size of buffer returned | |
| offset | offset into data |
| INT64 GENERICRW::GetSize | ( | ) | const |
Get current size of data.
Note, if instance does not support seeking then size returned may be less than ultimate amount of data which may be read.
| INT64 GENERICRW::GetSizeLimit | ( | ) | const |
Get maximum possible size of data.
Read data into buffer.
| buffer | Buffer to read into | |
| numbytes | Number of bytes to read | |
| AllowPartial | Allow partial reads, if false will return error if less than requested number of bytes were read. |
| ERRVALUE GENERICRW::ReadAll | ( | SIMPLE_ARRAY< UINT8 > & | buffer | ) |
Read entire contents into buffer.
| buffer | Buffer to hold contents |
Resize data.
May be used to truncate or extend the data, if used to extend, the contents beyond the old end of data and the new size are undefined.
| newsize | New size in bytes |
Seek to specified location.
| offset | Location to seek to | |
| from | Relative position to seek from |
Seek to specified position and read.
| offset | Offset from beginning of data stream | |
| buffer | Buffer to contain data | |
| numbytes | Number of bytes to read |
Seek to specified position and write.
| offset | Offset from beginning of data stream | |
| buffer | Buffer containing data to write | |
| numbytes | Number of bytes to write |
| INT64 GENERICRW::Tell | ( | ) | const |
Return current read/write position.
| virtual CAPABILITIES GENERICRW::v_GetCapabilities | ( | ) | const [private, pure virtual] |
Override to get instance capabilities.
Implemented in PORT.
Override to get mapped memory.
| virtual INT64 GENERICRW::v_GetSize | ( | ) | const [private, pure virtual] |
Override to get data size.
Implemented in PORT.
| virtual INT64 GENERICRW::v_GetSizeLimit | ( | ) | const [private, pure virtual] |
Override to get maximum possible data size.
Implemented in PORT.
| virtual INT32 GENERICRW::v_Read | ( | void * | buffer, | |
| INT32 | numbytes, | |||
| bool | AllowPartial | |||
| ) | [private, pure virtual] |
Override to read data.
Implemented in PORT.
Override to resize.
Implemented in PORT.
Override to seek.
Implemented in PORT.
| virtual INT64 GENERICRW::v_Tell | ( | ) | const [private, pure virtual] |
Override to return current position.
Implemented in PORT.
Override to write data.
Implemented in PORT.
Write data from buffer.
| buffer | Buffer to write from | |
| numbytes | Number of bytes to write |
1.6.1