![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 2007 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: fedAmbCallback13.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef DtfedAmbCallback13_h 00010 #define DtfedAmbCallback13_h 00011 #ifdef DtIFSPEC13 00012 00015 00016 00017 #ifdef DtIFSPEC13DLC 00018 #include "RTI13.h" 00019 #define RTI rti13 00020 #else 00021 #include "RTI.hh" 00022 #endif 00023 #include "aHandValSet.h" 00024 #include "pHandValSet.h" 00025 #include "attrHandSet.h" 00026 00027 class DtCallbackMsg; 00028 00030 DT_DLL_LRC enum DtFedAmbCallKind 00031 { 00035 00036 DtFedAmbCall_synchronizationPointRegistrationSucceeded, 00037 DtFedAmbCall_synchronizationPointRegistrationFailed, 00038 DtFedAmbCall_announceSynchronizationPoint, 00039 DtFedAmbCall_federationSynchronized, 00040 DtFedAmbCall_initiateFederateSave, 00041 DtFedAmbCall_federationSaved, 00042 DtFedAmbCall_federationNotSaved, 00043 DtFedAmbCall_requestFederationRestoreSucceeded, 00044 DtFedAmbCall_requestFederationRestoreFailed, 00045 DtFedAmbCall_federationRestoreBegun, 00046 DtFedAmbCall_initiateFederateRestore, 00047 DtFedAmbCall_federationRestored, 00048 DtFedAmbCall_federationNotRestored, 00049 00053 00054 DtFedAmbCall_startRegistrationForObjectClass, 00055 DtFedAmbCall_stopRegistrationForObjectClass, 00056 DtFedAmbCall_turnInteractionsOn, 00057 DtFedAmbCall_turnInteractionsOff, 00058 00062 00063 DtFedAmbCall_discoverObjectInstance, 00064 DtFedAmbCall_reflectAttributeValues, 00065 DtFedAmbCall_reflectAttributeValuesT, 00066 DtFedAmbCall_receiveInteraction, 00067 DtFedAmbCall_receiveInteractionT, 00068 DtFedAmbCall_removeObjectInstance, 00069 DtFedAmbCall_removeObjectInstanceT, 00070 DtFedAmbCall_attributesInScope, 00071 DtFedAmbCall_attributesOutOfScope, 00072 DtFedAmbCall_provideAttributeValueUpdate, 00073 DtFedAmbCall_turnUpdatesOnForObjectInstance, 00074 DtFedAmbCall_turnUpdatesOffForObjectInstance, 00075 00079 00080 DtFedAmbCall_requestAttributeOwnershipAssumption, 00081 DtFedAmbCall_attributeOwnershipDivestitureNotification, 00082 DtFedAmbCall_attributeOwnershipAcquisitionNotification, 00083 DtFedAmbCall_attributeOwnershipUnavailable, 00084 DtFedAmbCall_requestAttributeOwnershipRelease, 00085 DtFedAmbCall_confirmAttributeOwnershipAcquisitionCancellation, 00086 DtFedAmbCall_informAttributeOwnership, 00087 DtFedAmbCall_attributeIsNotOwned, 00088 DtFedAmbCall_attributeOwnedByRTI, 00089 00093 00094 DtFedAmbCall_timeRegulationEnabled, 00095 DtFedAmbCall_timeConstrainedEnabled, 00096 DtFedAmbCall_timeAdvanceGrant, 00097 DtFedAmbCall_requestRetraction, 00098 00100 DtFedAmbCall_invalid 00101 }; 00102 00106 class DtFedAmbCallback 00107 { 00108 public: 00110 DtFedAmbCallback(DtFedAmbCallKind kind); 00112 virtual ~DtFedAmbCallback(); 00113 private: 00115 DtFedAmbCallback(DtFedAmbCallback const& orig); 00116 DtFedAmbCallback& operator = (DtFedAmbCallback const& orig); 00117 public: 00119 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const = 0; 00120 00122 virtual DtFedAmbCallKind callbackKind() const; 00123 00124 protected: 00125 DtFedAmbCallKind myCallbackKind; 00126 }; 00127 00128 template<DtFedAmbCallKind callbackKindValue> 00129 class DtFedAmbCallbackVoid : public DtFedAmbCallback 00130 { 00131 public: 00133 DtFedAmbCallbackVoid(); 00135 virtual ~DtFedAmbCallbackVoid(); 00136 private: 00138 DtFedAmbCallbackVoid(DtFedAmbCallbackVoid const& orig); 00139 DtFedAmbCallbackVoid& operator = (DtFedAmbCallbackVoid const& orig); 00140 00141 public: 00143 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00144 }; 00145 00146 template<DtFedAmbCallKind callbackKindValue> 00147 class DtCallbackWithTime : public DtFedAmbCallback 00148 { 00149 public: 00151 DtCallbackWithTime( 00152 std::auto_ptr<RTI::FedTime> time); 00154 virtual ~DtCallbackWithTime(); 00155 private: 00157 DtCallbackWithTime(DtCallbackWithTime const& orig); 00158 DtCallbackWithTime& operator = (DtCallbackWithTime const& orig); 00159 public: 00161 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00162 protected: 00163 std::auto_ptr<RTI::FedTime> myTime; 00164 }; 00165 00166 template<DtFedAmbCallKind callbackKindValue> 00167 class DtCallbackWithString : public DtFedAmbCallback 00168 { 00169 public: 00171 DtCallbackWithString(const char * value); 00172 00174 virtual ~DtCallbackWithString(); 00175 private: 00177 DtCallbackWithString(DtCallbackWithString const& orig); 00178 DtCallbackWithString& operator = (DtCallbackWithString const& orig); 00179 public: 00181 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00182 protected: 00183 MAKRti::DtString myString; 00184 }; 00185 00186 template<DtFedAmbCallKind callbackKindValue> 00187 class DtCallbackWithTwoStrings : public DtFedAmbCallback 00188 { 00189 public: 00191 DtCallbackWithTwoStrings(const char * str1, const char * str2); 00192 00194 virtual ~DtCallbackWithTwoStrings(); 00195 private: 00197 DtCallbackWithTwoStrings(DtCallbackWithTwoStrings const& orig); 00198 DtCallbackWithTwoStrings& operator = (DtCallbackWithTwoStrings const& orig); 00199 public: 00201 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00202 protected: 00203 MAKRti::DtString myString1; 00204 MAKRti::DtString myString2; 00205 }; 00206 00207 template<DtFedAmbCallKind callbackKindValue> 00208 class DtCallbackWithObjectClass : public DtFedAmbCallback 00209 { 00210 public: 00212 DtCallbackWithObjectClass(RTI::ObjectClassHandle theClass); 00214 virtual ~DtCallbackWithObjectClass(); 00215 private: 00217 DtCallbackWithObjectClass(DtCallbackWithObjectClass const& orig); 00218 DtCallbackWithObjectClass& operator = (DtCallbackWithObjectClass const& orig); 00219 public: 00221 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00222 protected: 00223 RTI::ObjectClassHandle myObjectClass; 00224 }; 00225 00226 template<DtFedAmbCallKind callbackKindValue> 00227 class DtCallbackWithInteractionClass : public DtFedAmbCallback 00228 { 00229 public: 00231 DtCallbackWithInteractionClass(RTI::InteractionClassHandle theClass); 00233 virtual ~DtCallbackWithInteractionClass(); 00234 private: 00236 DtCallbackWithInteractionClass(DtCallbackWithInteractionClass const& orig); 00237 DtCallbackWithInteractionClass& operator = (DtCallbackWithInteractionClass const& orig); 00238 public: 00240 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00241 protected: 00242 RTI::InteractionClassHandle myInteractionClass; 00243 }; 00244 00245 template<DtFedAmbCallKind callbackKindValue> 00246 class DtCallbackWithObjectAttributesOptTag : public DtFedAmbCallback 00247 { 00248 public: 00250 DtCallbackWithObjectAttributesOptTag( 00251 RTI::ObjectHandle theObject, 00252 DtAttributeHandleSet const & theAttributes); 00253 DtCallbackWithObjectAttributesOptTag( 00254 RTI::ObjectHandle theObject, 00255 DtAttributeHandleSet const & theAttributes, 00256 const char * theUserTag); 00257 00259 virtual ~DtCallbackWithObjectAttributesOptTag(); 00260 private: 00262 DtCallbackWithObjectAttributesOptTag(DtCallbackWithObjectAttributesOptTag const& orig); 00263 DtCallbackWithObjectAttributesOptTag& operator = (DtCallbackWithObjectAttributesOptTag const& orig); 00264 public: 00266 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00267 protected: 00268 RTI::ObjectHandle myObject; 00269 DtAttributeHandleSet myAttributes; 00270 MAKRti::DtString myTag; 00271 }; 00272 00273 template<DtFedAmbCallKind callbackKindValue> 00274 class DtCallbackWithObjectAttributeOptFederate : public DtFedAmbCallback 00275 { 00276 public: 00278 DtCallbackWithObjectAttributeOptFederate( 00279 RTI::ObjectHandle theObject, 00280 RTI::AttributeHandle theAttribute); 00281 DtCallbackWithObjectAttributeOptFederate( 00282 RTI::ObjectHandle theObject, 00283 RTI::AttributeHandle theAttribute, 00284 RTI::FederateHandle theFederate); 00286 virtual ~DtCallbackWithObjectAttributeOptFederate(); 00287 private: 00289 DtCallbackWithObjectAttributeOptFederate(DtCallbackWithObjectAttributeOptFederate const& orig); 00290 DtCallbackWithObjectAttributeOptFederate& operator = (DtCallbackWithObjectAttributeOptFederate const& orig); 00291 public: 00293 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00294 protected: 00295 RTI::ObjectHandle myObject; 00296 RTI::AttributeHandle myAttribute; 00297 RTI::FederateHandle myFederate; 00298 }; 00299 00300 00301 typedef DtCallbackWithString<DtFedAmbCall_synchronizationPointRegistrationSucceeded> DtCbSynchronizationPointRegistrationSucceeded; 00302 00303 typedef DtCallbackWithString<DtFedAmbCall_synchronizationPointRegistrationFailed> DtCbSynchronizationPointRegistrationFailed; 00304 00305 typedef DtCallbackWithTwoStrings<DtFedAmbCall_announceSynchronizationPoint> DtCbAnnounceSynchronizationPoint; 00306 00307 typedef DtCallbackWithString<DtFedAmbCall_federationSynchronized> DtCbFederationSynchronized; 00308 00309 typedef DtCallbackWithString<DtFedAmbCall_initiateFederateSave> DtCbInitiateFederateSave; 00310 00311 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationSaved> DtCbFederationSaved; 00312 00313 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationNotSaved> DtCbFederationNotSaved; 00314 00315 typedef DtCallbackWithString<DtFedAmbCall_requestFederationRestoreSucceeded> DtCbRequestFederationRestoreSucceeded; 00316 00317 typedef DtCallbackWithTwoStrings<DtFedAmbCall_requestFederationRestoreFailed> DtCbRequestFederationRestoreFailed; 00318 00319 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationRestoreBegun> DtCbFederationRestoreBegun; 00320 00321 class DtCbInitiateFederateRestore : public DtFedAmbCallback 00322 { 00323 public: 00325 DtCbInitiateFederateRestore(const char * label, RTI::FederateHandle handle); 00326 00328 virtual ~DtCbInitiateFederateRestore(); 00329 private: 00331 DtCbInitiateFederateRestore(DtCbInitiateFederateRestore const& orig); 00332 DtCbInitiateFederateRestore& operator = (DtCbInitiateFederateRestore const& orig); 00333 public: 00335 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00336 protected: 00337 MAKRti::DtString myLabel; 00338 RTI::FederateHandle myFederateHandle; 00339 }; 00340 00341 00342 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationRestored> DtCbFederationRestored; 00343 00344 typedef DtFedAmbCallbackVoid<DtFedAmbCall_federationNotRestored> DtCbFederationNotRestored; 00345 00346 typedef DtCallbackWithObjectClass<DtFedAmbCall_startRegistrationForObjectClass> DtCbStartRegistrationForObjectClass; 00347 00348 typedef DtCallbackWithObjectClass<DtFedAmbCall_stopRegistrationForObjectClass> DtCbStopRegistrationForObjectClass; 00349 00350 typedef DtCallbackWithInteractionClass<DtFedAmbCall_turnInteractionsOn> DtCbTurnInteractionsOn; 00351 00352 typedef DtCallbackWithInteractionClass<DtFedAmbCall_turnInteractionsOff> DtCbTurnInteractionsOff; 00353 00354 class DtCbDiscoverObjectInstance: public DtFedAmbCallback 00355 { 00356 public: 00358 DtCbDiscoverObjectInstance(RTI::ObjectHandle theObject, 00359 RTI::ObjectClassHandle theObjectClass, 00360 const char * theObjectInstanceName); 00362 virtual ~DtCbDiscoverObjectInstance(); 00363 private: 00365 DtCbDiscoverObjectInstance(DtCbDiscoverObjectInstance const& orig); 00366 DtCbDiscoverObjectInstance& operator = (DtCbDiscoverObjectInstance const& orig); 00367 public: 00369 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00370 protected: 00371 RTI::ObjectHandle myObjectHandle; 00372 RTI::ObjectClassHandle myObjectClassHandle; 00373 MAKRti::DtString myString; 00374 }; 00375 00376 00377 class DtCbReflectAttributeValues: public DtFedAmbCallback 00378 { 00379 public: 00381 DtCbReflectAttributeValues( 00382 RTI::ObjectHandle theObject, 00383 const DtAhvps& theAttributes, 00384 const char * theTag); 00385 00386 DtCbReflectAttributeValues ( 00387 RTI::ObjectHandle theObject, 00388 const DtAhvps& theAttributes, 00389 std::auto_ptr<RTI::FedTime> theTime, 00390 const char * theTag, 00391 RTI::EventRetractionHandle theHandle); 00392 00394 virtual ~DtCbReflectAttributeValues(); 00395 private: 00397 DtCbReflectAttributeValues(DtCbReflectAttributeValues const& orig); 00398 DtCbReflectAttributeValues& operator = (DtCbReflectAttributeValues const& orig); 00399 public: 00401 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00402 00403 protected: 00404 RTI::ObjectHandle myObject; 00405 DtAhvps myAttributeValues; 00406 MAKRti::DtString myTag; 00407 std::auto_ptr<RTI::FedTime> myTime; 00408 RTI::EventRetractionHandle myRetractHandle; 00409 }; 00410 00411 class DtCbReceiveInteraction: public DtFedAmbCallback 00412 { 00413 public: 00415 DtCbReceiveInteraction( 00416 RTI::InteractionClassHandle theInteraction, 00417 const DtPhvps& theParameters, 00418 const char * theTag); 00419 00420 DtCbReceiveInteraction( 00421 RTI::InteractionClassHandle theInteraction, 00422 const DtPhvps& theParameters, 00423 std::auto_ptr<RTI::FedTime> theTime, 00424 const char * theTag, 00425 RTI::EventRetractionHandle theHandle); 00426 00428 virtual ~DtCbReceiveInteraction(); 00429 private: 00431 DtCbReceiveInteraction(DtCbReceiveInteraction const& orig); 00432 DtCbReceiveInteraction& operator = (DtCbReceiveInteraction const& orig); 00433 public: 00435 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00436 00437 protected: 00438 RTI::InteractionClassHandle myInteractionClass; 00439 DtPhvps myParameterValues; 00440 MAKRti::DtString myTag; 00441 std::auto_ptr<RTI::FedTime> myTime; 00442 RTI::EventRetractionHandle myRetractHandle; 00443 }; 00444 00445 class DtCbRemoveObjectInstance: public DtFedAmbCallback 00446 { 00447 public: 00449 DtCbRemoveObjectInstance( 00450 RTI::ObjectHandle theObject, 00451 const char * theTag); 00452 DtCbRemoveObjectInstance( 00453 RTI::ObjectHandle theObject, 00454 std::auto_ptr<RTI::FedTime> theTime, 00455 const char * theTag, 00456 RTI::EventRetractionHandle theHandle); 00457 00459 virtual ~DtCbRemoveObjectInstance(); 00460 private: 00462 DtCbRemoveObjectInstance(DtCbRemoveObjectInstance const& orig); 00463 DtCbRemoveObjectInstance& operator = (DtCbRemoveObjectInstance const& orig); 00464 public: 00466 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00467 protected: 00468 RTI::ObjectHandle myObjectHandle; 00469 MAKRti::DtString myTag; 00470 std::auto_ptr<RTI::FedTime> myTime; 00471 RTI::EventRetractionHandle myRetractHandle; 00472 }; 00473 00474 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributesInScope> DtCbAttributesInScope; 00475 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributesOutOfScope> DtCbAttributesOutOfScope; 00476 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_provideAttributeValueUpdate> DtCbProvideAttributeValueUpdate; 00477 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_turnUpdatesOnForObjectInstance> DtCbTurnUpdatesOnForObjectInstance; 00478 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_turnUpdatesOffForObjectInstance> DtCbTurnUpdatesOffForObjectInstance; 00479 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_requestAttributeOwnershipAssumption> DtCbRequestAttributeOwnershipAssumption; 00480 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipDivestitureNotification> DtCbAttributeOwnershipDivestitureNotification; 00481 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipAcquisitionNotification> DtCbAttributeOwnershipAcquisitionNotification; 00482 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_attributeOwnershipUnavailable> DtCbAttributeOwnershipUnavailable; 00483 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_requestAttributeOwnershipRelease> DtCbRequestAttributeOwnershipRelease; 00484 typedef DtCallbackWithObjectAttributesOptTag<DtFedAmbCall_confirmAttributeOwnershipAcquisitionCancellation> DtCbConfirmAttributeOwnershipAcquisitionCancellation; 00485 00486 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_informAttributeOwnership> DtCbInformAttributeOwnership; 00487 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_attributeIsNotOwned> DtCbAttributeIsNotOwned; 00488 typedef DtCallbackWithObjectAttributeOptFederate <DtFedAmbCall_attributeOwnedByRTI> DtCbAttributeOwnedByRTI; 00489 00490 typedef DtCallbackWithTime<DtFedAmbCall_timeRegulationEnabled> DtCbTimeRegulationEnabled; 00491 typedef DtCallbackWithTime<DtFedAmbCall_timeConstrainedEnabled> DtCbTimeConstrainedEnabled; 00492 typedef DtCallbackWithTime<DtFedAmbCall_timeAdvanceGrant> DtCbTimeAdvanceGrant; 00493 00494 class DtCbRequestRetraction: public DtFedAmbCallback 00495 { 00496 public: 00498 DtCbRequestRetraction(RTI::EventRetractionHandle handle); 00500 virtual ~DtCbRequestRetraction(); 00501 private: 00503 DtCbRequestRetraction(DtCbRequestRetraction const& orig); 00504 DtCbRequestRetraction& operator = (DtCbRequestRetraction const& orig); 00505 public: 00507 virtual void evokeCallback(RTI::FederateAmbassador* fedAmb) const; 00508 protected: 00509 RTI::EventRetractionHandle myRetractHandle; 00510 }; 00511 00513 DT_DLL_LRC const char * callbackKindToString(DtFedAmbCallKind kind); 00514 00515 #define fedAmbCallback13_inl_ 00516 #include "fedAmbCallback13.inl" 00517 #undef fedAmbCallback13_inl_ 00518 00519 #endif //DtIFSPEC1516 00520 #endif //DtfedAmbCallback13_h