CMS 3D CMS Logo

lat::InteractiveCompressor Class Reference

Non-blocking, incremental and interactive compressor front-end. More...

#include <Iguana/Utilities/classlib/zip/InteractiveCompressor.h>

List of all members.

Public Types

enum  { DEFAULT_BUF_SIZE = 4096 }

Public Member Functions

virtual void begin (void)
virtual ~InteractiveCompressor (void)

Protected Member Functions

virtual void compress (void)
virtual void doInput (void)
virtual void doOutput (void)
virtual void finish (void)
virtual bool flush (void)
 InteractiveCompressor (Compressor *compressor, InputStream *input=0, OutputStream *output=0, IOSize inBufSize=DEFAULT_BUF_SIZE, IOSize outBufSize=DEFAULT_BUF_SIZE)
virtual void setInputStream (InputStream *input)
virtual void setOutputStream (OutputStream *output)
virtual void waitForInput (void)
virtual void waitForOutput (void)

Protected Attributes

IOSize m_bottom
Compressorm_compressor
unsigned char * m_inBuf
IOSize m_inBufSize
InputStreamm_input
bool m_inputting
IOSize m_out
unsigned char * m_outBuf
IOSize m_outBufSize
OutputStreamm_output
bool m_outputting

Private Member Functions

 InteractiveCompressor (const InteractiveCompressor &)
InteractiveCompressoroperator= (const InteractiveCompressor &)


Detailed Description

Non-blocking, incremental and interactive compressor front-end.

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.


Member Enumeration Documentation

anonymous enum

Enumerator:
DEFAULT_BUF_SIZE 

Definition at line 49 of file InteractiveCompressor.h.

00049 { DEFAULT_BUF_SIZE = 4096 };


Constructor & Destructor Documentation

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]


Member Function Documentation

virtual void lat::InteractiveCompressor::begin ( void   )  [virtual]

virtual void lat::InteractiveCompressor::compress ( void   )  [protected, virtual]

virtual void lat::InteractiveCompressor::doInput ( void   )  [protected, virtual]

virtual void lat::InteractiveCompressor::doOutput ( void   )  [protected, virtual]

virtual void lat::InteractiveCompressor::finish ( void   )  [protected, virtual]

virtual bool lat::InteractiveCompressor::flush ( void   )  [protected, virtual]

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]

virtual void lat::InteractiveCompressor::waitForInput ( void   )  [protected, virtual]

virtual void lat::InteractiveCompressor::waitForOutput ( void   )  [protected, virtual]


Member Data Documentation

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.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:26 2009 for CMSSW by  doxygen 1.5.4