#include <CPacketStreamFilter.h>
Inherits CStreamFilter.
Inheritance diagram for CPacketStreamFilter:
Public Member Functions | |
CPacketStreamFilter (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 | shutdownInput () |
Shutdown input. | |
virtual bool | isReady () const |
Test if read() will succeed. | |
virtual UInt32 | getSize () const |
Get bytes available to read. | |
Protected Member Functions | |
virtual void | filterEvent (const CEvent &) |
Handle events from source stream. |
Filters a stream to read and write packets.
Definition at line 26 of file CPacketStreamFilter.h.
|
Close the stream.
Closes the stream. Pending input data and buffered output data are discarded. Use Reimplemented from CStreamFilter. Definition at line 40 of file CPacketStreamFilter.cpp. References CStreamFilter::close(), CStreamBuffer::getSize(), and CStreamBuffer::pop(). |
|
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 from CStreamFilter. Definition at line 173 of file CPacketStreamFilter.cpp. References CStreamFilter::filterEvent(), IStream::getInputReadyEvent(), IStream::getInputShutdownEvent(), and CEvent::getType(). |
|
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. Reimplemented from CStreamFilter. Definition at line 118 of file CPacketStreamFilter.cpp. |
|
Test if
Returns true iff an immediate Reimplemented from CStreamFilter. Definition at line 111 of file CPacketStreamFilter.cpp. |
|
Read from stream.
Read up to Reimplemented from CStreamFilter. Definition at line 49 of file CPacketStreamFilter.cpp. References CStreamFilter::getEventTarget(), IStream::getInputShutdownEvent(), CStreamBuffer::peek(), and CStreamBuffer::pop(). |
|
Shutdown input. Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0. Reimplemented from CStreamFilter. Definition at line 102 of file CPacketStreamFilter.cpp. References CStreamBuffer::getSize(), CStreamBuffer::pop(), and CStreamFilter::shutdownInput(). |
|
Write to stream.
Write Reimplemented from CStreamFilter. Definition at line 87 of file CPacketStreamFilter.cpp. References CStreamFilter::getStream(), and IStream::write(). |