LibreOffice Module package (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ZipUtils::ThreadedDeflater Class Referencefinal

Parallel compression a stream using the libz deflate algorithm. More...

#include <ThreadedDeflater.hxx>

Classes

class  Task
 

Public Member Functions

 ThreadedDeflater (sal_Int32 nSetLevel)
 
 ~ThreadedDeflater () COVERITY_NOEXCEPT_FALSE
 
void deflateWrite (const css::uno::Reference< css::io::XInputStream > &xInStream, std::function< void(const css::uno::Sequence< sal_Int8 > &, sal_Int32)> aProcessInputFunc, std::function< void(const css::uno::Sequence< sal_Int8 > &, sal_Int32)> aProcessOutputFunc)
 
sal_Int64 getTotalIn () const
 
sal_Int64 getTotalOut () const
 

Private Member Functions

void processDeflatedBuffers ()
 
void clear ()
 

Private Attributes

std::vector< std::vector< sal_Int8 > > outBuffers
 
std::shared_ptr< comphelper::ThreadTaskTagthreadTaskTag
 
css::uno::Sequence< sal_Int8inBuffer
 
css::uno::Sequence< sal_Int8prevDataBlock
 
std::function< void(const css::uno::Sequence< sal_Int8 > &, sal_Int32)> maProcessOutputFunc
 
sal_Int64 totalIn
 
sal_Int64 totalOut
 
int zlibLevel
 

Detailed Description

Parallel compression a stream using the libz deflate algorithm.

Call deflateWrite() with the input stream and input/output processing functions. This will use multiple threads for compression on each batch of data from the stream.

Definition at line 37 of file ThreadedDeflater.hxx.

Constructor & Destructor Documentation

◆ ThreadedDeflater()

ZipUtils::ThreadedDeflater::ThreadedDeflater ( sal_Int32  nSetLevel)

Definition at line 67 of file ThreadedDeflater.cxx.

◆ ~ThreadedDeflater()

ZipUtils::ThreadedDeflater::~ThreadedDeflater ( )

Definition at line 75 of file ThreadedDeflater.cxx.

References clear().

Member Function Documentation

◆ clear()

void ZipUtils::ThreadedDeflater::clear ( )
private

Definition at line 144 of file ThreadedDeflater.cxx.

References inBuffer, and outBuffers.

Referenced by ~ThreadedDeflater().

◆ deflateWrite()

void ZipUtils::ThreadedDeflater::deflateWrite ( const css::uno::Reference< css::io::XInputStream > &  xInStream,
std::function< void(const css::uno::Sequence< sal_Int8 > &, sal_Int32)>  aProcessInputFunc,
std::function< void(const css::uno::Sequence< sal_Int8 > &, sal_Int32)>  aProcessOutputFunc 
)

◆ getTotalIn()

sal_Int64 ZipUtils::ThreadedDeflater::getTotalIn ( ) const
inline

Definition at line 59 of file ThreadedDeflater.hxx.

References totalIn.

Referenced by ZipOutputEntryParallel::writeStream().

◆ getTotalOut()

sal_Int64 ZipUtils::ThreadedDeflater::getTotalOut ( ) const
inline

Definition at line 60 of file ThreadedDeflater.hxx.

References totalOut.

Referenced by ZipOutputEntryParallel::writeStream().

◆ processDeflatedBuffers()

void ZipUtils::ThreadedDeflater::processDeflatedBuffers ( )
private

Definition at line 125 of file ThreadedDeflater.cxx.

References maProcessOutputFunc, outBuffers, pos, and totalOut.

Referenced by deflateWrite().

Member Data Documentation

◆ inBuffer

css::uno::Sequence<sal_Int8> ZipUtils::ThreadedDeflater::inBuffer
private

◆ maProcessOutputFunc

std::function<void(const css::uno::Sequence<sal_Int8>&, sal_Int32)> ZipUtils::ThreadedDeflater::maProcessOutputFunc
private

Definition at line 46 of file ThreadedDeflater.hxx.

Referenced by deflateWrite(), and processDeflatedBuffers().

◆ outBuffers

std::vector<std::vector<sal_Int8> > ZipUtils::ThreadedDeflater::outBuffers
private

◆ prevDataBlock

css::uno::Sequence<sal_Int8> ZipUtils::ThreadedDeflater::prevDataBlock
private

Definition at line 45 of file ThreadedDeflater.hxx.

Referenced by deflateWrite(), and ZipUtils::ThreadedDeflater::Task::doWork().

◆ threadTaskTag

std::shared_ptr<comphelper::ThreadTaskTag> ZipUtils::ThreadedDeflater::threadTaskTag
private

Definition at line 43 of file ThreadedDeflater.hxx.

Referenced by deflateWrite().

◆ totalIn

sal_Int64 ZipUtils::ThreadedDeflater::totalIn
private

Definition at line 47 of file ThreadedDeflater.hxx.

Referenced by deflateWrite(), and getTotalIn().

◆ totalOut

sal_Int64 ZipUtils::ThreadedDeflater::totalOut
private

Definition at line 48 of file ThreadedDeflater.hxx.

Referenced by getTotalOut(), and processDeflatedBuffers().

◆ zlibLevel

int ZipUtils::ThreadedDeflater::zlibLevel
private

Definition at line 49 of file ThreadedDeflater.hxx.

Referenced by ZipUtils::ThreadedDeflater::Task::doWork().


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