Class: TMessageStream

Declaration: MessageStream.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TStream

Inherited By:

TRequestSenderStream TRequestReceiverStream

Purpose:

TMessageStream is an abstract base class that provides a generic interface to the underlying communications channel. It provides streaming operators and member functions for positioning within the stream and sending its buffer contents.

Instantiation:

TMessageStream is an abstract class and cannot be instantiated.

Deriving Classes:

Deriving classes should override the member functions Abort and HandleAbort. However for release 1.0 no classes may be derived from TMessageStream.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TMessageStream::TMessageStream

  1. TMessageStream ()
  2. TMessageStream (const TMessageStream & clone)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by derived classes.
  2. Called 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: TMessageStream::~TMessageStream

virtual ~ TMessageStream ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called 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: TMessageStream::Open

void Open ()

Interface Category:

API.

Purpose:

Prepares this stream for communicating by allocating resources to the stream. Calls the protected member function HandleOpen.

Calling Context:

Called to prepare a stream for communicating. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::operator=

TMessageStream & operator =(const TMessageStream & clone)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

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

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns a hash value for this stream.

Calling Context:

Called to return a hash value for this stream. Call this function directly.

Parameters:

Return Value:

The hash value for this stream.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::GetSuggestedAutoFlushThreshold

virtual size_t GetSuggestedAutoFlushThreshold ()

Interface Category:

API.

Purpose:

Queries the underlying transport to see if it has any preference for message size that it prefers to be used with the auto-flush threshold.

Calling Context:

Called to return the underlying transport's preference for message size to be used with the auto-flush threshold. Call this function directly.

Parameters:

Return Value:

The threshold.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::SetAutoFlushThreshold

virtual void SetAutoFlushThreshold (size_t threshold)

Interface Category:

API.

Purpose:

Sets the buffer threshold for automatic sending of data. When the stream's buffer is filled to this threshold, the contents of the buffer will automatically be sent.

Calling Context:

Called to set the threshold for the automatic sending of data written to this stream. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::GetAutoFlushThreshold

virtual size_t GetAutoFlushThreshold ()

Interface Category:

API.

Purpose:

Returns the threshold that has been set for the automatic sending of this stream's buffer.

Calling Context:

Called to return the threshold that has been set for the automatic sending of this stream's buffer. Call this function directly.

Parameters:

Return Value:

The threshold that has been set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::SetRequiredMinBufferSize

virtual void SetRequiredMinBufferSize (size_t minSize)

Interface Category:

API.

Purpose:

Sets the minimum buffer size for this stream.

Calling Context:

Called to set the minimum buffer size for this stream. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::GetRequiredMinBufferSize

virtual size_t GetRequiredMinBufferSize ()

Interface Category:

API.

Purpose:

Returns the minimum buffer size that has been set for this stream.

Calling Context:

Called to return the minimum buffer size that has been set for this stream. Call this function directly.

Parameters:

Return Value:

The minimum buffer size that has been set for this stream.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::GetMaxSendBufferSize

virtual size_t GetMaxSendBufferSize ()

Interface Category:

API.

Purpose:

Returns the maximum buffer size that has been set for this stream.

Calling Context:

Called to return the maximum buffer size that has been set for this stream. Call this function directly.

Parameters:

Return Value:

The maximum buffer size that has been set for this stream.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::HandleOpen

virtual void HandleOpen ()

Interface Category:

API.

Purpose:

A protected member function that prepares this stream for communicating.

Calling Context:

Called by the member function Open.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Any derived class that overrides this should begin by calling the HandleOpen member function of its base class, and then do any additional initialization.

Member Function: TMessageStream::AllocateForWrite

virtual void AllocateForWrite (StreamPosition desiredByteCount)

Interface Category:

API.

Purpose:

Allocates the desired number of bytes in the buffer to the user.

Calling Context:

Called to empty the buffer so that it can be used to hold new data. Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::AllocateForRead

virtual void AllocateForRead (StreamPosition desiredByteCount)

Interface Category:

API.

Purpose:

Receives more data into the buffer so that more data can be read from the buffer.

Calling Context:

Called to fill an empty buffer so that more data can be read from it. Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::HandleWriteBufferFull

virtual void HandleWriteBufferFull (const void * data, size_t dataLength)

Interface Category:

API.

Purpose:

Sends all the data in the buffer when the buffer becomes filled, then attempts to write new data into the buffer.

Calling Context:

Called to empty the buffer so that it can be used to hold new data. Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::Abort

virtual void Abort ()

Interface Category:

API.

Purpose:

Sends the current buffer and causes the receiver's side to call its member function HandleAbort.

Calling Context:

Called to abort the current transaction. Called by Derived Classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageStream::HandleAbort

virtual void HandleAbort ()

Interface Category:

API.

Purpose:

Deriving classes should override this member function. The default implementation has no effect.

Calling Context:

Called when a request to abort the current transaction is received. Called by Derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Deriving classes should override this member function.

Member Function: TMessageStream::GetReadOnly

virtual bool GetReadOnly () const

Interface Category:

API.

Purpose:

Returns true if this stream can only be read and not written. This member function will always return false and is here only because TMessageStream's base class requires that it be present.

Calling Context:

Called to determine if this stream can only be read and not written. Call this function directly.

Parameters:

Return Value:

Always returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.