#include <ZStream_Memory.h>
Inheritance diagram for ZStreamWPos_Memory:
Public Member Functions | |
ZStreamWPos_Memory (void *iAddress, size_t iSize) | |
ZStreamWPos_Memory (void *iAddress, size_t iSize, size_t iCapacity) | |
virtual void | Imp_CopyFromDispatch (const ZStreamR &iStreamR, uint64 iCount, uint64 *oCountRead, uint64 *oCountWritten) |
Invoke iStreamR's Imp_CopyTo method. | |
virtual void | Imp_CopyFrom (const ZStreamR &iStreamR, uint64 iCount, uint64 *oCountRead, uint64 *oCountWritten) |
Actually copy data to this stream from iStreamR. | |
void * | GetCurrentAddress () |
Returns the address to which the next write will be made. |
ZStreamWPos_Memory provides positionable write stream access to normal memory. If you need to pass a ZStreamW to a method, and want that stream to be sourced from normal memory but want to restrict the range of addresses accessed you should use a ZStreamWPos_Memory, even though its positionable API is not directly required.
ZStreamWPos_Memory::ZStreamWPos_Memory | ( | void * | iAddress, | |
size_t | iSize | |||
) |
iAddress | The base address to which data is to be written. | |
iSize | Both the capacity of the block of memory to which access should be restricted and the nominal starting size of the stream. |
ZStreamWPos_Memory::ZStreamWPos_Memory | ( | void * | iAddress, | |
size_t | iSize, | |||
size_t | iCapacity | |||
) |
iAddress | The base address to which data is to be written. | |
iSize | The nominal starting size of the stream (can be zero). | |
iCapacity | The capacity of the block of memory and thus the maximum size to which the stream can grow. |
void ZStreamWPos_Memory::Imp_CopyFromDispatch | ( | const ZStreamR & | iStreamR, | |
uint64 | iCount, | |||
uint64 * | oCountRead, | |||
uint64 * | oCountWritten | |||
) | [virtual] |
Invoke iStreamR's Imp_CopyTo
method.
The first part of the two-stage dispatch initiated by ZStreamW::CopyFrom and ZStreamW::CopyAllFrom. Override if your stream's data is in memory and thus iStreamR can have its Read
method called with your stream's data as its destination.
Reimplemented from ZStreamW.
void ZStreamWPos_Memory::Imp_CopyFrom | ( | const ZStreamR & | iStreamR, | |
uint64 | iCount, | |||
uint64 * | oCountRead, | |||
uint64 * | oCountWritten | |||
) | [virtual] |
Actually copy data to this stream from iStreamR.
The second part of the two-stage dispatch initiated by ZStreamR::CopyTo and ZStreamR::CopyAllTo. The default implementation calls sCopyReadToWrite
. Override this method if your stream's data is in memory and thus can be modified by calling iStreamR's Read
method.
Reimplemented from ZStreamW.