Class: TStream

Declaration: Stream.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TMessageStream TRandomAccessStream

Purpose:

An abstract class that provides operators for reading and writing data structures to and from a stream. A stream is an abstraction that can accept and provide serial binary data. A stream can represent memory, a message stream, a disk file, or other concrete objects.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TStream is an abstract class and must be derived to be used.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TStream::~TStream

virtual ~ TStream ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Call this function directly to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::Flush

virtual void Flush ()

Interface Category:

API.

Purpose:

Flushes the buffer associated with the stream. This is a virtual function whose behavior is determined by the derived class. If the default class does not define this function, the default behavior does nothing.

Calling Context:

Call this function directly to flush the buffer associated with the stream.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetReadOnly

virtual bool GetReadOnly () const

Interface Category:

API.

Purpose:

Returns an indication of whether or not this stream is read-only. If the default class does not define this function, the default behavior is to return false.

Calling Context:

Call this function directly to determine if this stream is read-only.

Parameters:

Return Value:

Returns true if the stream is read-only.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetFreezeLevel

void SetFreezeLevel (FreezeLevel theFreezeLevel)

Interface Category:

API.

Purpose:

Sets the freeze level for this object, which determines how much information is placed on the stream when the object is flattened.

Calling Context:

Call this function directly to set the freeze level for this object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetFreezeLevel

FreezeLevel GetFreezeLevel () const

Interface Category:

API.

Purpose:

Returns the freeze level set for this object.

Calling Context:

Call this function directly to return the freeze level set for this object.

Parameters:

Return Value:

The freeze level, which is kSameTeam, kSameSession, or kDeepFreeze.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::operator>>=

