MAK RTIspy API Documentation for HLA 1516
simpleTimeFedAmb1516.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2004 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>
19 #include <RTI/NullFederateAmbassador.h>
20 #include "simpleTimeStringUtil.h"
22 #include <string>
23 #include <map>
24 
25 using namespace rti1516;
26 
27 typedef std::map<std::wstring, AttributeHandle> DtAttrNameHandleMap;
28 typedef std::map<std::wstring, ParameterHandle> DtParamNameHandleMap;
29 
30 class DtTalkAmbData
31 {
32 
33 public:
34  DtTalkAmbData();
35  ~DtTalkAmbData();
36 
37 
38 public:
39  bool myNameReservationReturned;
40  bool myNameReservationSucceeded;
41  std::map<ObjectClassHandle, std::wstring> objectClassMap;
42  std::map<ObjectInstanceHandle, std::wstring> objectInstanceMap;
43  std::map<InteractionClassHandle,std::wstring> interactionClassMap;
44  std::map<ObjectInstanceHandle, AttributeHandleSet*> updateRequestMap;
45 
46  // Map between strings and attribute handles
48 
49  // Map between strings and paramterHandles
51 
52  // The set of Attributes that this federate's published objects will contain.
53  std::set<std::string> ourAttrs;
54 
55  // the Set of Parameters that this federate's published interactions will contain.
56  std::set<std::string> ourParms;
57 
58  // This federation of simple objects has a single master object, (determined by command line arguments)
59  // The master federate will keep the other federates from entering their main loop of execution until
60  // all of numFederates have joined.
61  bool isMaster;
62 
63  // numFederates is the number of federates (including the master) that the master should wait to join the
64  // federation before it allows any federate to enter its main loop.
65  // This variable is only used by the master federate.
66  int numFederates;
67 
70  bool isConstrained;
71  bool isRegulating;
72  bool timeAdvanced;
73  int otherFederatesReady;
74  bool registerFailed;
75  bool registerSucceeded;
76  bool announceSyncReceived;
77  bool federationIsSynchronized;
78  timeManagedEntity timeManagedObject;
79 };
80 
82 {
83 public:
84 
86 
87  virtual ~MyFederateAmbassador()
88  throw ();
89 
90  // 6.3
91  virtual
92  void
93  objectInstanceNameReservationSucceeded(std::wstring const &
94  theObjectInstanceName)
95  throw (UnknownName,
96  FederateInternalError);
97 
98  virtual
99  void
100  objectInstanceNameReservationFailed(std::wstring const &
101  theObjectInstanceName)
102  throw (UnknownName,
103  FederateInternalError);
104 
105  // 6.5
106  virtual void discoverObjectInstance (
107  ObjectInstanceHandle theObject,
108  ObjectClassHandle theObjectClass,
109  std::wstring const & theObjectInstanceName)
110  throw (
111  CouldNotDiscover,
112  ObjectClassNotKnown,
113  FederateInternalError);
114 
115  // 6.7
116  virtual
117  void
119  (ObjectInstanceHandle theObject,
120  AttributeHandleValueMap const & theAttributeValues,
121  VariableLengthData const & theUserSuppliedTag,
122  OrderType sentOrder,
123  TransportationType theType)
124  throw (ObjectInstanceNotKnown,
125  AttributeNotRecognized,
126  AttributeNotSubscribed,
127  FederateInternalError);
128 
129  virtual
130  void
132  (ObjectInstanceHandle theObject,
133  AttributeHandleValueMap const & theAttributeValues,
134  VariableLengthData const & theUserSuppliedTag,
135  OrderType sentOrder,
136  TransportationType theType,
137  RegionHandleSet const & theSentRegionHandleSet)
138  throw (ObjectInstanceNotKnown,
139  AttributeNotRecognized,
140  AttributeNotSubscribed,
141  FederateInternalError);
142 
143  virtual
144  void
146  (ObjectInstanceHandle theObject,
147  AttributeHandleValueMap const & theAttributeValues,
148  VariableLengthData const & theUserSuppliedTag,
149  OrderType sentOrder,
150  TransportationType theType,
151  LogicalTime const & theTime,
152  OrderType receivedOrder)
153  throw (ObjectInstanceNotKnown,
154  AttributeNotRecognized,
155  AttributeNotSubscribed,
156  FederateInternalError);
157 
158  virtual
159  void
161  (ObjectInstanceHandle theObject,
162  AttributeHandleValueMap const & theAttributeValues,
163  VariableLengthData const & theUserSuppliedTag,
164  OrderType sentOrder,
165  TransportationType theType,
166  LogicalTime const & theTime,
167  OrderType receivedOrder,
168  RegionHandleSet const & theSentRegionHandleSet)
169  throw (ObjectInstanceNotKnown,
170  AttributeNotRecognized,
171  AttributeNotSubscribed,
172  FederateInternalError);
173 
174  virtual
175  void
177  (ObjectInstanceHandle theObject,
178  AttributeHandleValueMap const & theAttributeValues,
179  VariableLengthData const & theUserSuppliedTag,
180  OrderType sentOrder,
181  TransportationType theType,
182  LogicalTime const & theTime,
183  OrderType receivedOrder,
184  MessageRetractionHandle theHandle)
185  throw (ObjectInstanceNotKnown,
186  AttributeNotRecognized,
187  AttributeNotSubscribed,
188  InvalidLogicalTime,
189  FederateInternalError);
190 
191  virtual
192  void
194  (ObjectInstanceHandle theObject,
195  AttributeHandleValueMap const & theAttributeValues,
196  VariableLengthData const & theUserSuppliedTag,
197  OrderType sentOrder,
198  TransportationType theType,
199  LogicalTime const & theTime,
200  OrderType receivedOrder,
201  MessageRetractionHandle theHandle,
202  RegionHandleSet const & theSentRegionHandleSet)
203  throw (ObjectInstanceNotKnown,
204  AttributeNotRecognized,
205  AttributeNotSubscribed,
206  InvalidLogicalTime,
207  FederateInternalError);
208 
209 
210  // 6.9
211  virtual
212  void
214  (InteractionClassHandle theInteraction,
215  ParameterHandleValueMap const & theParameterValues,
216  VariableLengthData const & theUserSuppliedTag,
217  OrderType sentOrder,
218  TransportationType theType)
219  throw (InteractionClassNotRecognized,
220  InteractionParameterNotRecognized,
221  InteractionClassNotSubscribed,
222  FederateInternalError);
223 
224  virtual
225  void
227  (InteractionClassHandle theInteraction,
228  ParameterHandleValueMap const & theParameterValues,
229  VariableLengthData const & theUserSuppliedTag,
230  OrderType sentOrder,
231  TransportationType theType,
232  RegionHandleSet const & theSentRegionHandleSet)
233  throw (InteractionClassNotRecognized,
234  InteractionParameterNotRecognized,
235  InteractionClassNotSubscribed,
236  FederateInternalError);
237 
238  virtual
239  void
241  (InteractionClassHandle theInteraction,
242  ParameterHandleValueMap const & theParameterValues,
243  VariableLengthData const & theUserSuppliedTag,
244  OrderType sentOrder,
245  TransportationType theType,
246  LogicalTime const & theTime,
247  OrderType receivedOrder)
248  throw (InteractionClassNotRecognized,
249  InteractionParameterNotRecognized,
250  InteractionClassNotSubscribed,
251  FederateInternalError);
252 
253  virtual
254  void
256  (InteractionClassHandle theInteraction,
257  ParameterHandleValueMap const & theParameterValues,
258  VariableLengthData const & theUserSuppliedTag,
259  OrderType sentOrder,
260  TransportationType theType,
261  LogicalTime const & theTime,
262  OrderType receivedOrder,
263  RegionHandleSet const & theSentRegionHandleSet)
264  throw (InteractionClassNotRecognized,
265  InteractionParameterNotRecognized,
266  InteractionClassNotSubscribed,
267  FederateInternalError);
268 
269  virtual
270  void
272  (InteractionClassHandle theInteraction,
273  ParameterHandleValueMap const & theParameterValues,
274  VariableLengthData const & theUserSuppliedTag,
275  OrderType sentOrder,
276  TransportationType theType,
277  LogicalTime const & theTime,
278  OrderType receivedOrder,
279  MessageRetractionHandle theHandle)
280  throw (InteractionClassNotRecognized,
281  InteractionParameterNotRecognized,
282  InteractionClassNotSubscribed,
283  InvalidLogicalTime,
284  FederateInternalError);
285 
286  virtual
287  void
289  (InteractionClassHandle theInteraction,
290  ParameterHandleValueMap const & theParameterValues,
291  VariableLengthData const & theUserSuppliedTag,
292  OrderType sentOrder,
293  TransportationType theType,
294  LogicalTime const & theTime,
295  OrderType receivedOrder,
296  MessageRetractionHandle theHandle,
297  RegionHandleSet const & theSentRegionHandleSet)
298  throw (InteractionClassNotRecognized,
299  InteractionParameterNotRecognized,
300  InteractionClassNotSubscribed,
301  InvalidLogicalTime,
302  FederateInternalError);
303 
304  virtual
305  void
306  removeObjectInstance(ObjectInstanceHandle theObject,
307  VariableLengthData const & theUserSuppliedTag,
308  OrderType sentOrder)
309  throw (ObjectInstanceNotKnown,
310  FederateInternalError);
311 
312  virtual
313  void
314  removeObjectInstance(ObjectInstanceHandle theObject,
315  VariableLengthData const & theUserSuppliedTag,
316  OrderType sentOrder,
317  LogicalTime const & theTime,
318  OrderType receivedOrder)
319  throw (ObjectInstanceNotKnown,
320  FederateInternalError);
321 
322  virtual
323  void
324  removeObjectInstance(ObjectInstanceHandle theObject,
325  VariableLengthData const & theUserSuppliedTag,
326  OrderType sentOrder,
327  LogicalTime const & theTime,
328  OrderType receivedOrder,
329  MessageRetractionHandle theHandle)
330  throw (ObjectInstanceNotKnown,
331  InvalidLogicalTime,
332  FederateInternalError);
333 
334  virtual
335  void
336  provideAttributeValueUpdate(ObjectInstanceHandle theObject,
337  AttributeHandleSet const & theAttributes,
338  VariableLengthData const & theUserSuppliedTag)
339  throw (ObjectInstanceNotKnown,
340  AttributeNotRecognized,
341  AttributeNotOwned,
342  FederateInternalError);
343 
344  virtual
345  void
346  timeRegulationEnabled(LogicalTime const & theFederateTime)
347  throw (InvalidLogicalTime,
348  NoRequestToEnableTimeRegulationWasPending,
349  FederateInternalError);
350 
351 
352  virtual
353  void
354  timeConstrainedEnabled(LogicalTime const & theFederateTime)
355  throw (InvalidLogicalTime,
356  NoRequestToEnableTimeConstrainedWasPending,
357  FederateInternalError);
358 
359  virtual
360  void
361  timeAdvanceGrant(LogicalTime const & theTime)
362  throw (InvalidLogicalTime,
363  JoinedFederateIsNotInTimeAdvancingState,
364  FederateInternalError);
365 
366  virtual
367  void
368  requestRetraction(MessageRetractionHandle theHandle)
369  throw (FederateInternalError);
370 
371 
372  virtual
373  void
374  synchronizationPointRegistrationSucceeded(std::wstring const & label )
375  throw (FederateInternalError);
376  virtual
377  void
378  synchronizationPointRegistrationFailed(std::wstring const & label,
380  throw (FederateInternalError);
381 
382  virtual
383  void
384  announceSynchronizationPoint(std::wstring const & label,
385  VariableLengthData const & theUserSuppliedTag)
386  throw (FederateInternalError);
387 
388  virtual
389  void
390  federationSynchronized(std::wstring const & label)
391  throw (FederateInternalError);
392 
393 
394 public:
395  DtTalkAmbData & myData;
396 };
397 
398 #endif

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)