Annotation of elwix/tools/oldlzma/SRC/7zip/Compress/Branch/BranchCoder.h, revision 1.1
1.1 ! misho 1: // BranchCoder.h
! 2:
! 3: #ifndef __BRANCH_CODER_H
! 4: #define __BRANCH_CODER_H
! 5:
! 6: #include "Common/MyCom.h"
! 7: #include "Common/Types.h"
! 8: #include "Common/Alloc.h"
! 9:
! 10: #include "../../ICoder.h"
! 11:
! 12: class CBranchConverter:
! 13: public ICompressFilter,
! 14: public CMyUnknownImp
! 15: {
! 16: protected:
! 17: UInt32 _bufferPos;
! 18: virtual void SubInit() {}
! 19: virtual UInt32 SubFilter(Byte *data, UInt32 size) = 0;
! 20: public:
! 21: MY_UNKNOWN_IMP;
! 22: STDMETHOD(Init)();
! 23: STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
! 24: };
! 25:
! 26: #define MyClassEncoderA(Name) class C ## Name: public CBranchConverter \
! 27: { public: UInt32 SubFilter(Byte *data, UInt32 size); };
! 28:
! 29: #define MyClassDecoderA(Name) class C ## Name: public CBranchConverter \
! 30: { public: UInt32 SubFilter(Byte *data, UInt32 size); };
! 31:
! 32: #define MyClassEncoderB(Name, ADD_ITEMS, ADD_INIT) class C ## Name: public CBranchConverter, public ADD_ITEMS \
! 33: { public: UInt32 SubFilter(Byte *data, UInt32 size); ADD_INIT};
! 34:
! 35: #define MyClassDecoderB(Name, ADD_ITEMS, ADD_INIT) class C ## Name: public CBranchConverter, public ADD_ITEMS \
! 36: { public: UInt32 SubFilter(Byte *data, UInt32 size); ADD_INIT};
! 37:
! 38: #define MyClass2b(Name, id, subId, encodingId) \
! 39: DEFINE_GUID(CLSID_CCompressConvert ## Name, \
! 40: 0x23170F69, 0x40C1, 0x278B, 0x03, 0x03, id, subId, 0x00, 0x00, encodingId, 0x00);
! 41:
! 42: #define MyClassA(Name, id, subId) \
! 43: MyClass2b(Name ## _Encoder, id, subId, 0x01) \
! 44: MyClassEncoderA(Name ## _Encoder) \
! 45: MyClass2b(Name ## _Decoder, id, subId, 0x00) \
! 46: MyClassDecoderA(Name ## _Decoder)
! 47:
! 48: #define MyClassB(Name, id, subId, ADD_ITEMS, ADD_INIT) \
! 49: MyClass2b(Name ## _Encoder, id, subId, 0x01) \
! 50: MyClassEncoderB(Name ## _Encoder, ADD_ITEMS, ADD_INIT) \
! 51: MyClass2b(Name ## _Decoder, id, subId, 0x00) \
! 52: MyClassDecoderB(Name ## _Decoder, ADD_ITEMS, ADD_INIT)
! 53:
! 54: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>