view src/win32/7zip/7z/CPP/7zip/Common/ProgressMt.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line source
1 // ProgressMt.h
3 #ifndef __PROGRESSMT_H
4 #define __PROGRESSMT_H
6 #include "../../Common/MyCom.h"
7 #include "../../Common/MyVector.h"
8 #include "../../Windows/Synchronization.h"
10 #include "../ICoder.h"
11 #include "../IProgress.h"
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(int numItems, ICompressProgressInfo *progress);
23 void Reinit(int index);
24 HRESULT SetRatioInfo(int index, const UInt64 *inSize, const UInt64 *outSize);
25 };
27 class CMtCompressProgress:
28 public ICompressProgressInfo,
29 public CMyUnknownImp
30 {
31 CMtCompressProgressMixer *_progress;
32 int _index;
33 public:
34 void Init(CMtCompressProgressMixer *progress, int index)
35 {
36 _progress = progress;
37 _index = index;
38 }
39 void Reinit() { _progress->Reinit(_index); }
41 MY_UNKNOWN_IMP
43 STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
44 };
46 #endif