![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2008 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: execCmds.h,v $ $Revision: 1.2 $ $State: Exp $ 00007 *******************************************************************************/ 00010 00011 #ifndef DtRtiExecCmdFunctor_H_ 00012 #define DtRtiExecCmdFunctor_H_ 00013 00014 #include <rtiMsConfig.h> 00015 #include <rtiMsg.h> 00016 #include <vlutil/vlPrint.h> 00017 #include <vlutil/vlInetAddr.h> 00018 #include <memory> 00019 #include <typeinfo> 00020 00021 class DtRtiExec; 00022 class DtRtiMsg; 00023 00024 00028 class DT_DLL_EXEC DtRtiExecCmd 00029 { 00030 public: 00031 00032 DtRtiExecCmd() {} 00033 virtual ~DtRtiExecCmd() {} 00034 virtual DtRtiExecCmd* clone() const = 0; 00035 virtual void operator()( const DtRtiExec& exec ) = 0; 00036 00041 virtual bool operator==( const DtRtiExecCmd& value ) 00042 { 00043 if ( typeid(*this) == typeid(value) ) 00044 { 00045 return true; 00046 } 00047 else 00048 { 00049 return false; 00050 } 00052 } 00053 }; 00054 00055 class DT_DLL_EXEC DtDeleteFederateCmd : public DtRtiExecCmd 00056 { 00057 public: 00058 DtDeleteFederateCmd( const DtString& fedexName, int fedHandle ) : 00059 DtRtiExecCmd(), myFedexName( fedexName ), myFederateHandle( fedHandle ) {} 00060 00061 virtual ~DtDeleteFederateCmd() {} 00062 virtual void operator()( const DtRtiExec& exec ); 00063 virtual DtRtiExecCmd* clone() const 00064 { return new DtDeleteFederateCmd( myFedexName, myFederateHandle ); } 00065 00066 DtString myFedexName; 00067 int myFederateHandle; 00068 }; 00069 00070 class DT_DLL_EXEC DtEnableDisableNetworkTestingCmd : public DtRtiExecCmd 00071 { 00072 public: 00073 DtEnableDisableNetworkTestingCmd( const DtString& fedexName, bool enabled ) : 00074 DtRtiExecCmd(), myFedexName( fedexName), myEnabled (enabled ) {} 00075 00076 virtual ~DtEnableDisableNetworkTestingCmd() {} 00077 virtual void operator()( const DtRtiExec& exec ); 00078 virtual DtRtiExecCmd* clone() const 00079 { return new DtEnableDisableNetworkTestingCmd( myFedexName, myEnabled ); } 00080 00081 DtString myFedexName; 00082 bool myEnabled; 00083 }; 00084 00085 00086 class DT_DLL_EXEC DtDestroyFederationCmd : public DtRtiExecCmd 00087 { 00088 public: 00089 DtDestroyFederationCmd( const DtString& fedexName, int fedexHandle ) : 00090 DtRtiExecCmd(), myFedexName( fedexName ), myFedexHandle( fedexHandle ) {} 00091 00092 virtual ~DtDestroyFederationCmd() {} 00093 virtual void operator()( const DtRtiExec& exec ); 00094 virtual DtRtiExecCmd* clone() const 00095 { return new DtDestroyFederationCmd( myFedexName, myFedexHandle ); } 00096 00097 DtString myFedexName; 00098 int myFedexHandle; 00099 }; 00100 00101 class DT_DLL_EXEC DtChangeRidParamCmd : public DtRtiExecCmd 00102 { 00103 public: 00104 DtChangeRidParamCmd( const DtString& fedexName, int fedHandle , 00105 const DtString& ridParam, const DtString& ridValue) : 00106 DtRtiExecCmd(), myFedexName( fedexName ), myFederateHandle( fedHandle ), 00107 myRidParam(ridParam), myRidValue(ridValue) {} 00108 00109 virtual ~DtChangeRidParamCmd() {}; 00110 virtual void operator()( const DtRtiExec& exec ); 00111 virtual DtRtiExecCmd* clone() const 00112 { return new DtChangeRidParamCmd( myFedexName, myFederateHandle, myRidParam, myRidValue ); } 00113 00114 DtString myFedexName; 00115 int myFederateHandle; 00116 DtString myRidParam; 00117 DtString myRidValue; 00118 }; 00119 00120 00121 00122 class DT_DLL_EXEC DtSendMessageCmd : public DtRtiExecCmd 00123 { 00124 public: 00125 DtSendMessageCmd( const DtString& fedexName, std::auto_ptr<DtRtiMsg> msg ) : 00126 DtRtiExecCmd(), myFedexName( fedexName ), myMsg( msg ) {} 00127 00128 virtual ~DtSendMessageCmd() {} 00129 virtual void operator()( const DtRtiExec& exec ); 00130 virtual DtRtiExecCmd* clone() const 00131 { return new DtSendMessageCmd( myFedexName, std::auto_ptr<DtRtiMsg>( myMsg->clone( true ))); } 00132 00133 DtString myFedexName; 00134 std::auto_ptr<DtRtiMsg> myMsg; 00135 }; 00136 00137 00138 class DT_DLL_EXEC DtChangeNotifyLevelCmd : public DtRtiExecCmd 00139 { 00140 public: 00141 DtChangeNotifyLevelCmd( DtNotifyLevelType level ) : 00142 DtRtiExecCmd(), myLevel( level ) {} 00143 00144 virtual ~DtChangeNotifyLevelCmd() {} 00145 virtual void operator()( const DtRtiExec& exec ); 00146 virtual DtRtiExecCmd* clone() const 00147 { return new DtChangeNotifyLevelCmd( myLevel ); } 00148 00149 DtNotifyLevelType myLevel; 00150 }; 00151 00152 00153 class DT_DLL_EXEC DtEnableWebSpyCmd : public DtRtiExecCmd 00154 { 00155 public: 00156 DtEnableWebSpyCmd( MAKRti::DtInetAddr ipAddr, int port ) : 00157 DtRtiExecCmd(), myWebSpyIpAddr( ipAddr ), myWebSpyPort( port ) {} 00158 00159 virtual ~DtEnableWebSpyCmd() {} 00160 virtual void operator()( const DtRtiExec& exec ); 00161 virtual DtRtiExecCmd* clone() const 00162 { return new DtEnableWebSpyCmd( myWebSpyIpAddr, myWebSpyPort ); } 00163 00164 MAKRti::DtInetAddr myWebSpyIpAddr; 00165 int myWebSpyPort; 00166 }; 00167 00168 00169 class DT_DLL_EXEC DtLatencyTestModeCmd : public DtRtiExecCmd 00170 { 00171 public: 00172 DtLatencyTestModeCmd( const DtString& fedexName, int fedHandle, 00173 bool runTest, bool continuousType, bool shouldHaltContinuous, 00174 bool observing, unsigned int interactionPeriod, 00175 unsigned int numInteractions, unsigned int payloadBytes ) : 00176 DtRtiExecCmd(), myFedexName( fedexName ), 00177 myFederateHandle( fedHandle ), myRunTest( runTest ), 00178 myContinuousType( continuousType ), 00179 myShouldHaltContinuous( shouldHaltContinuous ), 00180 myObserving( observing ), 00181 myInteractionPeriod( interactionPeriod ), 00182 myNumInteractions( numInteractions ), 00183 myPayloadBytes( payloadBytes ) {} 00184 00185 virtual ~DtLatencyTestModeCmd() {} 00186 virtual void operator()( const DtRtiExec& exec ); 00187 virtual DtRtiExecCmd* clone() const 00188 { return new DtLatencyTestModeCmd( myFedexName, myFederateHandle, 00189 myRunTest, myContinuousType, myShouldHaltContinuous, myObserving, 00190 myInteractionPeriod, myNumInteractions, myPayloadBytes ); } 00191 00192 DtString myFedexName; 00193 int myFederateHandle; 00194 bool myRunTest; 00195 bool myContinuousType; 00196 bool myShouldHaltContinuous; 00197 bool myObserving; 00198 unsigned int myInteractionPeriod; 00199 unsigned int myNumInteractions; 00200 unsigned int myPayloadBytes; 00201 }; 00202 00203 00204 class DT_DLL_EXEC DtEnableLogCmd : public DtRtiExecCmd 00205 { 00206 public: 00207 DtEnableLogCmd() {} 00208 virtual ~DtEnableLogCmd() {} 00209 virtual void operator()( const DtRtiExec& exec ); 00210 virtual DtRtiExecCmd* clone() const 00211 { return new DtEnableLogCmd; } 00212 }; 00213 00214 00215 class DT_DLL_EXEC DtExitCmd : public DtRtiExecCmd 00216 { 00217 public: 00218 DtExitCmd() {} 00219 virtual ~DtExitCmd() {} 00220 virtual void operator()( const DtRtiExec& exec ); 00221 virtual DtRtiExecCmd* clone() const 00222 { return new DtExitCmd; } 00223 00224 }; 00225 00226 00227 00228 #endif