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

CP_HandleBlockOutStream Class Reference

Inheritance diagram for CP_HandleBlockOutStream:

CP_OutStream List of all members.

Public Member Functions

Constructor / Destructor
 CP_HandleBlockOutStream (CP_HandleBlock *inOutBlock, bool inHasHeader=true)
 Constructor.
 CP_HandleBlockOutStream (CP_HandleBlock *inOutBlock, UInt32 inBeginPosition, bool inHasHeader=true)
virtual ~CP_HandleBlockOutStream () throw ()
 Destructor.
HandleBlock
CP_HandleBlockGetHandleBlock () const
void SetHandleBlock (CP_HandleBlock *inHandleBlock)
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_HandleBlockfHandleBlock
bool fHeaderWasWritten
bool fNeedsByteSwap
UInt32 fCurrentPosition
UInt16 fCPLATStreamVersion
bool fHasTaggedData
bool fHasHeader

Private Member Functions

HandleBlock
void GrowHandleBlock (UInt32 inBytesToGrow)

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_HandleBlockOutStream::CP_HandleBlockOutStream CP_HandleBlock inOutBlock,
bool  inHasHeader = true
 

Constructor.

Parameters:
inOutBlock The handle block that we are going to write our data to. This class assumes that the handle block remains valid until it's no longer needed by this object.
inHasHeader Flag to indicate if there is a header that is written at the beginning of the stream.
Exceptions:
none 

CP_HandleBlockOutStream::CP_HandleBlockOutStream CP_HandleBlock 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 the handle block remains valid until it's no longer needed by this object.
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_HandleBlockOutStream::~CP_HandleBlockOutStream  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_HandleBlock * CP_HandleBlockOutStream::GetHandleBlock  )  const
 

Returns the CP_HandleBlock object associated with this stream.

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

void CP_HandleBlockOutStream::SetHandleBlock CP_HandleBlock inHandleBlock  ) 
 

Sets the CP_HandleBlock object associated with this stream. The handle block must exist as long as this object still needs it.

Parameters:
inHandleBlock The CP_HandleBlock object to use with this stream.
Exceptions:
none 
Returns:
void

UInt32 CP_HandleBlockOutStream::GetPosition  )  const [virtual]
 

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

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

Reimplemented from CP_OutStream.

void CP_HandleBlockOutStream::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_HandleBlockOutStream::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_HandleBlockOutStream::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_HandleBlockOutStream::GrowHandleBlock UInt32  inBytesToGrow  )  [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:
inBytesToGrow Number of bytes to grow the memory block by. 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_HandleBlock* CP_HandleBlockOutStream::fHandleBlock [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:01:44 2005 for CPLAT by  doxygen 1.4.0