MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleTimeFedAmb1516.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/RTI1516.h>
20 #include "simpleTimeStringUtil.h"
22 #include <string>
23 #include <map>
24 
25 typedef std::map<std::wstring, rti1516::AttributeHandle> DtAttrNameHandleMap;
26 typedef std::map<std::wstring, rti1516::ParameterHandle> DtParamNameHandleMap;
27 
28 class DtTalkAmbData
29 {
30 
31 public:
32  DtTalkAmbData();
34 
35 
36 public:
39  std::map<rti1516::ObjectClassHandle, std::wstring> objectClassMap;
40  std::map<rti1516::ObjectInstanceHandle, std::wstring> objectInstanceMap;
41  std::map<rti1516::InteractionClassHandle,std::wstring> interactionClassMap;
42  std::map<rti1516::ObjectInstanceHandle, rti1516::AttributeHandleSet*> updateRequestMap;
43 
44  // Map between strings and attribute handles
46 
47  // Map between strings and paramterHandles
49 
50  // The set of Attributes that this federate's published objects will contain.
51  std::set<std::string> ourAttrs;
52 
53  // the Set of Parameters that this federate's published interactions will contain.
54  std::set<std::string> ourParms;
55 
56  // This federation of simple objects has a single master object, (determined by command line arguments)
57  // The master federate will keep the other federates from entering their main loop of execution until
58  // all of numFederates have joined.
59  bool isMaster;
60 
61  // numFederates is the number of federates (including the master) that the master should wait to join the
62  // federation before it allows any federate to enter its main loop.
63  // This variable is only used by the master federate.
64  int numFederates;
65 
68  bool isConstrained;
69  bool isRegulating;
70  bool timeAdvanced;
73  bool registerFailed;
74  bool registerSucceeded;
78 };
79 
81 {
82 public:
83 
85 
86  virtual ~MyFederateAmbassador()
87  throw ();
88 
89  // 6.3
90  virtual
91  void
92  objectInstanceNameReservationSucceeded(std::wstring const &
93  theObjectInstanceName)
94  throw (rti1516::UnknownName,
95  rti1516::FederateInternalError);
96 
97  virtual
98  void
99  objectInstanceNameReservationFailed(std::wstring const &
100  theObjectInstanceName)
101  throw (rti1516::UnknownName,
102  rti1516::FederateInternalError);
103 
104  // 6.5
105  virtual void discoverObjectInstance (
106  rti1516::ObjectInstanceHandle theObject,
107  rti1516::ObjectClassHandle theObjectClass,
108  std::wstring const & theObjectInstanceName)
109  throw (
110  rti1516::CouldNotDiscover,
111  rti1516::ObjectClassNotKnown,
112  rti1516::FederateInternalError);
113 
114  // 6.7
115  virtual
116  void
118  (rti1516::ObjectInstanceHandle theObject,
119  rti1516::AttributeHandleValueMap const & theAttributeValues,
120  rti1516::VariableLengthData const & theUserSuppliedTag,
121  rti1516::OrderType sentOrder,
123  throw (rti1516::ObjectInstanceNotKnown,
124  rti1516::AttributeNotRecognized,
125  rti1516::AttributeNotSubscribed,
126  rti1516::FederateInternalError);
127 
128  virtual
129  void
131  (rti1516::ObjectInstanceHandle theObject,
132  rti1516::AttributeHandleValueMap const & theAttributeValues,
133  rti1516::VariableLengthData const & theUserSuppliedTag,
134  rti1516::OrderType sentOrder,
136  rti1516::RegionHandleSet const & theSentRegionHandleSet)
137  throw (rti1516::ObjectInstanceNotKnown,
138  rti1516::AttributeNotRecognized,
139  rti1516::AttributeNotSubscribed,
140  rti1516::FederateInternalError);
141 
142  virtual
143  void
145  (rti1516::ObjectInstanceHandle theObject,
146  rti1516::AttributeHandleValueMap const & theAttributeValues,
147  rti1516::VariableLengthData const & theUserSuppliedTag,
148  rti1516::OrderType sentOrder,
150  rti1516::LogicalTime const & theTime,
151  rti1516::OrderType receivedOrder)
152  throw (rti1516::ObjectInstanceNotKnown,
153  rti1516::AttributeNotRecognized,
154  rti1516::AttributeNotSubscribed,
155  rti1516::FederateInternalError);
156 
157  virtual
158  void
160  (rti1516::ObjectInstanceHandle theObject,
161  rti1516::AttributeHandleValueMap const & theAttributeValues,
162  rti1516::VariableLengthData const & theUserSuppliedTag,
163  rti1516::OrderType sentOrder,
165  rti1516::LogicalTime const & theTime,
166  rti1516::OrderType receivedOrder,
167  rti1516::RegionHandleSet const & theSentRegionHandleSet)
168  throw (rti1516::ObjectInstanceNotKnown,
169  rti1516::AttributeNotRecognized,
170  rti1516::AttributeNotSubscribed,
171  rti1516::FederateInternalError);
172 
173  virtual
174  void
176  (rti1516::ObjectInstanceHandle theObject,
177  rti1516::AttributeHandleValueMap const & theAttributeValues,
178  rti1516::VariableLengthData const & theUserSuppliedTag,
179  rti1516::OrderType sentOrder,
181  rti1516::LogicalTime const & theTime,
182  rti1516::OrderType receivedOrder,
183  rti1516::MessageRetractionHandle theHandle)
184  throw (rti1516::ObjectInstanceNotKnown,
185  rti1516::AttributeNotRecognized,
186  rti1516::AttributeNotSubscribed,
187  rti1516::InvalidLogicalTime,
188  rti1516::FederateInternalError);
189 
190  virtual
191  void
193  (rti1516::ObjectInstanceHandle theObject,
194  rti1516::AttributeHandleValueMap const & theAttributeValues,
195  rti1516::VariableLengthData const & theUserSuppliedTag,
196  rti1516::OrderType sentOrder,
198  rti1516::LogicalTime const & theTime,
199  rti1516::OrderType receivedOrder,
200  rti1516::MessageRetractionHandle theHandle,
201  rti1516::RegionHandleSet const & theSentRegionHandleSet)
202  throw (rti1516::ObjectInstanceNotKnown,
203  rti1516::AttributeNotRecognized,
204  rti1516::AttributeNotSubscribed,
205  rti1516::InvalidLogicalTime,
206  rti1516::FederateInternalError);
207 
208 
209  // 6.9
210  virtual
211  void
213  (rti1516::InteractionClassHandle theInteraction,
214  rti1516::ParameterHandleValueMap const & theParameterValues,
215  rti1516::VariableLengthData const & theUserSuppliedTag,
216  rti1516::OrderType sentOrder,
218  throw (rti1516::InteractionClassNotRecognized,
219  rti1516::InteractionParameterNotRecognized,
220  rti1516::InteractionClassNotSubscribed,
221  rti1516::FederateInternalError);
222 
223  virtual
224  void
226  (rti1516::InteractionClassHandle theInteraction,
227  rti1516::ParameterHandleValueMap const & theParameterValues,
228  rti1516::VariableLengthData const & theUserSuppliedTag,
229  rti1516::OrderType sentOrder,
231  rti1516::RegionHandleSet const & theSentRegionHandleSet)
232  throw (rti1516::InteractionClassNotRecognized,
233  rti1516::InteractionParameterNotRecognized,
234  rti1516::InteractionClassNotSubscribed,
235  rti1516::FederateInternalError);
236 
237  virtual
238  void
240  (rti1516::InteractionClassHandle theInteraction,
241  rti1516::ParameterHandleValueMap const & theParameterValues,
242  rti1516::VariableLengthData const & theUserSuppliedTag,
243  rti1516::OrderType sentOrder,
245  rti1516::LogicalTime const & theTime,
246  rti1516::OrderType receivedOrder)
247  throw (rti1516::InteractionClassNotRecognized,
248  rti1516::InteractionParameterNotRecognized,
249  rti1516::InteractionClassNotSubscribed,
250  rti1516::FederateInternalError);
251 
252  virtual
253  void
255  (rti1516::InteractionClassHandle theInteraction,
256  rti1516::ParameterHandleValueMap const & theParameterValues,
257  rti1516::VariableLengthData const & theUserSuppliedTag,
258  rti1516::OrderType sentOrder,
260  rti1516::LogicalTime const & theTime,
261  rti1516::OrderType receivedOrder,
262  rti1516::RegionHandleSet const & theSentRegionHandleSet)
263  throw (rti1516::InteractionClassNotRecognized,
264  rti1516::InteractionParameterNotRecognized,
265  rti1516::InteractionClassNotSubscribed,
266  rti1516::FederateInternalError);
267 
268  virtual
269  void
271  (rti1516::InteractionClassHandle theInteraction,
272  rti1516::ParameterHandleValueMap const & theParameterValues,
273  rti1516::VariableLengthData const & theUserSuppliedTag,
274  rti1516::OrderType sentOrder,
276  rti1516::LogicalTime const & theTime,
277  rti1516::OrderType receivedOrder,
278  rti1516::MessageRetractionHandle theHandle)
279  throw (rti1516::InteractionClassNotRecognized,
280  rti1516::InteractionParameterNotRecognized,
281  rti1516::InteractionClassNotSubscribed,
282  rti1516::InvalidLogicalTime,
283  rti1516::FederateInternalError);
284 
285  virtual
286  void
288  (rti1516::InteractionClassHandle theInteraction,
289  rti1516::ParameterHandleValueMap const & theParameterValues,
290  rti1516::VariableLengthData const & theUserSuppliedTag,
291  rti1516::OrderType sentOrder,
293  rti1516::LogicalTime const & theTime,
294  rti1516::OrderType receivedOrder,
295  rti1516::MessageRetractionHandle theHandle,
296  rti1516::RegionHandleSet const & theSentRegionHandleSet)
297  throw (rti1516::InteractionClassNotRecognized,
298  rti1516::InteractionParameterNotRecognized,
299  rti1516::InteractionClassNotSubscribed,
300  rti1516::InvalidLogicalTime,
301  rti1516::FederateInternalError);
302 
303  virtual
304  void
305  removeObjectInstance(rti1516::ObjectInstanceHandle theObject,
306  rti1516::VariableLengthData const & theUserSuppliedTag,
307  rti1516::OrderType sentOrder)
308  throw (rti1516::ObjectInstanceNotKnown,
309  rti1516::FederateInternalError);
310 
311  virtual
312  void
313  removeObjectInstance(rti1516::ObjectInstanceHandle theObject,
314  rti1516::VariableLengthData const & theUserSuppliedTag,
315  rti1516::OrderType sentOrder,
316  rti1516::LogicalTime const & theTime,
317  rti1516::OrderType receivedOrder)
318  throw (rti1516::ObjectInstanceNotKnown,
319  rti1516::FederateInternalError);
320 
321  virtual
322  void
323  removeObjectInstance(rti1516::ObjectInstanceHandle theObject,
324  rti1516::VariableLengthData const & theUserSuppliedTag,
325  rti1516::OrderType sentOrder,
326  rti1516::LogicalTime const & theTime,
327  rti1516::OrderType receivedOrder,
328  rti1516::MessageRetractionHandle theHandle)
329  throw (rti1516::ObjectInstanceNotKnown,
330  rti1516::InvalidLogicalTime,
331  rti1516::FederateInternalError);
332 
333  virtual
334  void
335  provideAttributeValueUpdate(rti1516::ObjectInstanceHandle theObject,
336  rti1516::AttributeHandleSet const & theAttributes,
337  rti1516::VariableLengthData const & theUserSuppliedTag)
338  throw (rti1516::ObjectInstanceNotKnown,
339  rti1516::AttributeNotRecognized,
340  rti1516::AttributeNotOwned,
341  rti1516::FederateInternalError);
342 
343  virtual
344  void
345  timeRegulationEnabled(rti1516::LogicalTime const & theFederateTime)
346  throw (rti1516::InvalidLogicalTime,
347  rti1516::NoRequestToEnableTimeRegulationWasPending,
348  rti1516::FederateInternalError);
349 
350 
351  virtual
352  void
353  timeConstrainedEnabled(rti1516::LogicalTime const & theFederateTime)
354  throw (rti1516::InvalidLogicalTime,
355  rti1516::NoRequestToEnableTimeConstrainedWasPending,
356  rti1516::FederateInternalError);
357 
358  virtual
359  void
360  timeAdvanceGrant(rti1516::LogicalTime const & theTime)
361  throw (rti1516::InvalidLogicalTime,
362  rti1516::JoinedFederateIsNotInTimeAdvancingState,
363  rti1516::FederateInternalError);
364 
365  virtual
366  void
367  requestRetraction(rti1516::MessageRetractionHandle theHandle)
368  throw (rti1516::FederateInternalError);
369 
370 
371  virtual
372  void
373  synchronizationPointRegistrationSucceeded(std::wstring const & label )
374  throw (rti1516::FederateInternalError);
375  virtual
376  void
377  synchronizationPointRegistrationFailed(std::wstring const & label,
379  throw (rti1516::FederateInternalError);
380 
381  virtual
382  void
383  announceSynchronizationPoint(std::wstring const & label,
384  rti1516::VariableLengthData const & theUserSuppliedTag)
385  throw (rti1516::FederateInternalError);
386 
387  virtual
388  void
389  federationSynchronized(std::wstring const & label)
390  throw (rti1516::FederateInternalError);
391 
392 
393 public:
395 };
396 
397 #endif
virtual void objectInstanceNameReservationFailed(std::wstring const &theObjectInstanceName)
A convenience header provided for developers that would like to include everything all at once...
std::map< std::string, RTI::AttributeHandle > DtAttrNameHandleMap
Definition: simpleDDMSimple13.h:25
std::set< std::string > ourAttrs
Definition: simpleTimeFedAmb13.h:45
std::map< ObjectClassHandle, std::string > objectClassMap
Definition: rtiSimpleFedAmb13dlc.h:33
rti1516::LogicalTime * time
Definition: simpleTimeFedAmb1516.h:71
Basic federate ambassador service callback implementation.
Definition: rtiSimpleFedAmb13.h:35
bool isRegulating
Definition: simpleTimeFedAmb13.h:64
DtParamNameHandleMap theParamNameHandleMap
Definition: simpleTimeFedAmb13.h:42
DtAttrNameHandleMap theAttrNameHandleMap
Definition: simpleTimeFedAmb13.h:39
virtual void provideAttributeValueUpdate(RTI::ObjectHandle theObject, const RTI::AttributeHandleSet &theAttributes)
std::map< ObjectHandle, std::string > objectInstanceMap
Definition: rtiSimpleFedAmb13dlc.h:34
virtual void receiveInteraction(RTI::InteractionClassHandle theInteraction, const RTI::ParameterHandleValuePairSet &theParameters, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void objectInstanceNameReservationSucceeded(std::wstring const &theObjectInstanceName)
bool registerSucceeded
Definition: simpleTimeFedAmb13.h:69
OrderType
Definition: Enums.h:13
std::set< RegionHandle > RegionHandleSet
Definition: Typedefs.h:31
virtual void synchronizationPointRegistrationSucceeded(const char *label)
std::map< InteractionClassHandle, std::string > interactionClassMap
Definition: rtiSimpleFedAmb13dlc.h:35
virtual void synchronizationPointRegistrationFailed(const char *label)
virtual void removeObjectInstance(RTI::ObjectHandle theObject, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
bool timeAdvanced
Definition: simpleTimeFedAmb13.h:65
Definition: simpleTimeTimeManagedEntity.h:32
virtual void reflectAttributeValues(RTI::ObjectHandle theObject, const RTI::AttributeHandleValuePairSet &theAttributes, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void requestRetraction(rti1516_2025::MessageRetractionHandle const &theHandle)
bool isConstrained
Definition: simpleTimeFedAmb13.h:63
DtSimpleData & myData
Definition: rtiSimpleFedAmb13.h:98
virtual void discoverObjectInstance(RTI::ObjectHandle theObject, RTI::ObjectClassHandle theObjectClass, const char *theObjectName)
virtual void timeAdvanceGrant(const RTI::FedTime &theTime)
timeManagedEntity timeManagedObject
Definition: simpleTimeFedAmb13.h:72
bool isMaster
Definition: simpleTimeFedAmb13.h:53
bool announceSyncReceived
Definition: simpleTimeFedAmb13.h:70
rti1516::ParameterHandleValueMap * paramValues
Definition: simpleTimeFedAmb1516.h:67
std::map< ParameterHandle, VariableLengthData > ParameterHandleValueMap
Definition: Typedefs.h:41
SynchronizationFailureReason
Definition: Enums.h:75
int numFederates
Definition: simpleTimeFedAmb13.h:58
std::map< AttributeHandle, VariableLengthData > AttributeHandleValueMap
Definition: Typedefs.h:36
Definition: NullFederateAmbassador.h:14
Definition: rtiSimpleFedAmb13dlc.h:15
std::set< AttributeHandle > AttributeHandleSet
Definition: Typedefs.h:27
int otherFederatesReady
Definition: simpleTimeFedAmb13.h:67
bool registerFailed
Definition: simpleTimeFedAmb13.h:68
Definition: VariableLengthData.h:22
virtual ~MyFederateAmbassador()
rti1516::AttributeHandleValueMap * attrValues
Definition: simpleTimeFedAmb1516.h:66
bool myNameReservationSucceeded
Definition: simpleDDMFedAmb1516.h:28
std::map< std::string, RTI::ParameterHandle > DtParamNameHandleMap
Definition: simpleDDMSimple13.h:27
virtual void timeConstrainedEnabled(const RTI::FedTime &theFederateTime)
Definition: LogicalTime.h:27
This file provides an example derivation of the rti1516_2025::FederateAmbassador with NULL actions fo...
std::map< rti1516::ObjectInstanceHandle, rti1516::AttributeHandleSet * > updateRequestMap
Definition: simpleTimeFedAmb1516.h:42
MyFederateAmbassador(DtSimpleData &data)
virtual void announceSynchronizationPoint(const char *label, const char *tag)
bool myNameReservationReturned
Definition: simpleDDMFedAmb1516.h:27
bool federationIsSynchronized
Definition: simpleTimeFedAmb13.h:71
virtual void federationSynchronized(const char *label)
std::set< std::string > ourParms
Definition: simpleTimeFedAmb13.h:48
TransportationType
Definition: Enums.h:84
virtual void timeRegulationEnabled(const RTI::FedTime &theFederateTime)

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)