VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiNetworkIO.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2016 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCigi/vrvCigi.h>
14 
16 
17 #include <vlutil/vlInetSocket.h>
18 
19 #include "CigiTypes.h"
20 
21 class CigiHatHotRespV3_2;
22 
23 class DtInetSocket;
24 class DtInetSocketMgr;
25 class DtInetTcpSocket;
26 class CigiIGSession;
27 class CigiBasePacket;
28 class CigiBaseIGCtrl;
29 
30 namespace makCigiExt
31 {
32  class DtCigiDiGuyCtrl;
33  class DtCigiDiGuyCtrlExt;
34 }
35 
36 namespace makVrv
37 {
38  class DtCigiConnectionInitializer;
39  class DtCigiSignalProcessor;
40  class DtCigiConnection;
41 
48  {
49  public:
50  friend class DtCigiNetworkIOCreator;
51 
53  virtual ~DtCigiNetworkIO();
54 
57  virtual bool receiveCigiMessages();
58 
67  virtual bool sendCigiMessages(unsigned int frameNumber, unsigned int lastHostFrameNumber,
68  int igMode, int databaseNumber);
69 
73  virtual bool readyToSendCigiMessages() const;
74 
77  virtual void setSignalProcessor(DtCigiSignalProcessor& sigProcessor);
78 
80  virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat,
81  unsigned int lastHostFrameNumber, bool valid);
82 
84  virtual void sendLosResponse(int losId, int entityId, bool visible, double range,
85  int responseCount, int hostFrame);
86 
90  virtual void sendUserPacket( CigiBasePacket* packet );
91 
93 
94 
95  virtual CigiIGSession& session();
96  virtual const CigiIGSession& session() const;
98 
100  bool cigiSessionExists() const;
101 
103  virtual bool registerUserPacket(CigiBasePacket *packet,
104  unsigned int packetId, bool hostSend, bool igSend);
105 
107  static bool addSocketCb(DtInetSocket* sock, void* usr);
108 
110  static bool removeSocketCb(DtInetSocket* sock, void* usr);
111 
112  protected:
116  DtCigiNetworkIO(const DtCigiConnectionInitializer& initializer,
117  DtCigiConnection& connection );
118 
120  virtual void initializeUdpSocket(const DtInetEndpoint& endpoint,
121  unsigned int listenPort, DtInetDevice* device);
122 
124  virtual void initializeTcpSocket(const DtInetEndpoint& endpoint,
125  DtInetDevice* device, int localPort);
126 
128  virtual void addSocket(DtInetTcpSocket* sock);
129 
131  virtual void removeSocket(DtInetTcpSocket* sock);
132 
133  virtual DtInetAddr findFirstNetworkDeviceAddress(bool& found) const;
134 
137  CigiBaseIGCtrl* igControlPacket( Cigi_uint8* Dta );
138 
140  DtCigiNetworkIO(const DtCigiNetworkIO& orig);
141 
143  DtCigiNetworkIO& operator=(const DtCigiNetworkIO& orig);
144 
145  protected:
148  {
149  double hatHotValue;
150  int hatHotId;
152  unsigned int lastHostFrameNumber;
153  bool valid;
154  };
155 
158  {
159  int losId;
160  int entityId;
161  bool visible;
162  double range;
163  unsigned int lastHostFrameNumber;
165  };
166 
168 
170  DtInetSocket* mySocket;
171 
173  CigiIGSession* myCigiIgSession;
174 
176  DtInetBufferChain myReceiveBufferChain;
177 
179  DtInetBuffer myReceiveBuffer;
180 
182  unsigned int myReceiveBufferSize;
183 
185  DtInetEndpoint myDestinationAddress;
186 
189 
192  DtInetSocketMgr* mySocketMgr;
193 
197 
201 
205 
207  std::vector<HatHotResponseData> myHatHotResponses;
208 
210  std::vector<LosResponseData> myLosResponses;
211 
212  std::vector<CigiBasePacket*> myUserPacketsToSend;
213 
215  double myTimeSlice;
216 
220 
225  };
226 
229  {
230  public:
233 
235  virtual ~DtCigiNetworkIOCreator();
236 
238  static DtCigiNetworkIOCreator& instance( DtDe& de );
239 
241  static DtCigiNetworkIOCreator& instance( DtCigiConnection& con );
242 
244  static void copyInstance(DtCigiConnection& con, DtDe& de);
245 
247  virtual DtCigiNetworkIO* create( const DtCigiConnectionInitializer& initializer,
248  DtCigiConnection& connection ) const;
249  };
250 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)