Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_PtrBlockOutStream Class Reference

Inheritance diagram for CP_PtrBlockOutStream:

CP_OutStream List of all members.

Public Member Functions

Constructor / Destructor
 CP_PtrBlockOutStream (CP_PtrBlock *inOutBlock, bool inHasHeader=true)
 Constructor.
 CP_PtrBlockOutStream (CP_PtrBlock *inOutBlock, UInt32 inBeginPosition, bool inHasHeader=true)
virtual ~CP_PtrBlockOutStream () throw ()
 Destructor.
PtrBlock
CP_PtrBlockGetPtrBlock () const
void SetPtrBlock (CP_PtrBlock *inPtrBlock)
Positioning
virtual UInt32 GetPosition () const
virtual void SetPosition (UInt32 inPosition)

Protected Member Functions

Positioning
virtual void OnWriteBytes (const void *inDestBuffer, UInt32 inNumberBytes)
virtual UInt32 OnWriteData (const void *inBuffer, UInt32 inBytesToWrite)

Protected Attributes

CP_PtrBlockfPtrBlock
bool fHeaderWasWritten
bool fNeedsByteSwap
UInt32 fCurrentPosition
UInt16 fCPLATStreamVersion
bool fHasTaggedData
bool fHasHeader

Private Member Functions

PtrBlock
void GrowPtrBlock (UInt32 inNewSizeNeeded)

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_PtrBlockOutStream::CP_PtrBlockOutStream CP_PtrBlock inOutBlock,
bool  inHasHeader = true
 

Constructor.

Parameters:
inOutBlock The handle block that we are going to write our data to. This class assumes that this block's will survive as long as this object does.
inHasHeader Flag to indicate if there is a header that is written at the beginning of the stream.
Exceptions:
none 

CP_PtrBlockOutStream::CP_PtrBlockOutStream CP_PtrBlock inOutBlock,
UInt32  inBeginPosition,
bool  inHasHeader = true
 

Constructor.

Parameters:
inOutBlock The handle block that we are going to write our data to. This class assumes that this block's will survive as long as this object does.
inBeginPosition The initial position within the handle block to begin writing to.
inHasHeader Flag to indicate if there is a header that is written at the beginning of the stream.
Exceptions:
none 

CP_PtrBlockOutStream::~CP_PtrBlockOutStream  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_PtrBlock * CP_PtrBlockOutStream::GetPtrBlock  )  const
 

Returns the CP_PtrBlock object associated with this stream.

Exceptions:
none 
Returns:
CP_PtrBlock * const The handle block used for this stream.

void CP_PtrBlockOutStream::SetPtrBlock CP_PtrBlock inPtrBlock  ) 
 

Sets the CP_PtrBlock object associated with this stream. The CP_PtrBlock's lifetime must last until the stream is deallocated or until another block is attached to the stream through this call.

Parameters:
inPtrBlock The CP_PtrBlock object to use with this stream.
Exceptions:
none 
Returns:
void

UInt32 CP_PtrBlockOutStream::GetPosition  )  const [virtual]
 

Returns the current position marker to indicate the current position we are writing to our stream.

Exceptions:
none 
Returns:
SInt32 const The current position of the file marker.

Reimplemented from CP_OutStream.

void CP_PtrBlockOutStream::SetPosition UInt32  inPosition  )  [virtual]
 

Sets the current position marker to mark the current position in our output stream.

Parameters:
inPosition The position to set the current stream position marker to.
Exceptions:
none 
Returns:
void

Reimplemented from CP_OutStream.

void CP_PtrBlockOutStream::OnWriteBytes const void *  inBuffer,
UInt32  inBytesToWrite
[protected, virtual]
 

Writes the passed in data to our handle block.

Parameters:
inBuffer Buffer containing the data to be written.
inBytesToWrite Number of bytes to write to our handle block.
Exceptions:
none 
Returns:
void

Reimplemented from CP_OutStream.

UInt32 CP_PtrBlockOutStream::OnWriteData const void *  inBuffer,
UInt32  inBytesToWrite
[protected, virtual]
 

Writes the passed in data to our handle block, returning the actual number of bytes written to the handle block.

Parameters:
inBuffer Buffer containing the data to be written.
inBytesToWrite Number of bytes to write to our handle block.
Exceptions:
none 
Returns:
SInt32 The number of bytes written to the handle block stream.

void CP_PtrBlockOutStream::GrowPtrBlock UInt32  inNewSizeNeeded  )  [private]
 

Private routine to allocate more memory to the block we are writing to. This will double the size of the existing allocated block if it will be greater than the passed in amount to grow the block by. If we can't grow by double the current size, then we will try to grow by the passed in amount.

Parameters:
inNewSizeNeeded Number of bytes to grow the memory block to. This is the minimum amount needed.
Exceptions:
OSStatus exceptions from the handle block.
Returns:
void

void CP_OutStream::WriteBytes const void *  inBuffer,
UInt32  inNumberBytes
[virtual, inherited]
 

Writes a number of butes from the passed in buffer to the stream.

Parameters:
inBuffer Buffer to hold the data to be written.
inNumberBytes Holds the number of bytes to be written out to the stream.
Exceptions:
none 
Returns:
void

bool CP_OutStream::NeedsByteSwap  )  const [inherited]
 

void CP_OutStream::SetNeedsByteSwap bool  doSwap  )  [inherited]
 

UInt16 CP_OutStream::GetStreamVersion  )  const [inherited]
 

Returns the stream version used to write this data.

Exceptions:
none 
Returns:
UInt16 The version of this stream data.

bool CP_OutStream::HasHeader  )  const [inherited]
 

bool CP_OutStream::HasTaggedData  )  const [inherited]
 

Returns a flag to indicate if the data in the stream is tagged with the type of data written before the actual data. Used in debugging streams.

Exceptions:
none 
Returns:
bool const Returns true if the data is tagged.

void CP_OutStream::WriteTag SInt32  inTag  )  [inherited]
 

Writes the passed in tag out to the stream. This is used when the user has indicated they want to write tags before each element in the streamed data.

Parameters:
inTag The tag to be written out.
Exceptions:
none 
Returns:
void

void CP_OutStream::WriteHeader  )  [protected, virtual, inherited]
 

Writes the header out to the stream.

Exceptions:
none 
Returns:
void


Member Data Documentation

CP_PtrBlock* CP_PtrBlockOutStream::fPtrBlock [protected]
 

bool CP_OutStream::fHeaderWasWritten [protected, inherited]
 

bool CP_OutStream::fNeedsByteSwap [protected, inherited]
 

Flag to indicate if the header has been written to the stream.

UInt32 CP_OutStream::fCurrentPosition [protected, inherited]
 

Flag to indicate if we need to byte swap the data.

UInt16 CP_OutStream::fCPLATStreamVersion [protected, inherited]
 

The current position in the stream to write the next data to.

bool CP_OutStream::fHasTaggedData [protected, inherited]
 

Version of the stream data.

bool CP_OutStream::fHasHeader [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:02:02 2005 for CPLAT by  doxygen 1.4.0