![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2009 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: DtCigiNetworkIO.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 *********************************************************************/ 00008 00012 00013 #ifndef DtCigiNetworkIO_H_ 00014 #define DtCigiNetworkIO_H_ 00015 00016 #include <vrvCigi/vrvCigi.h> 00017 #include <vrvCigi/DtCigiConnectionInitializer.h> 00018 00019 #include <vlutil/vlInetSocket.h> 00020 00021 class CigiHatHotRespV3_2; 00022 00023 class DtInetSocket; 00024 class DtInetSocketMgr; 00025 class DtInetTcpSocket; 00026 class CigiIGSession; 00027 00028 namespace makVrv 00029 { 00030 class DtCigiConnectionInitializer; 00031 class DtCigiSignalProcessor; 00032 00038 class DT_DLL_VRVCIGI DtCigiNetworkIO 00039 { 00040 public: 00044 DtCigiNetworkIO(const DtCigiConnectionInitializer& initializer); 00045 00047 virtual ~DtCigiNetworkIO(); 00048 00051 virtual bool receiveCigiMessages(); 00052 00061 virtual bool sendCigiMessages(unsigned int frameNumber, unsigned int lastHostFrameNumber, 00062 int igMode, int databaseNumber); 00063 00066 virtual void setSignalProcessor(DtCigiSignalProcessor& sigProcessor); 00067 00069 virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat, 00070 unsigned int lastHostFrameNumber, bool valid); 00071 00073 virtual void sendLosResponse(int losId, int entityId, bool visible, double range, 00074 int responseCount, int hostFrame); 00075 00077 static bool addSocketCb(DtInetSocket* sock, void* usr); 00078 00080 static bool removeSocketCb(DtInetSocket* sock, void* usr); 00081 00082 protected: 00084 virtual void initializeUdpSocket(const DtInetEndpoint& endpoint, 00085 unsigned int listenPort, DtInetDevice* device); 00086 00088 virtual void initializeTcpSocket(const DtInetEndpoint& endpoint, 00089 DtInetDevice* device, int localPort); 00090 00092 virtual void addSocket(DtInetTcpSocket* sock); 00093 00095 virtual void removeSocket(DtInetTcpSocket* sock); 00096 00097 virtual DtInetAddr findFirstNetworkDeviceAddress(bool& found) const; 00098 00100 DtCigiNetworkIO(const DtCigiNetworkIO& orig); 00101 00103 DtCigiNetworkIO& operator=(const DtCigiNetworkIO& orig); 00104 00105 protected: 00107 struct HatHotResponseData 00108 { 00109 double hatHotValue; 00110 int hatHotId; 00111 bool sendHatResponse; 00112 unsigned int lastHostFrameNumber; 00113 bool valid; 00114 }; 00115 00117 struct LosResponseData 00118 { 00119 int losId; 00120 int entityId; 00121 bool visible; 00122 double range; 00123 unsigned int lastHostFrameNumber; 00124 int responseCount; 00125 }; 00126 00128 DtInetSocket* mySocket; 00129 00131 CigiIGSession* myCigiIgSession; 00132 00134 DtInetBufferChain myReceiveBufferChain; 00135 00137 DtInetBuffer myReceiveBuffer; 00138 00140 unsigned int myReceiveBufferSize; 00141 00143 DtInetEndpoint myDestinationAddress; 00144 00147 DtInetSocketMgr* mySocketMgr; 00148 00151 bool myUseTcpClient; 00152 00155 bool myUseTcpServer; 00156 00159 bool myUseSychronousMode; 00160 00161 00163 std::vector<HatHotResponseData> myHatHotResponses; 00164 00166 std::vector<LosResponseData> myLosResponses; 00167 }; 00168 } 00169 00170 00171 #endif