VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCigiNetworkIO.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2014 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCigi/vrvCigi.h>
14 
15 #include <vlutil/vlInetSocket.h>
16 
17 #include "CigiTypes.h"
18 
19 class CigiHatHotRespV3_2;
20 
21 class DtInetSocket;
22 class DtInetSocketMgr;
23 class DtInetTcpSocket;
24 class CigiIGSession;
25 class CigiBasePacket;
26 class CigiBaseIGCtrl;
27 
28 namespace makCigiExt
29 {
30  class DtCigiDiGuyCtrl;
31 }
32 
33 namespace makVrv
34 {
35  class DtCigiConnectionInitializer;
36  class DtCigiSignalProcessor;
37  class DtCigiConnection;
38 
45  {
46  public:
50  DtCigiNetworkIO(const DtCigiConnectionInitializer& initializer,
51  DtCigiConnection& connection );
52 
54  virtual ~DtCigiNetworkIO();
55 
58  virtual bool receiveCigiMessages();
59 
68  virtual bool sendCigiMessages(unsigned int frameNumber, unsigned int lastHostFrameNumber,
69  int igMode, int databaseNumber);
70 
74  virtual bool readyToSendCigiMessages() const;
75 
78  virtual void setSignalProcessor(DtCigiSignalProcessor& sigProcessor);
79 
81  virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat,
82  unsigned int lastHostFrameNumber, bool valid);
83 
85  virtual void sendLosResponse(int losId, int entityId, bool visible, double range,
86  int responseCount, int hostFrame);
87 
91  virtual void sendUserPacket( CigiBasePacket* packet );
92 
94 
95 
96  virtual CigiIGSession& session();
97  virtual const CigiIGSession& session() const;
99 
101  bool cigiSessionExists() const;
102 
104  virtual bool registerUserPacket(CigiBasePacket *packet,
105  unsigned int packetId, bool hostSend, bool igSend);
106 
108  static bool addSocketCb(DtInetSocket* sock, void* usr);
109 
111  static bool removeSocketCb(DtInetSocket* sock, void* usr);
112 
113  protected:
115  virtual void initializeUdpSocket(const DtInetEndpoint& endpoint,
116  unsigned int listenPort, DtInetDevice* device);
117 
119  virtual void initializeTcpSocket(const DtInetEndpoint& endpoint,
120  DtInetDevice* device, int localPort);
121 
123  virtual void addSocket(DtInetTcpSocket* sock);
124 
126  virtual void removeSocket(DtInetTcpSocket* sock);
127 
128  virtual DtInetAddr findFirstNetworkDeviceAddress(bool& found) const;
129 
132  CigiBaseIGCtrl* igControlPacket( Cigi_uint8* Dta );
133 
135  DtCigiNetworkIO(const DtCigiNetworkIO& orig);
136 
138  DtCigiNetworkIO& operator=(const DtCigiNetworkIO& orig);
139 
140  protected:
143  {
144  double hatHotValue;
145  int hatHotId;
147  unsigned int lastHostFrameNumber;
148  bool valid;
149  };
150 
153  {
154  int losId;
155  int entityId;
156  bool visible;
157  double range;
158  unsigned int lastHostFrameNumber;
160  };
161 
163 
165  DtInetSocket* mySocket;
166 
168  CigiIGSession* myCigiIgSession;
169 
171  DtInetBufferChain myReceiveBufferChain;
172 
174  DtInetBuffer myReceiveBuffer;
175 
177  unsigned int myReceiveBufferSize;
178 
180  DtInetEndpoint myDestinationAddress;
181 
184 
187  DtInetSocketMgr* mySocketMgr;
188 
192 
196 
200 
202  std::vector<HatHotResponseData> myHatHotResponses;
203 
205  std::vector<LosResponseData> myLosResponses;
206 
207  std::vector<CigiBasePacket*> myUserPacketsToSend;
208 
210  double myTimeSlice;
211 
215  };
216 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)