HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_DeepSocketHandler.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: TIL_DeepSocketHandler.h ( TIL Library, C++)
7  *
8  * COMMENTS: This class handles reading the interface for reading an image
9  * from a socket. The class will read messages from the socket
10  * and send the data to the reader.
11  * The class assumes that the initial connection has been made and
12  * that the deep reader is configured to accept data.
13  */
14 
15 #ifndef __TIL_DeepSocketHandler__
16 #define __TIL_DeepSocketHandler__
17 
18 #include "TIL_API.h"
19 #include <UT/UT_NonCopyable.h>
20 #include <UT/UT_SysClone.h>
21 
22 class UT_NetSocket;
23 class UT_NetPacket;
24 class TIL_DeepReader;
25 
27 {
28 public:
29  TIL_DeepSocketHandler(pid_t client,
30  UT_NetSocket *socket,
31  TIL_DeepReader *reader);
33 
35 
36  int64 getMemoryUsage(bool inclusive) const;
37 
38  int getFileDescriptor() const;
39  UT_NetSocket *getSocket() { return mySocket; }
40 
41  int processInput(int max_packets = 1e8);
42  bool terminate(bool kill_proc = true);
43  void setMousePosition(float mx, float my, float radius);
44  void requestMaterialStyleSheet(int style_sheet_index);
45  void autoUpdate();
46  void halt();
47 
48 private:
49  void clean();
50  bool int32Message(int32 *ival, int nints);
51  bool fpreal32Message(fpreal32 *fval, int nfloats);
52 
53  UT_NetSocket *mySocket;
54  UT_NetPacket *myPacket;
55  TIL_DeepReader *myReader;
56  pid_t myPid;
57  float myMouseX;
58  float myMouseY;
59  float myMouseRadius;
60  bool mySwapBytes;
61 };
62 
63 #endif
int int32
Definition: SYS_Types.h:39
float fpreal32
Definition: SYS_Types.h:200
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
long long int64
Definition: SYS_Types.h:116
#define TIL_API
Definition: TIL_API.h:10