ZStreamWPos_Memory Class Reference

A positionable write stream that writes to normal memory. More...

#include <ZStream_Memory.h>

Inheritance diagram for ZStreamWPos_Memory:

ZStreamWPos ZStreamW List of all members.

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.

Detailed Description

A positionable write stream that writes to normal memory.

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.

See also:
ZStreamW_Memory


Constructor & Destructor Documentation

ZStreamWPos_Memory::ZStreamWPos_Memory ( void *  iAddress,
size_t  iSize 
)

Parameters:
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 
)

Parameters:
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.


Member Function Documentation

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.

See also:
sCopyReadToWrite

Reimplemented from ZStreamW.


The documentation for this class was generated from the following files:
Generated on Thu Jul 26 11:22:06 2007 for ZooLib by  doxygen 1.4.7