Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CoderMixer2ST.h « Common « Archive « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ea5a53e3baa3b78c0a2d729ec8f156e9fb50d171 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// CoderMixer2ST.h

#ifndef __CODER_MIXER2_ST_H
#define __CODER_MIXER2_ST_H

#include "CoderMixer2.h"
#include "../../../Common/MyCom.h"
#include "../../ICoder.h"

namespace NCoderMixer2 {

//  SetBindInfo()
//  for each coder
//  {
//    AddCoder[2]()
//  }
// 
//  for each file
//  {
//    ReInit()
//    for each coder
//    {
//      SetCoderInfo  
//    }
//    SetProgressIndex(UInt32 coderIndex);
//    Code
//  }

struct CSTCoderInfo: public CCoderInfo
{
  bool IsMain;
  CSTCoderInfo(UInt32 numInStreams, UInt32 numOutStreams, bool isMain):
    CCoderInfo(numInStreams, numOutStreams),IsMain(isMain) {}
};

class CCoderMixer2ST:
  public ICompressCoder2,
  public CCoderMixer2,
  public CMyUnknownImp
{
  MY_UNKNOWN_IMP

  HRESULT GetInStream(
    ISequentialInStream **inStreams, const UInt64 **inSizes, 
    UInt32 streamIndex, ISequentialInStream **inStreamRes);
  HRESULT GetOutStream(
    ISequentialOutStream **outStreams, const UInt64 **outSizes, 
    UInt32 streamIndex, ISequentialOutStream **outStreamRes);
public:
  STDMETHOD(Code)(ISequentialInStream **inStreams,
      const UInt64 **inSizes, 
      UInt32 numInStreams,
      ISequentialOutStream **outStreams, 
      const UInt64 **outSizes,
      UInt32 numOutStreams,
      ICompressProgressInfo *progress);

  CCoderMixer2ST();
  ~CCoderMixer2ST();
  void AddCoderCommon(bool isMain);
  void AddCoder(ICompressCoder *coder, bool isMain);
  void AddCoder2(ICompressCoder2 *coder, bool isMain);

  void ReInit();
  void SetCoderInfo(UInt32 coderIndex, const UInt64 **inSizes, const UInt64 **outSizes)
  {  
    {  _coders[coderIndex].SetCoderInfo(inSizes, outSizes); }
  }

  void SetProgressCoderIndex(UInt32 /*coderIndex*/)
  {  
    // _progressCoderIndex = coderIndex; 
  }

  // UInt64 GetWriteProcessedSize(UInt32 binderIndex) const;

private:
  CBindInfo _bindInfo;
  CObjectVector<CSTCoderInfo> _coders;
  int _mainCoderIndex;
public:
  HRESULT SetBindInfo(const CBindInfo &bindInfo);

};

}
#endif