#include <CStreamFilter.h>
Inherits IStream.
Inherited by CPacketStreamFilter.
Inheritance diagram for CStreamFilter:
Public Member Functions | |
CStreamFilter (IStream *stream, bool adoptStream=true) | |
virtual void | close () |
Close the stream. | |
virtual UInt32 | read (void *buffer, UInt32 n) |
Read from stream. | |
virtual void | write (const void *buffer, UInt32 n) |
Write to stream. | |
virtual void | flush () |
Flush the stream. | |
virtual void | shutdownInput () |
Shutdown input. | |
virtual void | shutdownOutput () |
Shutdown output. | |
virtual void * | getEventTarget () const |
Get event target. | |
virtual bool | isReady () const |
Test if read() will succeed. | |
virtual UInt32 | getSize () const |
Get bytes available to read. | |
Protected Member Functions | |
IStream * | getStream () const |
Get the stream. | |
virtual void | filterEvent (const CEvent &) |
Handle events from source stream. |
This class wraps a stream. Subclasses provide indirect access to the wrapped stream, typically performing some filtering.
Definition at line 25 of file CStreamFilter.h.
|
Create a wrapper around Definition at line 23 of file CStreamFilter.cpp. References IStream::getEventTarget(). |
|
Close the stream.
Closes the stream. Pending input data and buffered output data are discarded. Use Implements IStream. Reimplemented in CPacketStreamFilter. Definition at line 43 of file CStreamFilter.cpp. References IStream::close(), and getStream(). Referenced by CPacketStreamFilter::close(). |
|
Handle events from source stream. Does the event filtering. The default simply dispatches an event identical except using this object as the event target. Reimplemented in CPacketStreamFilter. Definition at line 103 of file CStreamFilter.cpp. References CEvent::getData(), getEventTarget(), and CEvent::getType(). Referenced by CPacketStreamFilter::filterEvent(). |
|
Flush the stream. Waits until all buffered data has been written to the stream. Implements IStream. Definition at line 61 of file CStreamFilter.cpp. References IStream::flush(), and getStream(). |
|
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. Implements IStream. Definition at line 79 of file CStreamFilter.cpp. Referenced by filterEvent(), and CPacketStreamFilter::read(). |
|
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. Implements IStream. Reimplemented in CPacketStreamFilter. Definition at line 91 of file CStreamFilter.cpp. References IStream::getSize(), and getStream(). |
|
Get the stream. Returns the stream passed to the c'tor. Definition at line 97 of file CStreamFilter.cpp. Referenced by close(), flush(), getSize(), isReady(), read(), shutdownInput(), shutdownOutput(), write(), and CPacketStreamFilter::write(). |
|
Test if
Returns true iff an immediate Implements IStream. Reimplemented in CPacketStreamFilter. Definition at line 85 of file CStreamFilter.cpp. References getStream(), and IStream::isReady(). |
|
Read from stream.
Read up to Implements IStream. Reimplemented in CPacketStreamFilter. Definition at line 49 of file CStreamFilter.cpp. References getStream(), and IStream::read(). |
|
Shutdown input. Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0. Implements IStream. Reimplemented in CPacketStreamFilter. Definition at line 67 of file CStreamFilter.cpp. References getStream(), and IStream::shutdownInput(). Referenced by CPacketStreamFilter::shutdownInput(). |
|
Shutdown output.
Shutdown the output side of the stream. Any buffered output data is discarded and further writes generate output error events. Use Implements IStream. Definition at line 73 of file CStreamFilter.cpp. References getStream(), and IStream::shutdownOutput(). |
|
Write to stream.
Write Implements IStream. Reimplemented in CPacketStreamFilter. Definition at line 55 of file CStreamFilter.cpp. References getStream(), and IStream::write(). |