VR-Forces 4.1.1 Class Documentation
DtCigiNetworkIO.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2009 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: DtCigiNetworkIO.h,v $ $Revision: 1.1 $ $State: Exp $
7 *********************************************************************/
8 
12 
13 #ifndef DtCigiNetworkIO_H_
14 #define DtCigiNetworkIO_H_
15 
16 #include <vrvCigi/vrvCigi.h>
18 
19 #include <vlutil/vlInetSocket.h>
20 
21 class CigiHatHotRespV3_2;
22 
23 class DtInetSocket;
24 class DtInetSocketMgr;
25 class DtInetTcpSocket;
26 class CigiIGSession;
27 
28 namespace makVrv
29 {
30  class DtCigiConnectionInitializer;
31  class DtCigiSignalProcessor;
32 
39  {
40  public:
44  DtCigiNetworkIO(const DtCigiConnectionInitializer& initializer);
45 
47  virtual ~DtCigiNetworkIO();
48 
51  virtual bool receiveCigiMessages();
52 
61  virtual bool sendCigiMessages(unsigned int frameNumber, unsigned int lastHostFrameNumber,
62  int igMode, int databaseNumber);
63 
66  virtual void setSignalProcessor(DtCigiSignalProcessor& sigProcessor);
67 
69  virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat,
70  unsigned int lastHostFrameNumber, bool valid);
71 
73  virtual void sendLosResponse(int losId, int entityId, bool visible, double range,
74  int responseCount, int hostFrame);
75 
77  static bool addSocketCb(DtInetSocket* sock, void* usr);
78 
80  static bool removeSocketCb(DtInetSocket* sock, void* usr);
81 
82  protected:
84  virtual void initializeUdpSocket(const DtInetEndpoint& endpoint,
85  unsigned int listenPort, DtInetDevice* device);
86 
88  virtual void initializeTcpSocket(const DtInetEndpoint& endpoint,
89  DtInetDevice* device, int localPort);
90 
92  virtual void addSocket(DtInetTcpSocket* sock);
93 
95  virtual void removeSocket(DtInetTcpSocket* sock);
96 
97  virtual DtInetAddr findFirstNetworkDeviceAddress(bool& found) const;
98 
100  DtCigiNetworkIO(const DtCigiNetworkIO& orig);
101 
103  DtCigiNetworkIO& operator=(const DtCigiNetworkIO& orig);
104 
105  protected:
108  {
109  double hatHotValue;
110  int hatHotId;
112  unsigned int lastHostFrameNumber;
113  bool valid;
114  };
115 
118  {
119  int losId;
120  int entityId;
121  bool visible;
122  double range;
123  unsigned int lastHostFrameNumber;
125  };
126 
128  DtInetSocket* mySocket;
129 
131  CigiIGSession* myCigiIgSession;
132 
134  DtInetBufferChain myReceiveBufferChain;
135 
137  DtInetBuffer myReceiveBuffer;
138 
140  unsigned int myReceiveBufferSize;
141 
143  DtInetEndpoint myDestinationAddress;
144 
147  DtInetSocketMgr* mySocketMgr;
148 
152 
156 
160 
161 
163  std::vector<HatHotResponseData> myHatHotResponses;
164 
166  std::vector<LosResponseData> myLosResponses;
167  };
168 }
169 
170 
171 #endif

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)