MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fedAmbCallback13.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2007 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: fedAmbCallback13.h,v $ $Revision: 1.6 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef DtfedAmbCallback13_h
10 #define DtfedAmbCallback13_h
11 #ifdef DtIFSPEC13
12 
15 
16 
17 #ifdef DtIFSPEC13DLC
18 #include "RTI13.h"
19 #define RTI rti13
20 #else
21 #include "RTI.hh"
22 #endif
23 #include "aHandValSet.h"
24 #include "pHandValSet.h"
25 #include "attrHandSet.h"
26 
27 class DtCallbackMsg;
28 
30 DT_DLL_LRC enum DtFedAmbCallKind
31 {
35 
36  DtFedAmbCall_synchronizationPointRegistrationSucceeded,
37  DtFedAmbCall_synchronizationPointRegistrationFailed,
38  DtFedAmbCall_announceSynchronizationPoint,
39  DtFedAmbCall_federationSynchronized,
40  DtFedAmbCall_initiateFederateSave,
41  DtFedAmbCall_federationSaved,
42  DtFedAmbCall_federationNotSaved,
43  DtFedAmbCall_requestFederationRestoreSucceeded,
44  DtFedAmbCall_requestFederationRestoreFailed,
45  DtFedAmbCall_federationRestoreBegun,
46  DtFedAmbCall_initiateFederateRestore,
47  DtFedAmbCall_federationRestored,
48  DtFedAmbCall_federationNotRestored,
49 
53 
54  DtFedAmbCall_startRegistrationForObjectClass,
55  DtFedAmbCall_stopRegistrationForObjectClass,
56  DtFedAmbCall_turnInteractionsOn,
57  DtFedAmbCall_turnInteractionsOff,
58 
62 
63  DtFedAmbCall_discoverObjectInstance,
64  DtFedAmbCall_reflectAttributeValues,
65  DtFedAmbCall_reflectAttributeValuesT,
66  DtFedAmbCall_receiveInteraction,
67  DtFedAmbCall_receiveInteractionT,
68  DtFedAmbCall_removeObjectInstance,
69  DtFedAmbCall_removeObjectInstanceT,
70  DtFedAmbCall_attributesInScope,
71  DtFedAmbCall_attributesOutOfScope,
72  DtFedAmbCall_provideAttributeValueUpdate,
73  DtFedAmbCall_turnUpdatesOnForObjectInstance,
74  DtFedAmbCall_turnUpdatesOffForObjectInstance,
75 
79 
80  DtFedAmbCall_requestAttributeOwnershipAssumption,
81  DtFedAmbCall_attributeOwnershipDivestitureNotification,
82  DtFedAmbCall_attributeOwnershipAcquisitionNotification,
83  DtFedAmbCall_attributeOwnershipUnavailable,
84  DtFedAmbCall_requestAttributeOwnershipRelease,
85  DtFedAmbCall_confirmAttributeOwnershipAcquisitionCancellation,
86  DtFedAmbCall_informAttributeOwnership,
87  DtFedAmbCall_attributeIsNotOwned,
88  DtFedAmbCall_attributeOwnedByRTI,
89 
93 
94  DtFedAmbCall_timeRegulationEnabled,
95  DtFedAmbCall_timeConstrainedEnabled,
96  DtFedAmbCall_timeAdvanceGrant,
97  DtFedAmbCall_requestRetraction,
98 
100  DtFedAmbCall_invalid
101 };
102 
106 class DtFedAmbCallback
107 {
108 public:
110  DtFedAmbCallback(DtFedAmbCallKind kind);
112  virtual ~DtFedAmbCallback();
113 private:
115  DtFedAmbCallback(DtFedAmbCallback const& orig);
116  DtFedAmbCallback& operator = (DtFedAmbCallback const& orig);
117 public:
119  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const = 0;
120 
122  virtual DtFedAmbCallKind callbackKind() const;
123 
124 protected:
125  DtFedAmbCallKind myCallbackKind;
126 };
127 
128 template<DtFedAmbCallKind callbackKindValue>
129 class DtFedAmbCallbackVoid : public DtFedAmbCallback
130 {
131 public:
133  DtFedAmbCallbackVoid();
135  virtual ~DtFedAmbCallbackVoid();
136 private:
138  DtFedAmbCallbackVoid(DtFedAmbCallbackVoid const& orig);
139  DtFedAmbCallbackVoid& operator = (DtFedAmbCallbackVoid const& orig);
140 
141 public:
143  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
144 };
145 
146 template<DtFedAmbCallKind callbackKindValue>
147 class DtCallbackWithTime : public DtFedAmbCallback
148 {
149 public:
151  DtCallbackWithTime(
152  std::auto_ptr<RTI::FedTime> time);
154  virtual ~DtCallbackWithTime();
155 private:
157  DtCallbackWithTime(DtCallbackWithTime const& orig);
158  DtCallbackWithTime& operator = (DtCallbackWithTime const& orig);
159 public:
161  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
162 protected:
163  std::auto_ptr<RTI::FedTime> myTime;
164 };
165 
166 template<DtFedAmbCallKind callbackKindValue>
167 class DtCallbackWithString : public DtFedAmbCallback
168 {
169 public:
171  DtCallbackWithString(const char * value);
172 
174  virtual ~DtCallbackWithString();
175 private:
177  DtCallbackWithString(DtCallbackWithString const& orig);
178  DtCallbackWithString& operator = (DtCallbackWithString const& orig);
179 public:
181  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
182 protected:
183  MAKRti::DtString myString;
184 };
185 
186 template<DtFedAmbCallKind callbackKindValue>
187 class DtCallbackWithTwoStrings : public DtFedAmbCallback
188 {
189 public:
191  DtCallbackWithTwoStrings(const char * str1, const char * str2);
192 
194  virtual ~DtCallbackWithTwoStrings();
195 private:
197  DtCallbackWithTwoStrings(DtCallbackWithTwoStrings const& orig);
198  DtCallbackWithTwoStrings& operator = (DtCallbackWithTwoStrings const& orig);
199 public:
201  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
202 protected:
203  MAKRti::DtString myString1;
204  MAKRti::DtString myString2;
205 };
206 
207 template<DtFedAmbCallKind callbackKindValue>
208 class DtCallbackWithObjectClass : public DtFedAmbCallback
209 {
210 public:
212  DtCallbackWithObjectClass(RTI::ObjectClassHandle theClass);
214  virtual ~DtCallbackWithObjectClass();
215 private:
217  DtCallbackWithObjectClass(DtCallbackWithObjectClass const& orig);
218  DtCallbackWithObjectClass& operator = (DtCallbackWithObjectClass const& orig);
219 public:
221  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
222 protected:
223  RTI::ObjectClassHandle myObjectClass;
224 };
225 
226 template<DtFedAmbCallKind callbackKindValue>
227 class DtCallbackWithInteractionClass : public DtFedAmbCallback
228 {
229 public:
231  DtCallbackWithInteractionClass(RTI::InteractionClassHandle theClass);
233  virtual ~DtCallbackWithInteractionClass();
234 private:
236  DtCallbackWithInteractionClass(DtCallbackWithInteractionClass const& orig);
237  DtCallbackWithInteractionClass& operator = (DtCallbackWithInteractionClass const& orig);
238 public:
240  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
241 protected:
242  RTI::InteractionClassHandle myInteractionClass;
243 };
244 
245 template<DtFedAmbCallKind callbackKindValue>
246 class DtCallbackWithObjectAttributesOptTag : public DtFedAmbCallback
247 {
248 public:
250  DtCallbackWithObjectAttributesOptTag(
251  RTI::ObjectHandle theObject,
252  DtAttributeHandleSet const & theAttributes);
253  DtCallbackWithObjectAttributesOptTag(
254  RTI::ObjectHandle theObject,
255  DtAttributeHandleSet const & theAttributes,
256  const char * theUserTag);
257 
259  virtual ~DtCallbackWithObjectAttributesOptTag();
260 private:
262  DtCallbackWithObjectAttributesOptTag(DtCallbackWithObjectAttributesOptTag const& orig);
263  DtCallbackWithObjectAttributesOptTag& operator = (DtCallbackWithObjectAttributesOptTag const& orig);
264 public:
266  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
267 protected:
268  RTI::ObjectHandle myObject;
269  DtAttributeHandleSet myAttributes;
270  MAKRti::DtString myTag;
271 };
272 
273 template<DtFedAmbCallKind callbackKindValue>
274 class DtCallbackWithObjectAttributeOptFederate : public DtFedAmbCallback
275 {
276 public:
278  DtCallbackWithObjectAttributeOptFederate(
279  RTI::ObjectHandle theObject,
280  RTI::AttributeHandle theAttribute);
281  DtCallbackWithObjectAttributeOptFederate(
282  RTI::ObjectHandle theObject,
283  RTI::AttributeHandle theAttribute,
284  RTI::FederateHandle theFederate);
286  virtual ~DtCallbackWithObjectAttributeOptFederate();
287 private:
289  DtCallbackWithObjectAttributeOptFederate(DtCallbackWithObjectAttributeOptFederate const& orig);
290  DtCallbackWithObjectAttributeOptFederate& operator = (DtCallbackWithObjectAttributeOptFederate const& orig);
291 public:
293  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
294 protected:
295  RTI::ObjectHandle myObject;
296  RTI::AttributeHandle myAttribute;
297  RTI::FederateHandle myFederate;
298 };
299 
300 
301 typedef DtCallbackWithString<DtFedAmbCall_synchronizationPointRegistrationSucceeded> DtCbSynchronizationPointRegistrationSucceeded;
302 
303 typedef DtCallbackWithString<DtFedAmbCall_synchronizationPointRegistrationFailed> DtCbSynchronizationPointRegistrationFailed;
304 
305 typedef DtCallbackWithTwoStrings<DtFedAmbCall_announceSynchronizationPoint> DtCbAnnounceSynchronizationPoint;
306 
307 typedef DtCallbackWithString<DtFedAmbCall_federationSynchronized> DtCbFederationSynchronized;
308 
309 typedef DtCallbackWithString<DtFedAmbCall_initiateFederateSave> DtCbInitiateFederateSave;
310 
311 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationSaved> DtCbFederationSaved;
312 
313 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationNotSaved> DtCbFederationNotSaved;
314 
315 typedef DtCallbackWithString<DtFedAmbCall_requestFederationRestoreSucceeded> DtCbRequestFederationRestoreSucceeded;
316 
317 typedef DtCallbackWithTwoStrings<DtFedAmbCall_requestFederationRestoreFailed> DtCbRequestFederationRestoreFailed;
318 
319 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationRestoreBegun> DtCbFederationRestoreBegun;
320 
321 class DtCbInitiateFederateRestore : public DtFedAmbCallback
322 {
323 public:
325  DtCbInitiateFederateRestore(const char * label, RTI::FederateHandle handle);
326 
328  virtual ~DtCbInitiateFederateRestore();
329 private:
331  DtCbInitiateFederateRestore(DtCbInitiateFederateRestore const& orig);
332  DtCbInitiateFederateRestore& operator = (DtCbInitiateFederateRestore const& orig);
333 public:
335  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
336 protected:
337  MAKRti::DtString myLabel;
338  RTI::FederateHandle myFederateHandle;
339 };
340 
341 
342 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationRestored> DtCbFederationRestored;
343 
344 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationNotRestored> DtCbFederationNotRestored;
345 
346 typedef DtCallbackWithObjectClass<DtFedAmbCall_startRegistrationForObjectClass> DtCbStartRegistrationForObjectClass;
347 
348 typedef DtCallbackWithObjectClass<DtFedAmbCall_stopRegistrationForObjectClass> DtCbStopRegistrationForObjectClass;
349 
350 typedef DtCallbackWithInteractionClass<DtFedAmbCall_turnInteractionsOn> DtCbTurnInteractionsOn;
351 
352 typedef DtCallbackWithInteractionClass<DtFedAmbCall_turnInteractionsOff> DtCbTurnInteractionsOff;
353 
354 class DtCbDiscoverObjectInstance: public DtFedAmbCallback
355 {
356 public:
358  DtCbDiscoverObjectInstance(RTI::ObjectHandle theObject,
359  RTI::ObjectClassHandle theObjectClass,
360  const char * theObjectInstanceName);
362  virtual ~DtCbDiscoverObjectInstance();
363 private:
365  DtCbDiscoverObjectInstance(DtCbDiscoverObjectInstance const& orig);
366  DtCbDiscoverObjectInstance& operator = (DtCbDiscoverObjectInstance const& orig);
367 public:
369  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
370 protected:
371  RTI::ObjectHandle myObjectHandle;
372  RTI::ObjectClassHandle myObjectClassHandle;
373  MAKRti::DtString myString;
374 };
375 
376 
377 class DtCbReflectAttributeValues: public DtFedAmbCallback
378 {
379 public:
381  DtCbReflectAttributeValues(
382  RTI::ObjectHandle theObject,
383  const DtAhvps& theAttributes,
384  const char * theTag);
385 
386  DtCbReflectAttributeValues (
387  RTI::ObjectHandle theObject,
388  const DtAhvps& theAttributes,
389  std::auto_ptr<RTI::FedTime> theTime,
390  const char * theTag,
391  RTI::EventRetractionHandle theHandle);
392 
394  virtual ~DtCbReflectAttributeValues();
395 private:
397  DtCbReflectAttributeValues(DtCbReflectAttributeValues const& orig);
398  DtCbReflectAttributeValues& operator = (DtCbReflectAttributeValues const& orig);
399 public:
401  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
402 
403 protected:
404  RTI::ObjectHandle myObject;
405  DtAhvps myAttributeValues;
406  MAKRti::DtString myTag;
407  std::auto_ptr<RTI::FedTime> myTime;
408  RTI::EventRetractionHandle myRetractHandle;
409 };
410 
411 class DtCbReceiveInteraction: public DtFedAmbCallback
412 {
413 public:
415  DtCbReceiveInteraction(
416  RTI::InteractionClassHandle theInteraction,
417  const DtPhvps& theParameters,
418  const char * theTag);
419 
420  DtCbReceiveInteraction(
421  RTI::InteractionClassHandle theInteraction,
422  const DtPhvps& theParameters,
423  std::auto_ptr<RTI::FedTime> theTime,
424  const char * theTag,
425  RTI::EventRetractionHandle theHandle);
426 
428  virtual ~DtCbReceiveInteraction();
429 private:
431  DtCbReceiveInteraction(DtCbReceiveInteraction const& orig);
432  DtCbReceiveInteraction& operator = (DtCbReceiveInteraction const& orig);
433 public:
435  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
436 
437 protected:
438  RTI::InteractionClassHandle myInteractionClass;
439  DtPhvps myParameterValues;
440  MAKRti::DtString myTag;
441  std::auto_ptr<RTI::FedTime> myTime;
442  RTI::EventRetractionHandle myRetractHandle;
443 };
444 
445 class DtCbRemoveObjectInstance: public DtFedAmbCallback
446 {
447 public:
449  DtCbRemoveObjectInstance(
450  RTI::ObjectHandle theObject,
451  const char * theTag);
452  DtCbRemoveObjectInstance(
453  RTI::ObjectHandle theObject,
454  std::auto_ptr<RTI::FedTime> theTime,
455  const char * theTag,
456  RTI::EventRetractionHandle theHandle);
457 
459  virtual ~DtCbRemoveObjectInstance();
460 private:
462  DtCbRemoveObjectInstance(DtCbRemoveObjectInstance const& orig);
463  DtCbRemoveObjectInstance& operator = (DtCbRemoveObjectInstance const& orig);
464 public:
466  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
467 protected:
468  RTI::ObjectHandle myObjectHandle;
469  MAKRti::DtString myTag;
470  std::auto_ptr<RTI::FedTime> myTime;
471  RTI::EventRetractionHandle myRetractHandle;
472 };
473 
474 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributesInScope> DtCbAttributesInScope;
475 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributesOutOfScope> DtCbAttributesOutOfScope;
476 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_provideAttributeValueUpdate> DtCbProvideAttributeValueUpdate;
477 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_turnUpdatesOnForObjectInstance> DtCbTurnUpdatesOnForObjectInstance;
478 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_turnUpdatesOffForObjectInstance> DtCbTurnUpdatesOffForObjectInstance;
479 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_requestAttributeOwnershipAssumption> DtCbRequestAttributeOwnershipAssumption;
480 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipDivestitureNotification> DtCbAttributeOwnershipDivestitureNotification;
481 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipAcquisitionNotification> DtCbAttributeOwnershipAcquisitionNotification;
482 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipUnavailable> DtCbAttributeOwnershipUnavailable;
483 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_requestAttributeOwnershipRelease> DtCbRequestAttributeOwnershipRelease;
484 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_confirmAttributeOwnershipAcquisitionCancellation> DtCbConfirmAttributeOwnershipAcquisitionCancellation;
485 
486 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_informAttributeOwnership> DtCbInformAttributeOwnership;
487 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_attributeIsNotOwned> DtCbAttributeIsNotOwned;
488 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_attributeOwnedByRTI> DtCbAttributeOwnedByRTI;
489 
490 typedef DtCallbackWithTime<DtFedAmbCall_timeRegulationEnabled> DtCbTimeRegulationEnabled;
491 typedef DtCallbackWithTime<DtFedAmbCall_timeConstrainedEnabled> DtCbTimeConstrainedEnabled;
492 typedef DtCallbackWithTime<DtFedAmbCall_timeAdvanceGrant> DtCbTimeAdvanceGrant;
493 
494 class DtCbRequestRetraction: public DtFedAmbCallback
495 {
496 public:
498  DtCbRequestRetraction(RTI::EventRetractionHandle handle);
500  virtual ~DtCbRequestRetraction();
501 private:
503  DtCbRequestRetraction(DtCbRequestRetraction const& orig);
504  DtCbRequestRetraction& operator = (DtCbRequestRetraction const& orig);
505 public:
507  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
508 protected:
509  RTI::EventRetractionHandle myRetractHandle;
510 };
511 
513 DT_DLL_LRC const char * callbackKindToString(DtFedAmbCallKind kind);
514 
515 #define fedAmbCallback13_inl_
516 #include "fedAmbCallback13.inl"
517 #undef fedAmbCallback13_inl_
518 
519 #endif //DtIFSPEC1516
520 #endif //DtfedAmbCallback13_h

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)