virtual TStream & operator >>=(TStream & towhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Call this function directly to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::operator<<=

virtual TStream & operator <<= (TStream & towhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Call this function directly to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::Read

  1. TStream & Read (void * addr, size_t howmuch)
  2. TStream & Read (char * c)
  3. TStream & Read (signed char & c)
  4. TStream & Read (unsigned char & c)
  5. TStream & Read (short & c)
  6. TStream & Read (unsigned short & c)
  7. TStream & Read (long & c)
  8. TStream & Read (unsigned long & c)
  9. TStream & Read (float & c)
  10. TStream & Read (double & c)
  11. TStream & Read (signed char c [], size_t count)
  12. TStream & Read (unsigned char c [], size_t count)
  13. TStream & Read (short c [], size_t count)
  14. TStream & Read (unsigned short c [], size_t count)
  15. TStream & Read (long c [], size_t count)
  16. TStream & Read (unsigned long c [], size_t count)
  17. TStream & Read (float c [], size_t count)
  18. TStream & Read (double c [], size_t count)
  19. virtual void Read (TStream & toStream, StreamPosition lengthFromMe)

Interface Category:

API.

Purpose:

All of these operators read specific data types from this stream.

Calling Context:

Each operator is called directly to read a specific data type from this stream.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::Write

  1. TStream & Write (const void * addr, size_t howmuch)
  2. TStream & Write (const char * c)
  3. TStream & Write (signed char c)
  4. TStream & Write (unsigned char c)
  5. TStream & Write (short c)
  6. TStream & Write (unsigned short c)
  7. TStream & Write (long c)
  8. TStream & Write (unsigned long c)
  9. TStream & Write (float c)
  10. TStream & Write (double c)
  11. TStream & Write (const signed char c [], size_t count)
  12. TStream & Write (const unsigned char c [], size_t count)
  13. TStream & Write (const short c [], size_t count)
  14. TStream & Write (const unsigned short c [], size_t count)
  15. TStream & Write (const long c [], size_t count)
  16. TStream & Write (const unsigned long c [], size_t count)
  17. TStream & Write (const float c [], size_t count)
  18. TStream & Write (const double c [], size_t count)
  19. virtual void Write (TStream & fromStream, StreamPosition lengthFromStream)

Interface Category:

API.

Purpose:

All of these operators write specific data types to this stream.

Calling Context:

Each operator is called directly to write a specific data type to this stream.

Parameters:

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadCompressed

  1. TStream & ReadCompressed (short & c)
  2. TStream & ReadCompressed (unsigned short & c)
  3. TStream & ReadCompressed (long & c)
  4. TStream & ReadCompressed (unsigned long & c)
  5. TStream & ReadCompressed (float & c)
  6. TStream & ReadCompressed (double & c)

Interface Category:

API.

Purpose:

All of these operators read from this stream a specific data type that has been compressed with WriteCompressed.

Calling Context:

Call this function directly to read a specific data type from the stream and uncompress it.

Parameters:

Return Value:

Returns a reference to this stream.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteCompressed

  1. TStream & WriteCompressed (short c)
  2. TStream & WriteCompressed (unsigned short c)
  3. TStream & WriteCompressed (long c)
  4. TStream & WriteCompressed (unsigned long c)
  5. TStream & WriteCompressed (float c)
  6. TStream & WriteCompressed (double c)

Interface Category:

API.

Purpose:

All of these operators compress a specific data type and write it to the stream.

Calling Context:

Call this function directly to write a specific data type in a compressed form.

Parameters:

Return Value:

Returns a reference to this stream.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Data written with WriteCompressed must be read with ReadCompressed.

Member Function: TStream::TStream

  1. TStream (BufferPointer bufferStart, size_t howmuch)
  2. TStream ()
  3. TStream (const TStream & s)

Interface Category:

API.

Purpose:

  1. Creates a stream with the buffer set to the location provided.
  2. Default constructor.
  3. Copy constructor.

Calling Context:

  1. Call this function directly to create a stream with a specified buffer.
  2. Call this function directly anywhere the creation of a TStream is desired.
  3. Call this function directly to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::operator=

const TStream & operator =(const TStream &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function directly when an object is assigned to another compatible object.

Parameters:

Return Value:

A pointer to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetBufferWasModified

void SetBufferWasModified (bool modified =true)

Interface Category:

API.

Purpose:

Sets fBufferModified to the supplied value.

Calling Context:

Call this function directly to set the state of the stream buffer to indicate that it has or has not been modified.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetBufferWasModified

bool GetBufferWasModified () const

Interface Category:

API.

Purpose:

Returns the value of fBufferModified.

Calling Context:

Call this function directly to determine if the stream's buffer has been modified.

Parameters:

Return Value:

Returns true if the stream buffer has been modified.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetReadBufferPointer

BufferPointer GetReadBufferPointer () const

Interface Category:

API.

Purpose:

Returns the read buffer pointer for this stream.

Calling Context:

Call this function directly to obtain the read buffer pointer for this stream.

Parameters:

Return Value:

A pointer to the read buffer pointer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetReadBufferPointer

void SetReadBufferPointer (BufferPointer readBufferPointer)

Interface Category:

API.

Purpose:

Sets the read buffer pointer for this stream to the specified argument.

Calling Context:

Call this function directly to set the read buffer pointer for this stream.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::IncrementReadBufferPointer

void IncrementReadBufferPointer (size_t howmuch)

Interface Category:

API.

Purpose:

Increments the read buffer pointer for this stream.

Calling Context:

Call this function directly to adjust this stream's read buffer pointer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetWriteBufferPointer

BufferPointer GetWriteBufferPointer () const

Interface Category:

API.

Purpose:

Returns the write buffer pointer for this stream.

Calling Context:

Call this function directly to obtain the write buffer pointer for this stream.

Parameters:

Return Value:

A pointer to the write buffer pointer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetWriteBufferPointer

void SetWriteBufferPointer (BufferPointer writeBufferPointer)

Interface Category:

API.

Purpose:

Sets the write buffer pointer for this stream to the specified argument.

Calling Context:

Call this function directly to set the write buffer pointer for this stream.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::IncrementWriteBufferPointer

void IncrementWriteBufferPointer (size_t howmuch)

Interface Category:

API.

Purpose:

Increments the write buffer pointer for this stream.

Calling Context:

Call this function directly to adjust this stream's write buffer pointer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetLogicalEndOfBuffer

BufferPointer GetLogicalEndOfBuffer () const

Interface Category:

API.

Purpose:

Returns the logical end of buffer for this stream.

Calling Context:

Call this function directly to get the logical end of buffer.

Parameters:

Return Value:

A pointer to the logical end of buffer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetLogicalEndOfBuffer

void SetLogicalEndOfBuffer (BufferPointer logicalEndOfBufferPointer)

Interface Category:

API.

Purpose:

Sets the logical end of buffer for this stream.

Calling Context:

Call this function directly to set the logical end of buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetPhysicalEndOfBuffer

BufferPointer GetPhysicalEndOfBuffer () const

Interface Category:

API.

Purpose:

Returns the physical end of buffer for this stream.

Calling Context:

Call this function directly to get the physical end of buffer.

Parameters:

Return Value:

A pointer to the physical end of buffer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetPhysicalEndOfBuffer

void SetPhysicalEndOfBuffer (BufferPointer physicalEndOfBufferPointer)

Interface Category:

API.

Purpose:

Sets the physical end of buffer for this stream.

Calling Context:

Call this function directly to set the physical end of buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SetBuffer

void SetBuffer (BufferPointer startOfBuffer, StreamPosition offsetOfStart)

Interface Category:

API.

Purpose:

Sets the buffer and buffer offset for this stream.

Calling Context:

Call this function directly to set the buffer and buffer offset for this stream.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetStartOfBuffer

BufferPointer GetStartOfBuffer () const

Interface Category:

API.

Purpose:

Returns the start of buffer for this stream.

Calling Context:

Call this function directly to obtain the start of buffer for this stream. This is the value that was last passed to the function SetBuffer.

Parameters:

Return Value:

A pointer to the start of the buffer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::GetOffsetOfStartOfBuffer

StreamPosition GetOffsetOfStartOfBuffer () const

Interface Category:

API.

Purpose:

Returns the start of buffer offset for this stream.

Calling Context:

Call this function directly to obtain the start of buffer offset for this stream. This is the value that was last passed to the function SetBuffer.

Parameters:

Return Value:

A pointer to the offset to the start of buffer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::HandleBufferFull

  1. virtual void HandleBufferFull (signed char c)
  2. virtual void HandleBufferFull (unsigned char c)
  3. virtual void HandleBufferFull (short c)
  4. virtual void HandleBufferFull (unsigned short c)
  5. virtual void HandleBufferFull (long c)
  6. virtual void HandleBufferFull (unsigned long c)
  7. virtual void HandleBufferFull (float c)
  8. virtual void HandleBufferFull (double c)
  9. virtual void HandleBufferFull (const short c [], size_t count)
  10. virtual void HandleBufferFull (const unsigned short c [], size_t count)
  11. virtual void HandleBufferFull (const long c [], size_t count)
  12. virtual void HandleBufferFull (const unsigned long c [], size_t count)
  13. virtual void HandleBufferFull (const float c [], size_t count)
  14. virtual void HandleBufferFull (const double c [], size_t count)

Interface Category:

API.

Purpose:

All of these member functions handle the buffer full condition for this stream by allocating additional storage for the buffer.

Calling Context:

Call this function directly during write operations when there is no more room in this stream's write buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::HandleBufferEmpty

  1. virtual void HandleBufferEmpty (signed char & c)
  2. virtual void HandleBufferEmpty (unsigned char & c)
  3. virtual void HandleBufferEmpty (short & c)
  4. virtual void HandleBufferEmpty (unsigned short & c)
  5. virtual void HandleBufferEmpty (long & c)
  6. virtual void HandleBufferEmpty (unsigned long & c)
  7. virtual void HandleBufferEmpty (float & c)
  8. virtual void HandleBufferEmpty (double & c)
  9. virtual void HandleBufferEmpty (short c [], size_t count)
  10. virtual void HandleBufferEmpty (unsigned short c [], size_t count)
  11. virtual void HandleBufferEmpty (long c [], size_t count)
  12. virtual void HandleBufferEmpty (unsigned long c [], size_t count)
  13. virtual void HandleBufferEmpty (float c [], size_t count)
  14. virtual void HandleBufferEmpty (double c [], size_t count)

Interface Category:

API.

Purpose:

All of these member functions handle the buffer empty condition for this stream by reading more of the appropriate type of data from the stream into the buffer.

Calling Context:

Call this function directly during read operations when the buffer for this stream is empty.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::BytesToLong

static long BytesToLong (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to a long.

Calling Context:

Call this function directly to convert a string of bytes to a long.

Parameters:

Return Value:

The converted long value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The data to be converted should be aligned according to rules of your platform's architecture.

Member Function: TStream::BytesToShort

static short BytesToShort (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to a short.

Calling Context:

Call this function directly to convert a string of bytes to a short.

Parameters:

Return Value:

The converted short value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The data to be converted should be aligned according to rules of your platform's architecture.

Member Function: TStream::BytesToSignedChar

static signed char BytesToSignedChar (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to a signed char.

Calling Context:

Call this function directly to convert a bytes to a signed char.

Parameters:

Return Value:

The converted signed char value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::BytesToUnsignedLong

static unsigned long BytesToUnsignedLong (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to an unsigned long.

Calling Context:

Call this function directly to convert a string of bytes to an unsigned long.

Parameters:

Return Value:

The converted unsigned long value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The data to be converted should be aligned according to rules of your platform's architecture.

Member Function: TStream::BytesToUnsignedShort

static unsigned short BytesToUnsignedShort (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to an unsigned short.

Calling Context:

Call this function directly to convert a string of bytes to an unsigned short.

Parameters:

Return Value:

The converted unsigned short value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The data to be converted should be aligned according to rules of your platform's architecture.

Member Function: TStream::BytesToUnsignedChar

static unsigned char BytesToUnsignedChar (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to an unsigned char.

Calling Context:

Call this function directly to convert a byte to an unsigned char.

Parameters:

Return Value:

The converted long value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::BytesToDouble

static double BytesToDouble (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to a double.

Calling Context:

Call this function directly to convert a string of bytes to a double.

Parameters:

Return Value:

The converted double value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The data to be converted should be aligned according to rules of your platform's architecture.

Member Function: TStream::BytesToFloat

static float BytesToFloat (const void * addr)

Interface Category:

API.

Purpose:

Converts a string of bytes in memory to a float.

Calling Context:

Call this function directly to convert a string of bytes to a float.

Parameters:

Return Value:

The converted float value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The data to be converted should be aligned according to rules of your platform's architecture.

Member Function: TStream::LongToBytes

static void LongToBytes (void * addr, long c)

Interface Category:

API.

Purpose:

Converts a long to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert a long to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ShortToBytes

static void ShortToBytes (void * addr, short c)

Interface Category:

API.

Purpose:

Converts a short to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert a short to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SignedCharToBytes

static void SignedCharToBytes (void * addr, signed char c)

Interface Category:

API.

Purpose:

Converts a signed char to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert a signed char to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::UnsignedLongToBytes

static void UnsignedLongToBytes (void * addr, unsigned long c)

Interface Category:

API.

Purpose:

Converts an unsigned long to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert an unsigned long to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::UnsignedCharToBytes

static void UnsignedCharToBytes (void * addr, unsigned char c)

Interface Category:

API.

Purpose:

Converts an unsigned char to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert an unsigned char to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::DoubleToBytes

static void DoubleToBytes (void * addr, double c)

Interface Category:

API.

Purpose:

Converts a double to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert a double to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::FloatToBytes

static void FloatToBytes (void * addr, float c)

Interface Category:

API.

Purpose:

Converts a float to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert a float to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadOneByte

static unsigned char ReadOneByte (const void * addr)

Interface Category:

API.

Purpose:

Reads one byte.

Calling Context:

Call this function directly to read one byte.

Parameters:

Return Value:

The byte read.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteOneByte

static void WriteOneByte (void * addr, unsigned char c)

Interface Category:

API.

Purpose:

Writes one byte.

Calling Context:

Call this function directly to write one byte.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadTwoBEBytes

static unsigned short ReadTwoBEBytes (const void * addr)

Interface Category:

API.

Purpose:

Reads two big endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read two bytes stored in big endian representation.

Parameters:

Return Value:

The two bytes as an unsigned short.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteTwoBEBytes

static void WriteTwoBEBytes (void * addr, unsigned short c)

Interface Category:

API.

Purpose:

Writes two big endian aligned bytes.

Calling Context:

Call this function directly to write two big endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadFourBEBytes

static unsigned long ReadFourBEBytes (const void * addr)

Interface Category:

API.

Purpose:

Reads four big endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read four bytes stored in big endian representation.

Parameters:

Return Value:

The four bytes as an unsigned long.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteFourBEBytes

static void WriteFourBEBytes (void * addr, unsigned long c)

Interface Category:

API.

Purpose:

Writes four big endian aligned bytes.

Calling Context:

Call this function directly to write four big endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadTwoLEBytes

static unsigned short ReadTwoLEBytes (const void * addr)

Interface Category:

API.

Purpose:

Reads two little endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read two bytes stored in little endian representation.

Parameters:

Return Value:

The two bytes as an unsigned short.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteTwoLEBytes

static void WriteTwoLEBytes (void * addr, unsigned short c)

Interface Category:

API.

Purpose:

Writes two little endian aligned bytes.

Calling Context:

Call this function directly to write two little endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadFourLEBytes

static unsigned long ReadFourLEBytes (const void * addr)

Interface Category:

API.

Purpose:

Reads four little endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read four bytes stored in little endian representation.

Parameters:

Return Value:

The four bytes as an unsigned long.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteFourLEBytes

static void WriteFourLEBytes (void * addr, unsigned long c)

Interface Category:

API.

Purpose:

Writes four little endian aligned bytes.

Calling Context:

Call this function directly to write four little endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteEightLEBytes

static void WriteEightLEBytes (void * addr, double c)

Interface Category:

API.

Purpose:

Writes eight little endian aligned bytes.

Calling Context:

Call this function directly to write eight little endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadEightLEBytes

static double ReadEightLEBytes (const void * addr)

Interface Category:

API.

Purpose:

Reads eight little endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read eight bytes stored in little endian representation.

Parameters:

Return Value:

The eight bytes as a double.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::WriteEightBEBytes

static void WriteEightBEBytes (void * addr, double c)

Interface Category:

API.

Purpose:

Writes eight big endian aligned bytes.

Calling Context:

Call this function directly to write eight big endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::ReadEightBEBytes

static double ReadEightBEBytes (const void * addr)

Interface Category:

API.

Purpose:

Reads eight big endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read eight bytes stored in big endian representation.

Parameters:

Return Value:

The eight bytes as a double.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::AllocateForRead

virtual void AllocateForRead (StreamPosition desiredByteCount)

Interface Category:

API.

Purpose:

Pure virtual function for increasing the storage provided by the read buffer. The behavior of this operator is defined by the derived class.

Calling Context:

Call this function directly to increase the storage provided by the read buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::AllocateForWrite

virtual void AllocateForWrite (StreamPosition desiredByteCount)

Interface Category:

API.

Purpose:

A pure virtual function for increasing the storage provided by the write buffer. The behavior of this operator is defined by the derived class.

Calling Context:

Call this function directly to increase the storage provided by the write buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::SkipReading

virtual void SkipReading (StreamPosition bytesToSkip)

Interface Category:

API.

Purpose:

Moves ahead in the read buffer by the specified number of bytes. AllocateForWrite is called if the number of bytes to skip goes beyond what is in the buffer.

Calling Context:

Call this function directly to skip ahead in the read buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

If the read buffer size must be increased, the function AllocateForRead is called.

Member Function: TStream::UnsignedShortToBytes

static void UnsignedShortToBytes (void * addr, unsigned short c)

Interface Category:

API.

Purpose:

Converts an unsigned short to a sequence of bytes in memory.

Calling Context:

Call this function directly to convert an unsigned short to a sequence of bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStream::HandleWriteBufferFull

virtual void HandleWriteBufferFull (const void * c, size_t len)

Interface Category:

API.

Purpose:

Handle writing of data when the data is in Taligent canonical format but won't fit in this stream's write buffer.

Calling Context:

Call this function directly during write operations when data which is in Taligent canonical format is ready to be written but won't fit in this stream's write buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This member function can be overridden by derived classes to detect writes of large amounts of data and handle it without moving it to the buffer. It can also be used to implement a derived class of TStream which has no internal buffer.

Member Function: TStream::HandleReadBufferEmpty

virtual void HandleReadBufferEmpty (void * c, size_t len)

Interface Category:

API.

Purpose:

Handle reading of data when the data is in Taligent canonical format but isn't available in this stream's read buffer.

Calling Context:

Call this function directly during read operations when data which is in Taligent canonical format needs to be read but isn't available in this stream's write buffer.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This member function can be overridden by derived classes to detect reads of large amounts of data and handle it without moving it from the buffer. It can also be used to implement a derived class of TStream which has no internal buffer.

Member Function: TStream::NewWriteFourBEBytes

static void NewWriteFourBEBytes (void * intoBuffer, void * dataFrom)

Interface Category:

API.

Purpose:

Writes four big endian aligned bytes.

Calling Context:

Call this function directly to write four big endian bytes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is similar to function WriteFourBEBytes, but does not have a problem with optimization.

Member Function: TStream::NewReadFourBEBytes

static void NewReadFourBEBytes (const void * readFrom, void * writeTo)

Interface Category:

API.

Purpose:

Reads four big endian aligned bytes from this specified location.

Calling Context:

Call this function directly to read four bytes stored in big endian representation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is similar to function ReadFourBEBytes, but does not have a problem with optimization.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.