Public Member Functions

TAO::LzoCompressor Class Reference

#include <LzoCompressor.h>

Inheritance diagram for TAO::LzoCompressor:
Inheritance graph
[legend]
Collaboration diagram for TAO::LzoCompressor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LzoCompressor (::Compression::CompressionLevel compression_level,::Compression::CompressorFactory_ptr compressor_factory)
virtual void compress (const ::Compression::Buffer &source,::Compression::Buffer &target)
virtual void decompress (const ::Compression::Buffer &source,::Compression::Buffer &target)

Detailed Description

Definition at line 33 of file LzoCompressor.h.


Constructor & Destructor Documentation

TAO::LzoCompressor::LzoCompressor ( ::Compression::CompressionLevel  compression_level,
::Compression::CompressorFactory_ptr  compressor_factory 
)

Definition at line 3 of file LzoCompressor.cpp.

               : LzoCompressor.cpp 84757 2009-03-09 07:11:58Z johnnyw $")

#include <lzo1x.h>
#include <lzoutil.h>


Member Function Documentation

void TAO::LzoCompressor::compress ( const ::Compression::Buffer &  source,
::Compression::Buffer &  target 
) [virtual]

Implements TAO::BaseCompressor.

Definition at line 11 of file LzoCompressor.cpp.

{
LzoCompressor::LzoCompressor (
  ::Compression::CompressionLevel compression_level,
  ::Compression::CompressorFactory_ptr compressor_factory) :
    BaseCompressor (compression_level, compressor_factory)
{
}

void
LzoCompressor::compress (
    const ::Compression::Buffer & source,
    ::Compression::Buffer & target
  )
{
  void* wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS);
  lzo_uint max_length = static_cast <lzo_uint> (source.length () * 1.1) + 12;
  target.length (static_cast <CORBA::ULong> (max_length));

  int const retval = ::lzo1x_1_compress (
            reinterpret_cast <const unsigned char*>(source.get_buffer ()),
            source.length (),
            reinterpret_cast <unsigned char*>(target.get_buffer ()),
            &max_length,
            wrkmem);

  lzo_free(wrkmem);

  if (retval != LZO_E_OK)

void TAO::LzoCompressor::decompress ( const ::Compression::Buffer &  source,
::Compression::Buffer &  target 
) [virtual]

Implements TAO::BaseCompressor.

Definition at line 43 of file LzoCompressor.cpp.

    {
      target.length (static_cast <CORBA::ULong> (max_length));
    }

  // Update statistics for this compressor
  this->update_stats (source.length (), target.length ());
}

void
LzoCompressor::decompress (
  const ::Compression::Buffer & source,
  ::Compression::Buffer & target)
{
  lzo_uint max_length = static_cast <lzo_uint> (target.length ());

  int const retval = ::lzo1x_decompress (
                                 reinterpret_cast <const unsigned char*>(source.get_buffer ()),
                                 source.length (),
                                 reinterpret_cast <unsigned char*>(target.get_buffer ()),
                                 &max_length,


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines