MAK RTIspy API Documentation for HLA 1.3
execCmds.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: execCmds.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
10 
11 #ifndef DtRtiExecCmdFunctor_H_
12 #define DtRtiExecCmdFunctor_H_
13 
14 #include <rtiMsConfig.h>
15 #include <rtiMsg.h>
16 #include <vlutil/vlPrint.h>
17 #include <vlutil/vlInetAddr.h>
18 #include <memory>
19 #include <typeinfo>
20 
21 class DtRtiExec;
22 class DtRtiMsg;
23 
24 
29 {
30 public:
31 
33  virtual ~DtRtiExecCmd() {}
34  virtual DtRtiExecCmd* clone() const = 0;
35  virtual void operator()( const DtRtiExec& exec ) = 0;
36 
41  virtual bool operator==( const DtRtiExecCmd& value )
42  {
43  if ( typeid(*this) == typeid(value) )
44  {
45  return true;
46  }
47  else
48  {
49  return false;
50  }
52  }
53 };
54 
56 {
57 public:
58  DtDeleteFederateCmd( const DtString& fedexName, int fedHandle ) :
59  DtRtiExecCmd(), myFedexName( fedexName ), myFederateHandle( fedHandle ) {}
60 
61  virtual ~DtDeleteFederateCmd() {}
62  virtual void operator()( const DtRtiExec& exec );
63  virtual DtRtiExecCmd* clone() const
64  { return new DtDeleteFederateCmd( myFedexName, myFederateHandle ); }
65 
66  DtString myFedexName;
68 };
69 
71 {
72 public:
73  DtEnableDisableNetworkTestingCmd( const DtString& fedexName, bool enabled ) :
74  DtRtiExecCmd(), myFedexName( fedexName), myEnabled (enabled ) {}
75 
77  virtual void operator()( const DtRtiExec& exec );
78  virtual DtRtiExecCmd* clone() const
79  { return new DtEnableDisableNetworkTestingCmd( myFedexName, myEnabled ); }
80 
81  DtString myFedexName;
82  bool myEnabled;
83 };
84 
85 
87 {
88 public:
89  DtDestroyFederationCmd( const DtString& fedexName, int fedexHandle ) :
90  DtRtiExecCmd(), myFedexName( fedexName ), myFedexHandle( fedexHandle ) {}
91 
93  virtual void operator()( const DtRtiExec& exec );
94  virtual DtRtiExecCmd* clone() const
95  { return new DtDestroyFederationCmd( myFedexName, myFedexHandle ); }
96 
97  DtString myFedexName;
99 };
100 
102 {
103 public:
104  DtChangeRidParamCmd( const DtString& fedexName, int fedHandle ,
105  const DtString& ridParam, const DtString& ridValue) :
106  DtRtiExecCmd(), myFedexName( fedexName ), myFederateHandle( fedHandle ),
107  myRidParam(ridParam), myRidValue(ridValue) {}
108 
109  virtual ~DtChangeRidParamCmd() {};
110  virtual void operator()( const DtRtiExec& exec );
111  virtual DtRtiExecCmd* clone() const
112  { return new DtChangeRidParamCmd( myFedexName, myFederateHandle, myRidParam, myRidValue ); }
113 
114  DtString myFedexName;
116  DtString myRidParam;
117  DtString myRidValue;
118 };
119 
120 
121 
123 {
124 public:
125  DtSendMessageCmd( const DtString& fedexName, std::auto_ptr<DtRtiMsg> msg ) :
126  DtRtiExecCmd(), myFedexName( fedexName ), myMsg( msg ) {}
127 
128  virtual ~DtSendMessageCmd() {}
129  virtual void operator()( const DtRtiExec& exec );
130  virtual DtRtiExecCmd* clone() const
131  { return new DtSendMessageCmd( myFedexName, std::auto_ptr<DtRtiMsg>( myMsg->clone( true ))); }
132 
133  DtString myFedexName;
134  std::auto_ptr<DtRtiMsg> myMsg;
135 };
136 
137 
139 {
140 public:
141  DtChangeNotifyLevelCmd( DtNotifyLevelType level ) :
142  DtRtiExecCmd(), myLevel( level ) {}
143 
145  virtual void operator()( const DtRtiExec& exec );
146  virtual DtRtiExecCmd* clone() const
147  { return new DtChangeNotifyLevelCmd( myLevel ); }
148 
149  DtNotifyLevelType myLevel;
150 };
151 
152 
154 {
155 public:
156  DtEnableWebSpyCmd( MAKRti::DtInetAddr ipAddr, int port ) :
157  DtRtiExecCmd(), myWebSpyIpAddr( ipAddr ), myWebSpyPort( port ) {}
158 
159  virtual ~DtEnableWebSpyCmd() {}
160  virtual void operator()( const DtRtiExec& exec );
161  virtual DtRtiExecCmd* clone() const
162  { return new DtEnableWebSpyCmd( myWebSpyIpAddr, myWebSpyPort ); }
163 
164  MAKRti::DtInetAddr myWebSpyIpAddr;
166 };
167 
168 
170 {
171 public:
172  DtLatencyTestModeCmd( const DtString& fedexName, int fedHandle,
173  bool runTest, bool continuousType, bool shouldHaltContinuous,
174  bool observing, unsigned int interactionPeriod,
175  unsigned int numInteractions, unsigned int payloadBytes ) :
176  DtRtiExecCmd(), myFedexName( fedexName ),
177  myFederateHandle( fedHandle ), myRunTest( runTest ),
178  myContinuousType( continuousType ),
179  myShouldHaltContinuous( shouldHaltContinuous ),
180  myObserving( observing ),
181  myInteractionPeriod( interactionPeriod ),
182  myNumInteractions( numInteractions ),
183  myPayloadBytes( payloadBytes ) {}
184 
186  virtual void operator()( const DtRtiExec& exec );
187  virtual DtRtiExecCmd* clone() const
188  { return new DtLatencyTestModeCmd( myFedexName, myFederateHandle,
189  myRunTest, myContinuousType, myShouldHaltContinuous, myObserving,
190  myInteractionPeriod, myNumInteractions, myPayloadBytes ); }
191 
192  DtString myFedexName;
194  bool myRunTest;
198  unsigned int myInteractionPeriod;
199  unsigned int myNumInteractions;
200  unsigned int myPayloadBytes;
201 };
202 
203 
205 {
206 public:
208  virtual ~DtEnableLogCmd() {}
209  virtual void operator()( const DtRtiExec& exec );
210  virtual DtRtiExecCmd* clone() const
211  { return new DtEnableLogCmd; }
212 };
213 
214 
216 {
217 public:
219  virtual ~DtExitCmd() {}
220  virtual void operator()( const DtRtiExec& exec );
221  virtual DtRtiExecCmd* clone() const
222  { return new DtExitCmd; }
223 
224 };
225 
226 
227 
228 #endif

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)