Go to the documentation of this file.00001
00002
00003
00004
00005
00009
00010 #ifndef lgrDisSimInterface_H_
00011 #define lgrDisSimInterface_H_
00012
00013 #if DtDIS
00014
00015 #include "lgrSim.h"
00016
00017 #include <vlutil/vlUtil.h>
00018 #include <vlutil/vlInetAddr.h>
00019 #include "lgrSimInterface.h"
00020
00021 namespace MAKLogger
00022 {
00023 class DtDisDescriptor;
00024 class DtLgrDisEntityTypeManager;
00025 class DtLgrDisSimDriver;
00026 class DtLgrDisCommandFactory;
00027
00030 class DT_DLL_LGRSIM DtLgrDisSimInterface : public DtLgrSimInterface
00031 {
00032 public:
00033 typedef DtLgrDisCommandFactory Factory;
00034
00036 static DtLgrDisSimInterface* create(DtLogger&);
00037
00039 static DtLgrSimInterface* createBase(DtLogger&);
00040
00042 virtual ~DtLgrDisSimInterface();
00043
00046 static DtLgrDisSimInterface* createNonThreadsafe(DtLogger& logger,
00047 const DtLgrDisSimDriver& driver);
00048
00050 virtual DtString protocol() const;
00051
00052 virtual void setConnectionParameters(int port, int exerciseId, int siteId, int appNumber,
00053 bool useAsynchIO, int sendBufferSize, int recvBufferSize, int multicastTtl,
00054 const DtString& destAddrString, const DtString& netmask, const DtString& deviceAddrString,
00055 const std::vector<DtString>& mcastAddresses) const;
00056
00058 virtual void getLoggerName(DtString& name) const;
00059
00061 virtual void setHeartbeatRate(double rate) const;
00062
00064 virtual void setTimeoutRate(double rate) const;
00065
00067 virtual void setDisDescription(const DtDisDescriptor& desc) const;
00068
00070 virtual void setDrainInputSettings(double maxTime,
00071 int numPdusToRead) const;
00072
00074 virtual const DtDisDescriptor* disDescription() const;
00075
00077 virtual void setEntityTypeManager(const DtLgrDisEntityTypeManager& mgr) const;
00078
00080 virtual const DtLgrDisEntityTypeManager* entityTypeManager() const;
00081
00083
00084 virtual int port() const;
00085 virtual int exerciseId() const;
00086 virtual int siteId() const;
00087 virtual int appNumber() const;
00088 virtual bool useAsynchIO() const;
00089 virtual int sendBufferSize() const;
00090 virtual int recvBufferSize() const;
00091 virtual int multicastTtl() const;
00092 virtual DtInetAddr destAddr() const;
00093 virtual const DtString& netmask() const;
00094 virtual DtInetAddr deviceAddr() const;
00095 virtual const std::vector<DtString>& mcastAddresses() const;
00097
00099 virtual double heartbeatRate() const;
00100
00102 virtual double timeoutRate() const;
00103
00105 virtual double drainInputMaxTime() const;
00106
00108 virtual int numPdusToReadPerTimeCheck() const;
00109
00110 protected:
00111
00113 void connectResponseHandler(DtLgrCommandId id,
00114 void (DtLgrDisSimInterface::* function)(DtResponse));
00116 void connectionParametersChanged(DtResponse response);
00117 void heartbeatRateChanged(DtResponse response);
00118 void timeoutRateChanged(DtResponse response);
00119 void disDescriptionChanged(DtResponse response);
00120 void entityTypeManagerChanged(DtResponse response);
00121 void drainInputSettingsChanged(DtResponse response);
00122
00123 DtLgrDisSimInterface(DtLogger& logger,const DtLgrDisSimDriver& driver);
00124
00125 DtDisDescriptor* myDisDescriptor;
00126 DtLgrDisEntityTypeManager* myEntityTypeManager;
00127
00128 int myPort;
00129 int myExerciseId;
00130 int mySiteId;
00131 int myAppNumber;
00132 bool myUseAsynchIO;
00133 int mySendBufferSize;
00134 int myRecvBufferSize;
00135 int myMulticastTtl;
00136 DtInetAddr myDestAddr;
00137 DtInetAddr myDeviceAddr;
00138 DtString myNetmask;
00139 std::vector<DtString> myMcastAddresses;
00140 double myHeartBeatRate;
00141 double myTimeoutRate;
00142 double myDrainInputMaxTime;
00143 int myNumPdusToReadPerTimeCheck;
00144 };
00145
00146 }
00147
00148 #endif
00149 #endif