Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

IStream Class Reference

Bidirectional stream interface. More...

#include <IStream.h>

Inherits IInterface.

Inherited by CStreamFilter, and IDataSocket.

Inheritance diagram for IStream:

Inheritance graph
[legend]
Collaboration diagram for IStream:

Collaboration graph
[legend]
List of all members.

accessors

virtual void * getEventTarget () const =0
 Get event target.
virtual bool isReady () const =0
 Test if read() will succeed.
virtual UInt32 getSize () const =0
 Get bytes available to read.
CEvent::Type getInputReadyEvent ()
 Get input ready event type.
CEvent::Type getOutputFlushedEvent ()
 Get output flushed event type.
CEvent::Type getOutputErrorEvent ()
 Get output error event type.
CEvent::Type getInputShutdownEvent ()
 Get input shutdown event type.
CEvent::Type getOutputShutdownEvent ()
 Get output shutdown event type.

Public Member Functions

manipulators
virtual void close ()=0
 Close the stream.
virtual UInt32 read (void *buffer, UInt32 n)=0
 Read from stream.
virtual void write (const void *buffer, UInt32 n)=0
 Write to stream.
virtual void flush ()=0
 Flush the stream.
virtual void shutdownInput ()=0
 Shutdown input.
virtual void shutdownOutput ()=0
 Shutdown output.

Detailed Description

Bidirectional stream interface.

Defines the interface for all streams.

Definition at line 25 of file IStream.h.


Member Function Documentation

virtual void IStream::close  )  [pure virtual]
 

Close the stream.

Closes the stream. Pending input data and buffered output data are discarded. Use flush() before close() to send buffered output data. Attempts to read() after a close return 0, attempts to write() generate output error events, and attempts to flush() return immediately.

Implemented in CStreamFilter, CTCPSocket, IDataSocket, and CPacketStreamFilter.

Referenced by CStreamFilter::close().

virtual void IStream::flush  )  [pure virtual]
 

Flush the stream.

Waits until all buffered data has been written to the stream.

Implemented in CStreamFilter, CTCPSocket, and IDataSocket.

Referenced by CClientProxy::close(), and CStreamFilter::flush().

virtual void* IStream::getEventTarget  )  const [pure virtual]
 

Get event target.

Returns the event target for events generated by this stream. It should be the source stream in a chain of stream filters.

Implemented in CStreamFilter, CTCPSocket, and IDataSocket.

Referenced by CServerProxy::CServerProxy(), and CStreamFilter::CStreamFilter().

CEvent::Type IStream::getInputReadyEvent  )  [static]
 

Get input ready event type.

Returns the input ready event type. A stream sends this event when read() will return with data.

Definition at line 28 of file IStream.cpp.

References CEvent::registerTypeOnce().

Referenced by CPacketStreamFilter::filterEvent().

CEvent::Type IStream::getInputShutdownEvent  )  [static]
 

Get input shutdown event type.

Returns the input shutdown event type. This is sent when the input side of the stream has shutdown. When the input has shutdown, no more data will ever be available to read.

Definition at line 49 of file IStream.cpp.

References CEvent::registerTypeOnce().

Referenced by CPacketStreamFilter::filterEvent(), CPacketStreamFilter::read(), and CTCPSocket::shutdownInput().

CEvent::Type IStream::getOutputErrorEvent  )  [static]
 

Get output error event type.

Returns the output error event type. A stream sends this event when a write has failed.

Definition at line 42 of file IStream.cpp.

References CEvent::registerTypeOnce().

Referenced by CTCPSocket::write().

CEvent::Type IStream::getOutputFlushedEvent  )  [static]
 

Get output flushed event type.

Returns the output flushed event type. A stream sends this event when the output buffer has been flushed. If there have been no writes since the event was posted, calling shutdownOutput() or close() will not discard any data and flush() will return immediately.

Definition at line 35 of file IStream.cpp.

References CEvent::registerTypeOnce().

CEvent::Type IStream::getOutputShutdownEvent  )  [static]
 

Get output shutdown event type.

Returns the output shutdown event type. This is sent when the output side of the stream has shutdown. When the output has shutdown, no more data can ever be written to the stream. Any attempt to do so will generate a output error event.

Definition at line 56 of file IStream.cpp.

References CEvent::registerTypeOnce().

Referenced by CTCPSocket::shutdownOutput().

virtual UInt32 IStream::getSize  )  const [pure virtual]
 

Get bytes available to read.

Returns a conservative estimate of the available bytes to read (i.e. a number not greater than the actual number of bytes). Some streams may not be able to determine this and will always return zero.

Implemented in CStreamFilter, CTCPSocket, IDataSocket, and CPacketStreamFilter.

Referenced by CStreamFilter::getSize().

virtual bool IStream::isReady  )  const [pure virtual]
 

Test if read() will succeed.

Returns true iff an immediate read() will return data. This may or may not be the same as getSize() > 0, depending on the stream type.

Implemented in CStreamFilter, CTCPSocket, IDataSocket, and CPacketStreamFilter.

Referenced by CStreamFilter::isReady().

virtual UInt32 IStream::read void *  buffer,
UInt32  n
[pure virtual]
 

Read from stream.

Read up to n bytes into buffer, returning the number read (zero if no data is available or input is shutdown). buffer may be NULL in which case the data is discarded.

Implemented in CStreamFilter, CTCPSocket, IDataSocket, and CPacketStreamFilter.

Referenced by CStreamFilter::read().

virtual void IStream::shutdownInput  )  [pure virtual]
 

Shutdown input.

Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0.

Implemented in CStreamFilter, CTCPSocket, IDataSocket, and CPacketStreamFilter.

Referenced by CStreamFilter::shutdownInput().

virtual void IStream::shutdownOutput  )  [pure virtual]
 

Shutdown output.

Shutdown the output side of the stream. Any buffered output data is discarded and further writes generate output error events. Use flush() before shutdownOutput() to send buffered output data.

Implemented in CStreamFilter, CTCPSocket, and IDataSocket.

Referenced by CStreamFilter::shutdownOutput().

virtual void IStream::write const void *  buffer,
UInt32  n
[pure virtual]
 

Write to stream.

Write n bytes from buffer to the stream. If this can't complete immediately it will block. Data may be buffered in order to return more quickly. A output error event is generated when writing fails.

Implemented in CStreamFilter, CTCPSocket, IDataSocket, and CPacketStreamFilter.

Referenced by CStreamFilter::write(), and CPacketStreamFilter::write().


The documentation for this class was generated from the following files:
Generated on Fri Nov 6 00:21:38 2009 for synergy-plus by  doxygen 1.3.9.1