#include <Iguana/Utilities/classlib/zip/InteractiveCompressor.h>
This class can be used to run a Compressor on non-blocking input and/or output or when the Compressor should be ran interactively on limited amounts of data at a time.
This class processes both input and output in chunks, the upper limits of the chunk sizes for both input and output are given as constructor arguments. At most one full chunk of input or output data is processed at a time even if the streams could handle more.
A Compressor can consume arbitrary amounts of input before producing any output, and even a small amount of input can in the end produce large amounts of output. This class guarantees the partitioning of the input and output to at most the chunk sizes mentioned above, while at the same time remaining responsive to the maximum bandwiths of the input and output streams -- within the limits of the Compressor's abilities.
This class must be inherited from to implement the input and output notification scheme. On call to waitForInput() doInput() should be registered to handle the input becoming readable. Similarly on call to waitForOutput() doOutput() should be registered to handle the output becoming writable. (FIXME: Note on threading.)
Definition at line 46 of file InteractiveCompressor.h.
anonymous enum |
virtual lat::InteractiveCompressor::~InteractiveCompressor | ( | void | ) | [virtual] |
lat::InteractiveCompressor::InteractiveCompressor | ( | Compressor * | compressor, | |
InputStream * | input = 0 , |
|||
OutputStream * | output = 0 , |
|||
IOSize | inBufSize = DEFAULT_BUF_SIZE , |
|||
IOSize | outBufSize = DEFAULT_BUF_SIZE | |||
) | [protected] |
lat::InteractiveCompressor::InteractiveCompressor | ( | const InteractiveCompressor & | ) | [private] |
InteractiveCompressor& lat::InteractiveCompressor::operator= | ( | const InteractiveCompressor & | ) | [private] |
virtual void lat::InteractiveCompressor::setInputStream | ( | InputStream * | input | ) | [protected, virtual] |
virtual void lat::InteractiveCompressor::setOutputStream | ( | OutputStream * | output | ) | [protected, virtual] |
IOSize lat::InteractiveCompressor::m_bottom [protected] |
Definition at line 86 of file InteractiveCompressor.h.
Compressor* lat::InteractiveCompressor::m_compressor [protected] |
Definition at line 75 of file InteractiveCompressor.h.
unsigned char* lat::InteractiveCompressor::m_inBuf [protected] |
Definition at line 78 of file InteractiveCompressor.h.
IOSize lat::InteractiveCompressor::m_inBufSize [protected] |
Definition at line 79 of file InteractiveCompressor.h.
InputStream* lat::InteractiveCompressor::m_input [protected] |
Definition at line 77 of file InteractiveCompressor.h.
bool lat::InteractiveCompressor::m_inputting [protected] |
Definition at line 80 of file InteractiveCompressor.h.
IOSize lat::InteractiveCompressor::m_out [protected] |
Definition at line 85 of file InteractiveCompressor.h.
unsigned char* lat::InteractiveCompressor::m_outBuf [protected] |
Definition at line 83 of file InteractiveCompressor.h.
IOSize lat::InteractiveCompressor::m_outBufSize [protected] |
Definition at line 84 of file InteractiveCompressor.h.
OutputStream* lat::InteractiveCompressor::m_output [protected] |
Definition at line 82 of file InteractiveCompressor.h.
bool lat::InteractiveCompressor::m_outputting [protected] |
Definition at line 87 of file InteractiveCompressor.h.