MAK RTIspy API Documentation for HLA Evolved
 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 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(DtRtiApiUniquePtrTime time);
153  virtual ~DtCallbackWithTime();
154 private:
156  DtCallbackWithTime(DtCallbackWithTime const& orig);
157  DtCallbackWithTime& operator = (DtCallbackWithTime const& orig);
158 public:
160  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
161 protected:
162  DtRtiApiUniquePtrTime myTime;
163 };
164 
165 template<DtFedAmbCallKind callbackKindValue>
166 class DtCallbackWithString : public DtFedAmbCallback
167 {
168 public:
170  DtCallbackWithString(const char * value);
171 
173  virtual ~DtCallbackWithString();
174 private:
176  DtCallbackWithString(DtCallbackWithString const& orig);
177  DtCallbackWithString& operator = (DtCallbackWithString const& orig);
178 public:
180  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
181 protected:
182  MAKRti::DtString myString;
183 };
184 
185 template<DtFedAmbCallKind callbackKindValue>
186 class DtCallbackWithTwoStrings : public DtFedAmbCallback
187 {
188 public:
190  DtCallbackWithTwoStrings(const char * str1, const char * str2);
191 
193  virtual ~DtCallbackWithTwoStrings();
194 private:
196  DtCallbackWithTwoStrings(DtCallbackWithTwoStrings const& orig);
197  DtCallbackWithTwoStrings& operator = (DtCallbackWithTwoStrings const& orig);
198 public:
200  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
201 protected:
202  MAKRti::DtString myString1;
203  MAKRti::DtString myString2;
204 };
205 
206 template<DtFedAmbCallKind callbackKindValue>
207 class DtCallbackWithObjectClass : public DtFedAmbCallback
208 {
209 public:
211  DtCallbackWithObjectClass(RTI::ObjectClassHandle theClass);
213  virtual ~DtCallbackWithObjectClass();
214 private:
216  DtCallbackWithObjectClass(DtCallbackWithObjectClass const& orig);
217  DtCallbackWithObjectClass& operator = (DtCallbackWithObjectClass const& orig);
218 public:
220  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
221 protected:
222  RTI::ObjectClassHandle myObjectClass;
223 };
224 
225 template<DtFedAmbCallKind callbackKindValue>
226 class DtCallbackWithInteractionClass : public DtFedAmbCallback
227 {
228 public:
230  DtCallbackWithInteractionClass(RTI::InteractionClassHandle theClass);
232  virtual ~DtCallbackWithInteractionClass();
233 private:
235  DtCallbackWithInteractionClass(DtCallbackWithInteractionClass const& orig);
236  DtCallbackWithInteractionClass& operator = (DtCallbackWithInteractionClass const& orig);
237 public:
239  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
240 protected:
241  RTI::InteractionClassHandle myInteractionClass;
242 };
243 
244 template<DtFedAmbCallKind callbackKindValue>
245 class DtCallbackWithObjectAttributesOptTag : public DtFedAmbCallback
246 {
247 public:
249  DtCallbackWithObjectAttributesOptTag(
250  RTI::ObjectHandle theObject,
251  DtAttributeHandleSet const & theAttributes);
252  DtCallbackWithObjectAttributesOptTag(
253  RTI::ObjectHandle theObject,
254  DtAttributeHandleSet const & theAttributes,
255  const char * theUserTag);
256 
258  virtual ~DtCallbackWithObjectAttributesOptTag();
259 private:
261  DtCallbackWithObjectAttributesOptTag(DtCallbackWithObjectAttributesOptTag const& orig);
262  DtCallbackWithObjectAttributesOptTag& operator = (DtCallbackWithObjectAttributesOptTag const& orig);
263 public:
265  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
266 protected:
267  RTI::ObjectHandle myObject;
268  DtAttributeHandleSet myAttributes;
269  MAKRti::DtString myTag;
270 };
271 
272 template<DtFedAmbCallKind callbackKindValue>
273 class DtCallbackWithObjectAttributeOptFederate : public DtFedAmbCallback
274 {
275 public:
277  DtCallbackWithObjectAttributeOptFederate(
278  RTI::ObjectHandle theObject,
279  RTI::AttributeHandle theAttribute);
280  DtCallbackWithObjectAttributeOptFederate(
281  RTI::ObjectHandle theObject,
282  RTI::AttributeHandle theAttribute,
283  RTI::FederateHandle theFederate);
285  virtual ~DtCallbackWithObjectAttributeOptFederate();
286 private:
288  DtCallbackWithObjectAttributeOptFederate(DtCallbackWithObjectAttributeOptFederate const& orig);
289  DtCallbackWithObjectAttributeOptFederate& operator = (DtCallbackWithObjectAttributeOptFederate const& orig);
290 public:
292  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
293 protected:
294  RTI::ObjectHandle myObject;
295  RTI::AttributeHandle myAttribute;
296  RTI::FederateHandle myFederate;
297 };
298 
299 
300 typedef DtCallbackWithString<DtFedAmbCall_synchronizationPointRegistrationSucceeded> DtCbSynchronizationPointRegistrationSucceeded;
301 
302 typedef DtCallbackWithString<DtFedAmbCall_synchronizationPointRegistrationFailed> DtCbSynchronizationPointRegistrationFailed;
303 
304 typedef DtCallbackWithTwoStrings<DtFedAmbCall_announceSynchronizationPoint> DtCbAnnounceSynchronizationPoint;
305 
306 typedef DtCallbackWithString<DtFedAmbCall_federationSynchronized> DtCbFederationSynchronized;
307 
308 typedef DtCallbackWithString<DtFedAmbCall_initiateFederateSave> DtCbInitiateFederateSave;
309 
310 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationSaved> DtCbFederationSaved;
311 
312 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationNotSaved> DtCbFederationNotSaved;
313 
314 typedef DtCallbackWithString<DtFedAmbCall_requestFederationRestoreSucceeded> DtCbRequestFederationRestoreSucceeded;
315 
316 typedef DtCallbackWithTwoStrings<DtFedAmbCall_requestFederationRestoreFailed> DtCbRequestFederationRestoreFailed;
317 
318 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationRestoreBegun> DtCbFederationRestoreBegun;
319 
320 class DtCbInitiateFederateRestore : public DtFedAmbCallback
321 {
322 public:
324  DtCbInitiateFederateRestore(const char * label, RTI::FederateHandle handle);
325 
327  virtual ~DtCbInitiateFederateRestore();
328 private:
330  DtCbInitiateFederateRestore(DtCbInitiateFederateRestore const& orig);
331  DtCbInitiateFederateRestore& operator = (DtCbInitiateFederateRestore const& orig);
332 public:
334  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
335 protected:
336  MAKRti::DtString myLabel;
337  RTI::FederateHandle myFederateHandle;
338 };
339 
340 
341 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationRestored> DtCbFederationRestored;
342 
343 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationNotRestored> DtCbFederationNotRestored;
344 
345 typedef DtCallbackWithObjectClass<DtFedAmbCall_startRegistrationForObjectClass> DtCbStartRegistrationForObjectClass;
346 
347 typedef DtCallbackWithObjectClass<DtFedAmbCall_stopRegistrationForObjectClass> DtCbStopRegistrationForObjectClass;
348 
349 typedef DtCallbackWithInteractionClass<DtFedAmbCall_turnInteractionsOn> DtCbTurnInteractionsOn;
350 
351 typedef DtCallbackWithInteractionClass<DtFedAmbCall_turnInteractionsOff> DtCbTurnInteractionsOff;
352 
353 class DtCbDiscoverObjectInstance: public DtFedAmbCallback
354 {
355 public:
357  DtCbDiscoverObjectInstance(RTI::ObjectHandle theObject,
358  RTI::ObjectClassHandle theObjectClass,
359  const char * theObjectInstanceName);
361  virtual ~DtCbDiscoverObjectInstance();
362 private:
364  DtCbDiscoverObjectInstance(DtCbDiscoverObjectInstance const& orig);
365  DtCbDiscoverObjectInstance& operator = (DtCbDiscoverObjectInstance const& orig);
366 public:
368  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
369 protected:
370  RTI::ObjectHandle myObjectHandle;
371  RTI::ObjectClassHandle myObjectClassHandle;
372  MAKRti::DtString myString;
373 };
374 
375 
376 class DtCbReflectAttributeValues: public DtFedAmbCallback
377 {
378 public:
380  DtCbReflectAttributeValues(
381  RTI::ObjectHandle theObject,
382  const DtAhvps& theAttributes,
383  const char * theTag);
384 
385  DtCbReflectAttributeValues (
386  RTI::ObjectHandle theObject,
387  const DtAhvps& theAttributes,
388  DtRtiApiUniquePtrTime theTime,
389  const char * theTag,
390  RTI::EventRetractionHandle theHandle);
391 
393  virtual ~DtCbReflectAttributeValues();
394 private:
396  DtCbReflectAttributeValues(DtCbReflectAttributeValues const& orig);
397  DtCbReflectAttributeValues& operator = (DtCbReflectAttributeValues const& orig);
398 public:
400  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
401 
402 protected:
403  RTI::ObjectHandle myObject;
404  DtAhvps myAttributeValues;
405  MAKRti::DtString myTag;
406  DtRtiApiUniquePtrTime myTime;
407  RTI::EventRetractionHandle myRetractHandle;
408 };
409 
410 class DtCbReceiveInteraction: public DtFedAmbCallback
411 {
412 public:
414  DtCbReceiveInteraction(
415  RTI::InteractionClassHandle theInteraction,
416  const DtPhvps& theParameters,
417  const char * theTag);
418 
419  DtCbReceiveInteraction(
420  RTI::InteractionClassHandle theInteraction,
421  const DtPhvps& theParameters,
422  DtRtiApiUniquePtrTime theTime,
423  const char * theTag,
424  RTI::EventRetractionHandle theHandle);
425 
427  virtual ~DtCbReceiveInteraction();
428 private:
430  DtCbReceiveInteraction(DtCbReceiveInteraction const& orig);
431  DtCbReceiveInteraction& operator = (DtCbReceiveInteraction const& orig);
432 public:
434  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
435 
436 protected:
437  RTI::InteractionClassHandle myInteractionClass;
438  DtPhvps myParameterValues;
439  MAKRti::DtString myTag;
440  DtRtiApiUniquePtrTime myTime;
441  RTI::EventRetractionHandle myRetractHandle;
442 };
443 
444 class DtCbRemoveObjectInstance: public DtFedAmbCallback
445 {
446 public:
448  DtCbRemoveObjectInstance(
449  RTI::ObjectHandle theObject,
450  const char * theTag);
451  DtCbRemoveObjectInstance(
452  RTI::ObjectHandle theObject,
453  DtRtiApiUniquePtrTime theTime,
454  const char * theTag,
455  RTI::EventRetractionHandle theHandle);
456 
458  virtual ~DtCbRemoveObjectInstance();
459 private:
461  DtCbRemoveObjectInstance(DtCbRemoveObjectInstance const& orig);
462  DtCbRemoveObjectInstance& operator = (DtCbRemoveObjectInstance const& orig);
463 public:
465  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
466 protected:
467  RTI::ObjectHandle myObjectHandle;
468  MAKRti::DtString myTag;
469  DtRtiApiUniquePtrTime myTime;
470  RTI::EventRetractionHandle myRetractHandle;
471 };
472 
473 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributesInScope> DtCbAttributesInScope;
474 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributesOutOfScope> DtCbAttributesOutOfScope;
475 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_provideAttributeValueUpdate> DtCbProvideAttributeValueUpdate;
476 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_turnUpdatesOnForObjectInstance> DtCbTurnUpdatesOnForObjectInstance;
477 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_turnUpdatesOffForObjectInstance> DtCbTurnUpdatesOffForObjectInstance;
478 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_requestAttributeOwnershipAssumption> DtCbRequestAttributeOwnershipAssumption;
479 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipDivestitureNotification> DtCbAttributeOwnershipDivestitureNotification;
480 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipAcquisitionNotification> DtCbAttributeOwnershipAcquisitionNotification;
481 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipUnavailable> DtCbAttributeOwnershipUnavailable;
482 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_requestAttributeOwnershipRelease> DtCbRequestAttributeOwnershipRelease;
483 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_confirmAttributeOwnershipAcquisitionCancellation> DtCbConfirmAttributeOwnershipAcquisitionCancellation;
484 
485 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_informAttributeOwnership> DtCbInformAttributeOwnership;
486 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_attributeIsNotOwned> DtCbAttributeIsNotOwned;
487 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_attributeOwnedByRTI> DtCbAttributeOwnedByRTI;
488 
489 typedef DtCallbackWithTime<DtFedAmbCall_timeRegulationEnabled> DtCbTimeRegulationEnabled;
490 typedef DtCallbackWithTime<DtFedAmbCall_timeConstrainedEnabled> DtCbTimeConstrainedEnabled;
491 typedef DtCallbackWithTime<DtFedAmbCall_timeAdvanceGrant> DtCbTimeAdvanceGrant;
492 
493 class DtCbRequestRetraction: public DtFedAmbCallback
494 {
495 public:
497  DtCbRequestRetraction(RTI::EventRetractionHandle handle);
499  virtual ~DtCbRequestRetraction();
500 private:
502  DtCbRequestRetraction(DtCbRequestRetraction const& orig);
503  DtCbRequestRetraction& operator = (DtCbRequestRetraction const& orig);
504 public:
506  virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const;
507 protected:
508  RTI::EventRetractionHandle myRetractHandle;
509 };
510 
512 DT_DLL_LRC const char * callbackKindToString(DtFedAmbCallKind kind);
513 
514 #define fedAmbCallback13_inl_
515 #include "fedAmbCallback13.inl"
516 #undef fedAmbCallback13_inl_
517 
518 #endif //DtIFSPEC1516
519 #endif //DtfedAmbCallback13_h
Defines the internal representation of attribute/parameter handle sets.
Definition: attrHandSet.h:30
DtRtiApiUniquePtr< DtRtiApiTime > DtRtiApiUniquePtrTime
Definition: rtiApiTypes.h:96
Definition: aHandValSet.h:33
#define DT_DLL_LRC
Definition: rtiMsConfig.h:155
Definition: pHandValSet.h:38

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)