00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects Software Inc 00008 * 123 Front Street West, Suite 1401 00009 * Toronto, Ontario 00010 * Canada M5J 2M2 00011 * 416-504-9876 00012 * 00013 * NAME: TIL_DeepSocketHandler.h ( TIL Library, C++) 00014 * 00015 * COMMENTS: This class handles reading the interface for reading an image 00016 * from a socket. The class will read messages from the socket 00017 * and send the data to the reader. 00018 * The class assumes that the initial connection has been made and 00019 * that the deep reader is configured to accept data. 00020 */ 00021 00022 #ifndef __TIL_DeepSocketHandler__ 00023 #define __TIL_DeepSocketHandler__ 00024 00025 #include "TIL_API.h" 00026 #include <UT/UT_SysClone.h> 00027 00028 class UT_NetSocket; 00029 class UT_NetPacket; 00030 class TIL_DeepReader; 00031 00032 class TIL_API TIL_DeepSocketHandler { 00033 public: 00034 TIL_DeepSocketHandler(pid_t client, 00035 UT_NetSocket *socket, 00036 TIL_DeepReader *reader); 00037 ~TIL_DeepSocketHandler(); 00038 00039 int getFileDescriptor() const; 00040 UT_NetSocket *getSocket() { return mySocket; } 00041 00042 int processInput(int max_packets = 1e8); 00043 bool terminate(bool kill_proc = true); 00044 void setMousePosition(int mx, int my); 00045 void halt(); 00046 00047 private: 00048 void clean(); 00049 bool int32Message(int32 *ival, int nints); 00050 bool fpreal32Message(fpreal32 *fval, int nfloats); 00051 00052 UT_NetSocket *mySocket; 00053 UT_NetPacket *myPacket; 00054 TIL_DeepReader *myReader; 00055 pid_t myPid; 00056 int myMouseX, myMouseY; 00057 }; 00058 00059 #endif
1.5.9