MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleTimeFedAmb1516e.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: simpleTimeFedAmb1516.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef MyFederateAmbassador_H_
10 #define MyFederateAmbassador_H_
11 
12 #ifdef WIN32
13 #pragma warning(disable: 4251)
14 #pragma warning(disable: 4786)
15 #pragma warning(disable: 4290)
16 #endif
17 
18 #include <RTI/Enums.h>
19 #include <RTI/Typedefs.h>
20 #include <RTI/RTI1516.h>
21 #include <RTI/NullFederateAmbassador.h>
22 #include "simpleTimeStringUtil.h"
24 #include <string>
25 #include <map>
26 
27 using namespace rti1516e;
28 
29 typedef std::map<std::wstring, AttributeHandle> DtAttrNameHandleMap;
30 typedef std::map<std::wstring, ParameterHandle> DtParamNameHandleMap;
31 
32 class DtTalkAmbData
33 {
34 
35 public:
36  DtTalkAmbData();
37  ~DtTalkAmbData();
38 
39 
40 public:
41  bool myNameReservationReturned;
42  bool myNameReservationSucceeded;
43  std::map<ObjectClassHandle, std::wstring> objectClassMap;
44  std::map<ObjectInstanceHandle, std::wstring> objectInstanceMap;
45  std::map<InteractionClassHandle,std::wstring> interactionClassMap;
46  std::map<ObjectInstanceHandle, AttributeHandleSet*> updateRequestMap;
47 
48  // Map between strings and attribute handles
49  DtAttrNameHandleMap theAttrNameHandleMap;
50 
51  // Map between strings and paramterHandles
52  DtParamNameHandleMap theParamNameHandleMap;
53 
54  // The set of Attributes that this federate's published objects will contain.
55  std::set<std::string> ourAttrs;
56 
57  // the Set of Parameters that this federate's published interactions will contain.
58  std::set<std::string> ourParms;
59 
60  // This federation of simple objects has a single master object, (determined by command line arguments)
61  // The master federate will keep the other federates from entering their main loop of execution until
62  // all of numFederates have joined.
63  bool isMaster;
64 
65  // numFederates is the number of federates (including the master) that the master should wait to join the
66  // federation before it allows any federate to enter its main loop.
67  // This variable is only used by the master federate.
68  int numFederates;
69 
70  AttributeHandleValueMap* attrValues;
71  ParameterHandleValueMap* paramValues;
72  bool isConstrained;
73  bool isRegulating;
74  bool timeAdvanced;
75  LogicalTime* time;
76  int otherFederatesReady;
77  bool registerFailed;
78  bool registerSucceeded;
79  bool announceSyncReceived;
80  bool federationIsSynchronized;
81  timeManagedEntity timeManagedObject;
82 };
83 
85 {
86 public:
88 
89  virtual ~MyFederateAmbassador ()
90  throw () ;
91 
92  // 6.3
93  virtual
94  void
95  objectInstanceNameReservationSucceeded(std::wstring const &
96  theObjectInstanceName)
97  throw (FederateInternalError);
98 
99  virtual
100  void
101  objectInstanceNameReservationFailed(std::wstring const &
102  theObjectInstanceName)
103  throw (FederateInternalError);
104 
105  // 6.5
106  virtual void discoverObjectInstance (
107  ObjectInstanceHandle theObject,
108  ObjectClassHandle theObjectClass,
109  std::wstring const & theObjectInstanceName)
110  throw (FederateInternalError);
111 
112  virtual void discoverObjectInstance (
113  ObjectInstanceHandle theObject,
114  ObjectClassHandle theObjectClass,
115  std::wstring const & theObjectInstanceName,
116  FederateHandle producingFederate)
117  throw (
118  FederateInternalError);
119 
120  // 6.11
121  virtual void reflectAttributeValues (
122  ObjectInstanceHandle theObject,
123  AttributeHandleValueMap const & theAttributeValues,
124  VariableLengthData const & theUserSuppliedTag,
125  OrderType sentOrder,
126  TransportationType theType,
127  SupplementalReflectInfo theReflectInfo)
128  throw (
129  FederateInternalError);
130 
131  virtual void reflectAttributeValues (
132  ObjectInstanceHandle theObject,
133  AttributeHandleValueMap const & theAttributeValues,
134  VariableLengthData const & theUserSuppliedTag,
135  OrderType sentOrder,
136  TransportationType theType,
137  LogicalTime const & theTime,
138  OrderType receivedOrder,
139  SupplementalReflectInfo theReflectInfo)
140  throw (
141  FederateInternalError);
142 
143  virtual void reflectAttributeValues (
144  ObjectInstanceHandle theObject,
145  AttributeHandleValueMap const & theAttributeValues,
146  VariableLengthData const & theUserSuppliedTag,
147  OrderType sentOrder,
148  TransportationType theType,
149  LogicalTime const & theTime,
150  OrderType receivedOrder,
151  MessageRetractionHandle theHandle,
152  SupplementalReflectInfo theReflectInfo)
153  throw (
154  FederateInternalError);
155 
156  // 6.13
157  virtual void receiveInteraction (
158  InteractionClassHandle theInteraction,
159  ParameterHandleValueMap const & theParameterValues,
160  VariableLengthData const & theUserSuppliedTag,
161  OrderType sentOrder,
162  TransportationType theType,
163  SupplementalReceiveInfo theReceiveInfo)
164  throw (
165  FederateInternalError);
166 
167  virtual void receiveInteraction (
168  InteractionClassHandle theInteraction,
169  ParameterHandleValueMap const & theParameterValues,
170  VariableLengthData const & theUserSuppliedTag,
171  OrderType sentOrder,
172  TransportationType theType,
173  LogicalTime const & theTime,
174  OrderType receivedOrder,
175  SupplementalReceiveInfo theReceiveInfo)
176  throw (
177  FederateInternalError);
178 
179  virtual void receiveInteraction (
180  InteractionClassHandle theInteraction,
181  ParameterHandleValueMap const & theParameterValues,
182  VariableLengthData const & theUserSuppliedTag,
183  OrderType sentOrder,
184  TransportationType theType,
185  LogicalTime const & theTime,
186  OrderType receivedOrder,
187  MessageRetractionHandle theHandle,
188  SupplementalReceiveInfo theReceiveInfo)
189  throw (
190  FederateInternalError);
191 
192  // 6.15
193  virtual void removeObjectInstance (
194  ObjectInstanceHandle theObject,
195  VariableLengthData const & theUserSuppliedTag,
196  OrderType sentOrder,
197  SupplementalRemoveInfo theRemoveInfo)
198  throw (
199  FederateInternalError);
200  virtual void removeObjectInstance (
201  ObjectInstanceHandle theObject,
202  VariableLengthData const & theUserSuppliedTag,
203  OrderType sentOrder,
204  LogicalTime const & theTime,
205  OrderType receivedOrder,
206  SupplementalRemoveInfo theRemoveInfo)
207  throw (
208  FederateInternalError);
209 
210  virtual void removeObjectInstance (
211  ObjectInstanceHandle theObject,
212  VariableLengthData const & theUserSuppliedTag,
213  OrderType sentOrder,
214  LogicalTime const & theTime,
215  OrderType receivedOrder,
216  MessageRetractionHandle theHandle,
217  SupplementalRemoveInfo theRemoveInfo)
218  throw (
219  FederateInternalError);
220 
221  virtual
222  void
223  provideAttributeValueUpdate(ObjectInstanceHandle theObject,
224  AttributeHandleSet const & theAttributes,
225  VariableLengthData const & theUserSuppliedTag)
226  throw (
227  FederateInternalError);
228 
229  virtual
230  void
231  timeRegulationEnabled(LogicalTime const & theFederateTime)
232  throw (
233  FederateInternalError);
234 
235 
236  virtual
237  void
238  timeConstrainedEnabled(LogicalTime const & theFederateTime)
239  throw (
240  FederateInternalError);
241 
242  virtual
243  void
244  timeAdvanceGrant(LogicalTime const & theTime)
245  throw (
246  FederateInternalError);
247 
248  virtual
249  void
250  requestRetraction(MessageRetractionHandle theHandle)
251  throw (FederateInternalError);
252 
253 
254  virtual
255  void
256  synchronizationPointRegistrationSucceeded(std::wstring const & label )
257  throw (FederateInternalError);
258  virtual
259  void
260  synchronizationPointRegistrationFailed(std::wstring const & label,
261  SynchronizationPointFailureReason reason)
262  throw (FederateInternalError);
263 
264  virtual
265  void
266  announceSynchronizationPoint(std::wstring const & label,
267  VariableLengthData const & theUserSuppliedTag)
268  throw (FederateInternalError);
269 
270  virtual void federationSynchronized (
271  std::wstring const & label,
272  FederateHandleSet const& failedToSyncSet)
273  throw (
274  FederateInternalError);
275 
276 
277 public:
278  DtTalkAmbData & myData;
279 };
280 
281 #endif
282 
283 
std::map< std::string, RTI::AttributeHandle > DtAttrNameHandleMap
Definition: simpleDDMSimple13.h:25
Definition: rtiSimpleFedAmb13.h:37
virtual void requestRetraction(EventRetractionHandle theHandle)=0
8.22
virtual void synchronizationPointRegistrationFailed(const char *label)=0
supplied C4)
ULong InteractionClassHandle
Definition: RTItypes13.h:106
Definition: simpleTimeTimeManagedEntity.h:28
virtual void receiveInteraction(InteractionClassHandle theInteraction, const ParameterHandleValuePairSet &theParameters, const FedTime &theTime, const char *theTag, EventRetractionHandle theHandle)=0
6.7
virtual void removeObjectInstance(ObjectHandle theObject, const FedTime &theTime, const char *theTag, EventRetractionHandle theHandle)=0
6.9
virtual void synchronizationPointRegistrationSucceeded(const char *label)=0
RTI Parameter Passing Memory Conventions.
virtual void timeAdvanceGrant(const FedTime &theTime)=0
8.13
virtual void announceSynchronizationPoint(const char *label, const char *tag)=0
4.8
virtual void federationSynchronized(const char *label)=0
4.10
virtual void discoverObjectInstance(ObjectHandle theObject, ObjectClassHandle theObjectClass, const char *theObjectName)=0
! Object Management Services //!
virtual void reflectAttributeValues(ObjectHandle theObject, const AttributeHandleValuePairSet &theAttributes, const FedTime &theTime, const char *theTag, EventRetractionHandle theHandle)=0
6.5
Definition: rtiSimpleFedAmb13.h:13
virtual void provideAttributeValueUpdate(ObjectHandle theObject, const AttributeHandleSet &theAttributes)=0
6.16
ULong FederateHandle
Definition: RTItypes13.h:120
std::map< std::string, RTI::ParameterHandle > DtParamNameHandleMap
Definition: simpleDDMSimple13.h:27
virtual Boolean throw(SpecifiedSaveLabelDoesNotExist, ConcurrentAccessAttempted, RTIinternalError)
ULong ObjectClassHandle
Definition: RTItypes13.h:104
virtual void timeConstrainedEnabled(const FedTime &theFederateTime)=0
8.6
OrderingHandle OrderType
Definition: RTItypes13.h:128
virtual void timeRegulationEnabled(const FedTime &theFederateTime)=0
! Time Management Services //!
NullFederateAmbassador()
Definition: NullFederateAmbassador13.h:39

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)