Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Compressor_ZLib Class Reference
Inheritance diagram for Compressor_ZLib:
Collaboration diagram for Compressor_ZLib:

Public Member Functions

 Compressor_ZLib ()
 
virtual ~Compressor_ZLib ()
 
virtual size_t MaxOutputSize (size_t inSize) const
 
virtual Status Reset ()
 clear all previous state and prepare for reuse. More...
 
virtual Status Process (const u8 *in, size_t inSize, u8 *out, size_t outSize, size_t &inConsumed, size_t &outProduced)
 process (i.e. More...
 
virtual Status Finish (u32 &checksum, size_t &outProduced)
 Flush buffers and make sure all output has been produced. More...
 
- Public Member Functions inherited from Codec_ZLib
u32 UpdateChecksum (u32 checksum, const u8 *in, size_t inSize) const
 update a checksum to reflect the contents of a buffer. More...
 
- Public Member Functions inherited from ICodec
virtual ~ICodec ()
 note: the implementation should not check whether any data remains - codecs are sometimes destroyed without completing a transfer. More...
 
virtual size_t MaxOutputSize (size_t inSize) const =0
 
virtual Status Reset ()=0
 clear all previous state and prepare for reuse. More...
 
virtual Status Process (const u8 *in, size_t inSize, u8 *out, size_t outSize, size_t &inConsumed, size_t &outProduced)=0
 process (i.e. More...
 
virtual Status Finish (u32 &checksum, size_t &outProduced)=0
 Flush buffers and make sure all output has been produced. More...
 
virtual u32 UpdateChecksum (u32 checksum, const u8 *in, size_t inSize) const =0
 update a checksum to reflect the contents of a buffer. More...
 

Additional Inherited Members

- Protected Types inherited from CodecZLibStream
typedef int ZEXPORT(* ZLibFunc) (z_streamp strm, int flush)
 
- Protected Member Functions inherited from CodecZLibStream
 CodecZLibStream ()
 
Status CallStreamFunc (ZLibFunc func, int flush, const u8 *in, const size_t inSize, u8 *out, const size_t outSize, size_t &inConsumed, size_t &outProduced)
 
- Protected Member Functions inherited from Codec_ZLib
u32 InitializeChecksum ()
 
- Static Protected Member Functions inherited from CodecZLibStream
static Status LibError_from_zlib (int zlib_ret)
 
static void WarnIfZLibError (int zlib_ret)
 
- Protected Attributes inherited from CodecZLibStream
z_stream m_zs
 
u32 m_checksum
 

Constructor & Destructor Documentation

◆ Compressor_ZLib()

Compressor_ZLib::Compressor_ZLib ( )
inline

◆ ~Compressor_ZLib()

virtual Compressor_ZLib::~Compressor_ZLib ( )
inlinevirtual

Member Function Documentation

◆ Finish()

virtual Status Compressor_ZLib::Finish ( u32 checksum,
size_t &  outProduced 
)
inlinevirtual

Flush buffers and make sure all output has been produced.

Parameters
checksumChecksum over all input data.
outProduced
Returns
error status for the entire operation.

Implements ICodec.

◆ MaxOutputSize()

virtual size_t Compressor_ZLib::MaxOutputSize ( size_t  inSize) const
inlinevirtual
Returns
an upper bound on the output size for the given amount of input. this is used when allocating a single buffer for the whole operation.

Implements ICodec.

◆ Process()

virtual Status Compressor_ZLib::Process ( const u8 in,
size_t  inSize,
u8 out,
size_t  outSize,
size_t &  inConsumed,
size_t &  outProduced 
)
inlinevirtual

process (i.e.

compress or decompress) data.

Parameters
in
inSize
out
outSizeBytes remaining in the output buffer; shall not be zero.
inConsumed,outProducedHow many bytes in the input and output buffers were used. either or both of these can be zero if the input size is small or there's not enough output space.

Implements ICodec.

◆ Reset()

virtual Status Compressor_ZLib::Reset ( )
inlinevirtual

clear all previous state and prepare for reuse.

this is as if the object were destroyed and re-created, but more efficient since it avoids reallocating a considerable amount of memory (about 200KB for LZ).

Implements ICodec.


The documentation for this class was generated from the following file: