xref: /aosp_15_r20/external/lzma/CPP/7zip/Common/ProgressMt.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1 // ProgressMt.h
2 
3 #ifndef ZIP7_INC_PROGRESSMT_H
4 #define ZIP7_INC_PROGRESSMT_H
5 
6 #include "../../Common/MyCom.h"
7 #include "../../Common/MyVector.h"
8 #include "../../Windows/Synchronization.h"
9 
10 #include "../ICoder.h"
11 #include "../IProgress.h"
12 
13 class CMtCompressProgressMixer
14 {
15   CMyComPtr<ICompressProgressInfo> _progress;
16   CRecordVector<UInt64> InSizes;
17   CRecordVector<UInt64> OutSizes;
18   UInt64 TotalInSize;
19   UInt64 TotalOutSize;
20 public:
21   NWindows::NSynchronization::CCriticalSection CriticalSection;
22   void Init(unsigned numItems, ICompressProgressInfo *progress);
23   void Reinit(unsigned index);
24   HRESULT SetRatioInfo(unsigned index, const UInt64 *inSize, const UInt64 *outSize);
25 };
26 
27 
Z7_CLASS_IMP_NOQIB_1(CMtCompressProgress,ICompressProgressInfo)28 Z7_CLASS_IMP_NOQIB_1(
29   CMtCompressProgress
30   , ICompressProgressInfo
31 )
32   unsigned _index;
33   CMtCompressProgressMixer *_progress;
34 public:
35   void Init(CMtCompressProgressMixer *progress, unsigned index)
36   {
37     _progress = progress;
38     _index = index;
39   }
Reinit()40   void Reinit() { _progress->Reinit(_index); }
41 };
42 
43 #endif
44