00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GZ_DIST_ENCODER_H__
00022 #define __GZ_DIST_ENCODER_H__
00023
00029
00030 #include "gzDistBase.h"
00031
00032
00034
00041 class gzDistEncoderInterface : public gzDistThreadSafeReference
00042 {
00043 public:
00044
00046
00049 GZ_REMOTE_EXPORT gzDistEncoderInterface(gzDistEncoderInterface* parent = NULL);
00050
00052 GZ_REMOTE_EXPORT virtual ~gzDistEncoderInterface();
00053
00055 GZ_REMOTE_EXPORT gzUInt encode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination);
00056
00058 GZ_REMOTE_EXPORT gzUInt decode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination);
00059
00060 protected:
00061
00063
00068 virtual gzUInt onEncode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination) = 0;
00069
00071
00072
00073
00074 virtual gzUInt onDecode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination) = 0;
00075
00076 private:
00077
00078 gzDistEncoderInterface* m_parent;
00079 };
00080
00081
00082
00083
00085
00089 class gzDistDefaultCompressor : public gzDistEncoderInterface
00090 {
00091 public:
00092
00094
00096 GZ_REMOTE_EXPORT gzDistDefaultCompressor(gzDistEncoderInterface* parent = NULL);
00097
00099 GZ_REMOTE_EXPORT virtual ~gzDistDefaultCompressor();
00100
00101
00102 protected:
00103
00105 gzUInt onEncode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination);
00106
00108 gzUInt onDecode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination);
00109 };
00110
00111
00112
00113
00115
00123 class gzDistDefaultEncoder : public gzDistEncoderInterface
00124 {
00125 public:
00126
00128
00131 GZ_REMOTE_EXPORT gzDistDefaultEncoder(gzULong key, gzDistEncoderInterface* parent = NULL);
00132
00134 GZ_REMOTE_EXPORT virtual ~gzDistDefaultEncoder();
00135
00136 protected:
00137
00139 gzUInt onEncode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination);
00140
00142 gzUInt onDecode(const gzUByte* source, gzInt sourceLength, gzArray<gzUByte>& destination);
00143
00144 private:
00145
00146
00147 const gzULong m_key;
00148 };
00149
00150
00151 #endif