summaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-04-06 13:33:38 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-04-13 11:32:09 +0300
commit96ade47c182bf37a2efca2aa62922e54e5ff1660 (patch)
tree93ceee6c6f8984f563f3dfe83e56f98b66b40f3a /src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h
parent2d5f0ffaf1278516bbd74e3b60f9849f4c51cffa (diff)
Move LZMA SDK to 3rdparty subdirectory
Also add attribution document. Task-number: QTIFW-2336 Change-Id: I91546bc6c3ace244e4b546b945f40b7d204f7463 Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h')
-rw-r--r--src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h b/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h
new file mode 100644
index 000000000..2190cf867
--- /dev/null
+++ b/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2MT.h
@@ -0,0 +1,83 @@
+// CoderMixer2MT.h
+
+#ifndef __CODER_MIXER2_MT_H
+#define __CODER_MIXER2_MT_H
+
+#include "CoderMixer2.h"
+#include "../../../Common/MyCom.h"
+#include "../../Common/StreamBinder.h"
+#include "../../Common/VirtThread.h"
+
+namespace NCoderMixer {
+
+struct CCoder2: public CCoderInfo2, public CVirtThread
+{
+ CRecordVector<ISequentialInStream*> InStreamPointers;
+ CRecordVector<ISequentialOutStream*> OutStreamPointers;
+
+public:
+ HRESULT Result;
+ CObjectVector< CMyComPtr<ISequentialInStream> > InStreams;
+ CObjectVector< CMyComPtr<ISequentialOutStream> > OutStreams;
+
+ CCoder2(UInt32 numInStreams, UInt32 numOutStreams);
+ ~CCoder2() { CVirtThread::WaitThreadFinish(); }
+ // void SetCoderInfo(const UInt64 **inSizes, const UInt64 **outSizes);
+ virtual void Execute();
+ void Code(ICompressProgressInfo *progress);
+};
+
+
+/*
+ SetBindInfo()
+ for each coder
+ AddCoder[2]()
+ SetProgressIndex(UInt32 coderIndex);
+
+ for each file
+ {
+ ReInit()
+ for each coder
+ SetCoderInfo
+ Code
+ }
+*/
+
+class CCoderMixer2MT:
+ public ICompressCoder2,
+ public CCoderMixer2,
+ public CMyUnknownImp
+{
+ CBindInfo _bindInfo;
+ CObjectVector<CStreamBinder> _streamBinders;
+ unsigned _progressCoderIndex;
+
+ void AddCoderCommon();
+ HRESULT Init(ISequentialInStream **inStreams, ISequentialOutStream **outStreams);
+ HRESULT ReturnIfError(HRESULT code);
+public:
+ CObjectVector<CCoder2> _coders;
+ MY_UNKNOWN_IMP
+
+ STDMETHOD(Code)(ISequentialInStream **inStreams,
+ const UInt64 **inSizes,
+ UInt32 numInStreams,
+ ISequentialOutStream **outStreams,
+ const UInt64 **outSizes,
+ UInt32 numOutStreams,
+ ICompressProgressInfo *progress);
+
+ HRESULT SetBindInfo(const CBindInfo &bindInfo);
+ void AddCoder(ICompressCoder *coder);
+ void AddCoder2(ICompressCoder2 *coder);
+ void SetProgressCoderIndex(unsigned coderIndex) { _progressCoderIndex = coderIndex; }
+
+ void ReInit();
+ void SetCoderInfo(UInt32 coderIndex, const UInt64 **inSizes, const UInt64 **outSizes)
+ { _coders[coderIndex].SetCoderInfo(inSizes, outSizes); }
+ UInt64 GetWriteProcessedSize(UInt32 binderIndex) const
+ { return _streamBinders[binderIndex].ProcessedSize; }
+};
+
+}
+#endif