LibreOffice Module package (master) 1
|
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::ThreadTaskTag > | threadTaskTag |
css::uno::Sequence< sal_Int8 > | inBuffer |
css::uno::Sequence< sal_Int8 > | prevDataBlock |
std::function< void(const css::uno::Sequence< sal_Int8 > &, sal_Int32)> | maProcessOutputFunc |
sal_Int64 | totalIn |
sal_Int64 | totalOut |
int | zlibLevel |
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.
ZipUtils::ThreadedDeflater::ThreadedDeflater | ( | sal_Int32 | nSetLevel | ) |
Definition at line 67 of file ThreadedDeflater.cxx.
ZipUtils::ThreadedDeflater::~ThreadedDeflater | ( | ) |
Definition at line 75 of file ThreadedDeflater.cxx.
References clear().
|
private |
Definition at line 144 of file ThreadedDeflater.cxx.
References inBuffer, and outBuffers.
Referenced by ~ThreadedDeflater().
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 | ||
) |
Definition at line 77 of file ThreadedDeflater.cxx.
References comphelper::ThreadPool::getSharedOptimalPool(), comphelper::ThreadPool::getWorkerCount(), inBuffer, maProcessOutputFunc, ZipUtils::MaxBlockSize, outBuffers, prevDataBlock, processDeflatedBuffers(), comphelper::ThreadPool::pushTask(), threadTaskTag, totalIn, and comphelper::ThreadPool::waitUntilDone().
Referenced by ZipOutputEntryParallel::writeStream().
|
inline |
Definition at line 59 of file ThreadedDeflater.hxx.
References totalIn.
Referenced by ZipOutputEntryParallel::writeStream().
|
inline |
Definition at line 60 of file ThreadedDeflater.hxx.
References totalOut.
Referenced by ZipOutputEntryParallel::writeStream().
|
private |
Definition at line 125 of file ThreadedDeflater.cxx.
References maProcessOutputFunc, outBuffers, pos, and totalOut.
Referenced by deflateWrite().
|
private |
Definition at line 44 of file ThreadedDeflater.hxx.
Referenced by clear(), deflateWrite(), and ZipUtils::ThreadedDeflater::Task::doWork().
|
private |
Definition at line 46 of file ThreadedDeflater.hxx.
Referenced by deflateWrite(), and processDeflatedBuffers().
|
private |
Definition at line 42 of file ThreadedDeflater.hxx.
Referenced by clear(), deflateWrite(), ZipUtils::ThreadedDeflater::Task::doWork(), and processDeflatedBuffers().
|
private |
Definition at line 45 of file ThreadedDeflater.hxx.
Referenced by deflateWrite(), and ZipUtils::ThreadedDeflater::Task::doWork().
|
private |
Definition at line 43 of file ThreadedDeflater.hxx.
Referenced by deflateWrite().
|
private |
Definition at line 47 of file ThreadedDeflater.hxx.
Referenced by deflateWrite(), and getTotalIn().
|
private |
Definition at line 48 of file ThreadedDeflater.hxx.
Referenced by getTotalOut(), and processDeflatedBuffers().
|
private |
Definition at line 49 of file ThreadedDeflater.hxx.
Referenced by ZipUtils::ThreadedDeflater::Task::doWork().