MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, DtUniquePtr<DtRtiMsg> msg ) :
126  DtRtiExecCmd(), myFedexName( fedexName ), myMsg(DtMoveUnique(msg) ) {}
127 
128  virtual ~DtSendMessageCmd() {}
129  virtual void operator()( const DtRtiExec& exec );
130  virtual DtRtiExecCmd* clone() const
131  { return new DtSendMessageCmd( myFedexName, DtUniquePtr<DtRtiMsg>( myMsg->clone( true ))); }
132 
133  DtString myFedexName;
134  DtUniquePtr<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 
153 {
154 public:
155  DtLatencyTestModeCmd( const DtString& fedexName, int fedHandle,
156  bool runTest, bool continuousType, bool shouldHaltContinuous,
157  bool observing, unsigned int interactionPeriod,
158  unsigned int numInteractions, unsigned int payloadBytes ) :
159  DtRtiExecCmd(), myFedexName( fedexName ),
160  myFederateHandle( fedHandle ), myRunTest( runTest ),
161  myContinuousType( continuousType ),
162  myShouldHaltContinuous( shouldHaltContinuous ),
163  myObserving( observing ),
164  myInteractionPeriod( interactionPeriod ),
165  myNumInteractions( numInteractions ),
166  myPayloadBytes( payloadBytes ) {}
167 
169  virtual void operator()( const DtRtiExec& exec );
170  virtual DtRtiExecCmd* clone() const
171  { return new DtLatencyTestModeCmd( myFedexName, myFederateHandle,
172  myRunTest, myContinuousType, myShouldHaltContinuous, myObserving,
173  myInteractionPeriod, myNumInteractions, myPayloadBytes ); }
174 
175  DtString myFedexName;
177  bool myRunTest;
181  unsigned int myInteractionPeriod;
182  unsigned int myNumInteractions;
183  unsigned int myPayloadBytes;
184 };
185 
186 
188 {
189 public:
191  virtual ~DtEnableLogCmd() {}
192  virtual void operator()( const DtRtiExec& exec );
193  virtual DtRtiExecCmd* clone() const
194  { return new DtEnableLogCmd; }
195 };
196 
197 
199 {
200 public:
202  virtual ~DtExitCmd() {}
203  virtual void operator()( const DtRtiExec& exec );
204  virtual DtRtiExecCmd* clone() const
205  { return new DtExitCmd; }
206 
207 };
208 
209 
210 
211 #endif
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:78
DtString myFedexName
Definition: execCmds.h:114
virtual ~DtDestroyFederationCmd()
Definition: execCmds.h:92
DtDestroyFederationCmd(const DtString &fedexName, int fedexHandle)
Definition: execCmds.h:89
Definition: execCmds.h:86
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:193
int myFederateHandle
Definition: execCmds.h:67
Definition: execCmds.h:198
bool myEnabled
Definition: execCmds.h:82
DtString myFedexName
Definition: execCmds.h:81
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:63
DtString myFedexName
Definition: execCmds.h:66
DtString myFedexName
Definition: execCmds.h:175
DtEnableLogCmd()
Definition: execCmds.h:190
DtString myFedexName
Definition: execCmds.h:133
DtDeleteFederateCmd(const DtString &fedexName, int fedHandle)
Definition: execCmds.h:58
unsigned int myNumInteractions
Definition: execCmds.h:182
int myFedexHandle
Definition: execCmds.h:98
DtExitCmd()
Definition: execCmds.h:201
virtual ~DtLatencyTestModeCmd()
Definition: execCmds.h:168
Definition: execCmds.h:101
unsigned int myPayloadBytes
Definition: execCmds.h:183
DtChangeRidParamCmd(const DtString &fedexName, int fedHandle, const DtString &ridParam, const DtString &ridValue)
Definition: execCmds.h:104
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:146
int myFederateHandle
Definition: execCmds.h:115
Definition: execCmds.h:122
DtString myRidValue
Definition: execCmds.h:117
#define DtMoveUnique(ptr)
Definition: internalTypes.h:32
bool myObserving
Definition: execCmds.h:180
virtual ~DtChangeNotifyLevelCmd()
Definition: execCmds.h:144
bool myContinuousType
Definition: execCmds.h:178
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:94
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:170
Definition: execCmds.h:138
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
DtSendMessageCmd(const DtString &fedexName, DtUniquePtr< DtRtiMsg > msg)
Definition: execCmds.h:125
Definition: execCmds.h:55
DtUniquePtr< DtRtiMsg > myMsg
Definition: execCmds.h:134
virtual ~DtExitCmd()
Definition: execCmds.h:202
DtChangeNotifyLevelCmd(DtNotifyLevelType level)
Definition: execCmds.h:141
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:111
Definition: exec.h:148
DtNotifyLevelType myLevel
Definition: execCmds.h:149
virtual ~DtDeleteFederateCmd()
Definition: execCmds.h:61
virtual ~DtEnableLogCmd()
Definition: execCmds.h:191
virtual ~DtEnableDisableNetworkTestingCmd()
Definition: execCmds.h:76
virtual ~DtSendMessageCmd()
Definition: execCmds.h:128
DtRtiExecCmd()
Definition: execCmds.h:32
DtString myFedexName
Definition: execCmds.h:97
bool myRunTest
Definition: execCmds.h:177
Definition: execCmds.h:152
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:204
virtual DtRtiExecCmd * clone() const
Definition: execCmds.h:130
DtString myRidParam
Definition: execCmds.h:116
DtEnableDisableNetworkTestingCmd(const DtString &fedexName, bool enabled)
Definition: execCmds.h:73
bool myShouldHaltContinuous
Definition: execCmds.h:179
unsigned int myInteractionPeriod
Definition: execCmds.h:181
Definition: execCmds.h:187
Definition: execCmds.h:70
DtLatencyTestModeCmd(const DtString &fedexName, int fedHandle, bool runTest, bool continuousType, bool shouldHaltContinuous, bool observing, unsigned int interactionPeriod, unsigned int numInteractions, unsigned int payloadBytes)
Definition: execCmds.h:155
DtRtiExecCmd base class enforces clone() and operator() ability and provides a very basic functor com...
Definition: execCmds.h:28
int myFederateHandle
Definition: execCmds.h:176
virtual bool operator==(const DtRtiExecCmd &value)
The default comparison uses RTTI typeid to treat functor as a standard function pointer (ie - same fu...
Definition: execCmds.h:41
#define DT_DLL_EXEC
Definition: rtiMsConfig.h:152
virtual void operator()(const DtRtiExec &exec)=0
virtual ~DtRtiExecCmd()
Definition: execCmds.h:33
virtual ~DtChangeRidParamCmd()
Definition: execCmds.h:109

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)