GizmoDistribution

gzDistEncoder.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // File         : gzDistEncoder.h
00003 // Module       : gzRemoteDistribution
00004 // Description  : Distribution custom encoder interface
00005 // Author       : Christian Andersson
00006 // Product      : GizmoDistribution 2.1.1
00007 //      
00008 // Copyright © 2004 - Saab Training Systems AB, Sweden
00009 //          
00010 // NOTE:    GizmoDistribution is a toolkit used for implementing distributed
00011 //          objects and events in C++
00012 //
00013 //
00014 // Revision History...
00015 //
00016 // Who  Date    Description
00017 //
00018 // CAN  040602  Created file
00019 //
00020 //*****************************************************************************
00021 #ifndef __GZ_DIST_ENCODER_H__
00022 #define __GZ_DIST_ENCODER_H__
00023 
00029 // Includes
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         /*  \param  source          Pointer to the buffer to be decoded.
00072             \param  sourceLength    Length of data to be decoded.
00073             \param  desination      Buffer where the decoded data will be put. */
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 //----------------------------- gzDistDefaultCompressor ---------------------------------
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 //----------------------------- gzDistDefaultEncoder ---------------------------------
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         // Coding/decoding key.
00147         const gzULong m_key;
00148 };
00149 
00150 
00151 #endif

Documentation for GizmoDistribution generated at Wed Feb 20 11:59:21 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond