Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

XFuRemoteDebug.h

Go to the documentation of this file.
00001 /*
00002  * \file
00003  * X-Forge Engine <br>
00004  * Copyright 2000-2003 Fathammer Ltd
00005  *
00006  * \brief Remote debug server
00007  *
00008  * $Id: XFuRemoteDebug.h,v 1.6 2003/05/23 09:54:04 slehti Exp $
00009  * $Date: 2003/05/23 09:54:04 $
00010  * $Revision: 1.6 $
00011  */
00012 
00013 #ifndef XFUREMOTEDEBUG_H_INCLUDED
00014 #define XFUREMOTEDEBUG_H_INCLUDED
00015 
00016 #include <xfcore/net/XFcRemoteCommunicationRecv.h>
00017 #include <xfcore/XFcHashtable.h>
00018 
00019 static const INT32 RECV_BUFFER_MAX = 128;
00020 static const INT32 RECEIVER_NAME_MAX = 10; 
00021 static const CHAR8 RECEIVE_REPASS_BUFFER_CHAR = 0x0d;
00022 
00023 class XFuRemoteDebugService;
00024 class XFcRemoteCommunication;
00025 
00026 class XFuRemoteDebug : public XFcRemoteCommunicationRecv
00027 {
00028 private:
00029 
00030     //! Holds service hash table.
00031     XFcHashtable <XFuStringKey, XFuRemoteDebugService *> mService;
00032 
00033     //! Holds buffer for receiving data, temporary!
00034     CHAR8 mRecvBuffer[128];
00035 
00036     //! Holds buffer position.
00037     INT32 mPosition;
00038 
00039     //! Holds pointer to remote connection server
00040     XFcRemoteCommunication *mRemoteComm;
00041     
00042 protected:
00043 
00044     /*! Constructor, empty implementation.
00045      */
00046     XFuRemoteDebug();
00047 
00048     /*!
00049      * Initializes the Remote Debugger and registers it to XForge core.
00050      * \return 1 if success else 0.
00051      */
00052     INT init(INT32 aPort);
00053 
00054     /*! Callback for receiving data.
00055      * \param aData holds buffer of incoming data.
00056      * \param aSize holds size of the buffer.
00057      * \param aError holds receive error.
00058      */
00059     virtual void receive(const CHAR8 * aData, INT32 aSize, INT32 aError);
00060 
00061     /*! Event callback from remote debug server.
00062      * \param aError is event status.
00063      */
00064     virtual void event(INT32 aError);
00065 
00066 public:
00067 
00068     /*! static create
00069      */
00070     static XFuRemoteDebug * create(INT32 aPort);
00071 
00072     /*! Sends data to remote debugger.
00073      * \param aData pointer to string.
00074      * \return sent byte count.
00075      */
00076     INT32 send(const CHAR8 *aData);
00077 
00078     /*! Sends data to remote debugger.
00079      * \param aData pointer to buffer.
00080      * \param aSize size of the data buffer.
00081      * \return sent byte count.
00082      */
00083     INT32 send(const CHAR8 *aData, INT32 aSize);
00084 
00085     /*! Register remote debug service.
00086      * \param aService remote debug service.
00087      * \return 1 if register wass successfully else 0.
00088      */
00089     INT registerService(const CHAR *aName, XFuRemoteDebugService &aService);
00090 
00091     /*! Removes registered service.
00092      * \param aName of the service.
00093      * \return pointer to service.
00094      */
00095     XFuRemoteDebugService * uregisterService(const CHAR *aName);
00096 
00097 
00098 
00099     /*! Destructor, removes remote debugger from core.
00100      */
00101     virtual ~XFuRemoteDebug();
00102 
00103 
00104 };
00105 
00106 #endif

   
X-Forge Documentation
Confidential
Copyright © 2002-2003 Fathammer
   
Documentation generated
with doxygen
by Dimitri van Heesch