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

CP_SocketInStream Class Reference

Class to read stream data from socket connection.

Inheritance diagram for CP_SocketInStream:

CP_InStream List of all members.

Public Member Functions

Reading
virtual UInt32 ReadBytes (void *inDestBuffer, UInt32 inNumberBytes, bool inAllowPartialData=false)
ByteSwapping
bool NeedsByteSwap () const
void SetNeedsByteSwap (bool doSwap)
Getters
UInt16 GetStreamVersion () const
bool HasHeader () const
Tags
bool HasTaggedData () const
SInt32 GetTag ()
Reading
virtual UInt32 ReadBytes (void *inDestBuffer, UInt32 inNumberBytes, bool inAllowPartialData=false)
ByteSwapping
bool NeedsByteSwap () const
void SetNeedsByteSwap (bool doSwap)
Getters
UInt16 GetStreamVersion () const
bool HasHeader () const
Tags
bool HasTaggedData () const
SInt32 GetTag ()
Reading
virtual UInt32 ReadBytes (void *inDestBuffer, UInt32 inNumberBytes, bool inAllowPartialData=false)
ByteSwapping
bool NeedsByteSwap () const
void SetNeedsByteSwap (bool doSwap)
Tags
bool HasTaggedData () const
SInt32 GetTag ()
Reading
virtual UInt32 ReadBytes (void *inDestBuffer, UInt32 inNumberBytes, bool inAllowPartialData=false)
ByteSwapping
bool NeedsByteSwap () const
void SetNeedsByteSwap (bool doSwap)
Getters
UInt16 GetStreamVersion () const
bool HasHeader () const
Tags
bool HasTaggedData () const
SInt32 GetTag ()
Constructor / Destructor
 CP_SocketInStream (class CP_Socket &inSocket, bool inHasHeader=true)
 Constructor.
virtual ~CP_SocketInStream () throw ()
 Destructor.
Testing
virtual bool IsEOF () const
Utility
virtual void Close ()
Reading
virtual UInt32 ReadBytes (void *inDestBuffer, UInt32 inNumberBytes, bool inAllowPartialData=false)
ByteSwapping
bool NeedsByteSwap () const
void SetNeedsByteSwap (bool doSwap)
Getters
UInt16 GetStreamVersion () const
bool HasHeader () const
Tags
bool HasTaggedData () const
SInt32 GetTag ()

Protected Member Functions

virtual UInt32 OnReadBytes (void *inDestBuffer, UInt32 inNumberBytes)
Reading
virtual void ReadHeader ()
Reading
virtual void ReadHeader ()
Reading
virtual void ReadHeader ()
Reading
virtual void ReadHeader ()

Protected Attributes

CP_SocketfSocket
bool fHasReadHeader
bool fNeedsByteSwap
UInt16 fCPLATStreamVersion
bool fHasTaggedData
bool fHasHeader
char fDesiredEdian

Private Member Functions

Constructor / Destructor
 CP_SocketInStream ()
 Constructor.
 CP_SocketInStream (const CP_SocketInStream &ob)
operators
CP_SocketInStreamoperator= (const CP_SocketInStream &obj)
Getters
virtual UInt32 GetLength () const
virtual UInt32 GetPosition () const
Setters
virtual void SetPosition (UInt32 inPosition)

Private Attributes

bool fIsAtEOF

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_SocketInStream::CP_SocketInStream class CP_Socket inSocket,
bool  inHasHeader = true
 

Constructor.

Parameters:
inSocket The CP_Socket to read data from.
inHasHeader Flag to indicate if the stream has a header.
Exceptions:
none 

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

Destructor.

Exceptions:
none 

CP_SocketInStream::CP_SocketInStream  )  [private]
 

CP_SocketInStream::CP_SocketInStream const CP_SocketInStream ob  )  [private]
 


Member Function Documentation

bool CP_SocketInStream::IsEOF  )  const [virtual]
 

Return true if our stream is at the end.

Exceptions:
none 
Returns:
bool const Return true if at end of stream.

Reimplemented from CP_InStream.

void CP_SocketInStream::Close  )  [virtual]
 

Close the input stream of our socket.

Exceptions:
none 
Returns:
void

UInt32 CP_SocketInStream::OnReadBytes void *  inDestBuffer,
UInt32  inNumberBytes
[protected, virtual]
 

Read inNumberBytes of data to the buffer pointed to by inDestBuffer from our stream. This function returns the actual number of bytes read from the socket.

Parameters:
inDestBuffer Points to the buffer we will write the data to.
inNumberBytes The number of bytes our client wants to read.
Exceptions:
none 
Returns:
bool const Return true if at end of stream.

Implements CP_InStream.

CP_SocketInStream& CP_SocketInStream::operator= const CP_SocketInStream obj  )  [private]
 

UInt32 CP_SocketInStream::GetLength  )  const [private, virtual]
 

Get the number of bytes our socket has available.

Exceptions:
none 
Returns:
UInt32 const Return length of socket data.

Implements CP_InStream.

UInt32 CP_SocketInStream::GetPosition  )  const [private, virtual]
 

Override, super class is irrelevant (we always return 0).

Exceptions:
none 
Returns:
UInt32 const Return 0.

Implements CP_InStream.

void CP_SocketInStream::SetPosition UInt32  inPosition  )  [private, virtual]
 

Override, super class is irrelevant.

Parameters:
inPosition Not used.
Exceptions:
none 
Returns:
void

Implements CP_InStream.

UInt32 CP_InStream::ReadBytes void *  inDestBuffer,
UInt32  inNumberBytes,
bool  inAllowPartialData = false
[virtual, inherited]
 

Reads some data from the stream. Used by the >> operators to read the data, but can also be used in an application.

Parameters:
inDestBuffer Location to read the data into.
inNumberBytes Length of the buffer to hold the data.
inAllowPartialData If true, less than the requested number of bytes may be read. Otherwise, if not enough data is available, an exception is raised.
Exceptions:
CP_OSErrorException(eofErr) raised if inAllowPartialData is false and not enough data can be read.
Returns:
UInt32 The number of bytes actually read. If inAllowPartialData is true, this may be less than the requested number of bytes.

bool CP_InStream::NeedsByteSwap  )  const [inherited]
 

void CP_InStream::SetNeedsByteSwap bool  doSwap  )  [inherited]
 

UInt16 CP_InStream::GetStreamVersion  )  const [inherited]
 

bool CP_InStream::HasHeader  )  const [inherited]
 

bool CP_InStream::HasTaggedData  )  const [inherited]
 

Returns true if the data type is written before each elemement. This is intended in debugging the stream data since it increases the size of the resulting stream.

Exceptions:
none 
Returns:
bool const True, if the stream has tags before each data element.

SInt32 CP_InStream::GetTag  )  [inherited]
 

Reads the tag before a data element if the streamed data has tagged data.

Exceptions:
none 
Returns:
SInt32 The tag being read.

void CP_InStream::ReadHeader  )  [protected, virtual, inherited]
 

Reads the header portion of our stream.

Exceptions:
none 
Returns:
void


Member Data Documentation

class CP_Socket& CP_SocketInStream::fSocket [protected]
 

bool CP_SocketInStream::fIsAtEOF [private]
 

bool CP_InStream::fHasReadHeader [protected, inherited]
 

bool CP_InStream::fNeedsByteSwap [protected, inherited]
 

Flag to indicate if we have read the header.

UInt16 CP_InStream::fCPLATStreamVersion [protected, inherited]
 

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

bool CP_InStream::fHasTaggedData [protected, inherited]
 

CPLAT stream version used to write this stream.

bool CP_InStream::fHasHeader [protected, inherited]
 

Flag to indicate if the data has its type written out also.

char CP_InStream::fDesiredEdian [protected, inherited]
 

Flag to indicate if we are want to read data not created by this framework and therefore won't have a correct header.


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