CMS 3D CMS Logo

ZCompressor.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_Z_COMPRESSOR_H
00002 # define CLASSLIB_Z_COMPRESSOR_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/zip/Compressor.h"
00007 # include "classlib/zip/ZConstants.h"
00008 
00009 namespace lat {
00010 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00011 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00012 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00013 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00014 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00015 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00016 
00018 class ZCompressor : public Compressor, public ZConstants
00019 {
00020 public:
00021     // nowrap -> no zlib header, checksum
00022     ZCompressor (unsigned level = DEFAULT_COMPRESSION, bool wrap = false);
00023     ~ZCompressor (void);
00024 
00025     // Global compressor state
00026     virtual void        dictionary (void *buffer, IOSize length);
00027     virtual unsigned    level (void) const;
00028     virtual void        level (unsigned level);
00029     virtual void        reset (void);
00030     virtual void        end (void);
00031 
00032     // Input management
00033     virtual bool        more (void) const;
00034     virtual void        input (const void *buffer, IOSize length);
00035     virtual void        finish (void);
00036     virtual void        flush (void);
00037     // virtual IOSize   rest (void) const;
00038 
00039     // Compression
00040     virtual bool        finished (void) const;
00041     virtual bool        flushed (void) const;
00042     virtual IOSize      compress (void *into, IOSize length);
00043 
00044     // Statistics
00045     virtual unsigned    checksum (void) const;
00046     virtual IOOffset    in (void) const;
00047     virtual IOOffset    out (void) const;
00048 
00049 private:
00050     struct Stream;
00051     Stream              *m_stream;      //< ZLIB state, null if not initialised
00052     int                 m_level;
00053     int                 m_strategy;
00054     int                 m_method;
00055     int                 m_window;
00056     int                 m_mem;
00057     bool                m_wrap;
00058     int                 m_action;
00059     int                 m_state;
00060 
00061     // no semantics, undefined
00062     ZCompressor (const ZCompressor &other);
00063     ZCompressor &operator= (const ZCompressor &other);
00064 };
00065 
00066 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00067 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00068 
00069 } // namespace lat
00070 #endif // CLASSLIB_Z_COMPRESSOR_H

Generated on Tue Jun 9 17:39:00 2009 for CMSSW by  doxygen 1.5.4