7 #ifndef DtVrlFederateAmbassador_H_
8 #define DtVrlFederateAmbassador_H_
47 struct DtScopeChangeCallbackData
59 throw( RTI::FederateInternalError );
82 virtual
void addReflectAttributeValuesCb( RTI::
ObjectHandle id,
84 virtual
void removeReflectAttributeValuesCb( RTI::
ObjectHandle id,
89 virtual
void addDiscoverObjectCb( RTI::ObjectClassHandle hand,
91 virtual
void removeDiscoverObjectCb( RTI::ObjectClassHandle hand,
103 virtual
void addStartRegCb( RTI::ObjectClassHandle hand,
105 virtual
void removeStartRegCb( RTI::ObjectClassHandle hand,
110 virtual
void addStopRegCb( RTI::ObjectClassHandle hand,
112 virtual
void removeStopRegCb( RTI::ObjectClassHandle hand,
126 virtual
void removeUpdatesOffCb( RTI::
ObjectHandle hand,
131 virtual
void addStartInteractionsCb( RTI::InteractionClassHandle hand,
133 virtual
void removeStartInteractionsCb( RTI::InteractionClassHandle hand,
138 virtual
void addStopInteractionsCb( RTI::InteractionClassHandle hand,
140 virtual
void removeStopInteractionsCb( RTI::InteractionClassHandle hand,
145 virtual
void addReceiveInteractionCb( RTI::InteractionClassHandle hand,
147 virtual
void removeReceiveInteractionCb( RTI::InteractionClassHandle hand,
152 virtual
void addTimeAdvanceGrantCb(
DtFedTimeCb cb,
void* usr );
153 virtual
void removeTimeAdvanceGrantCb(
DtFedTimeCb cb,
void* usr );
157 virtual
void addTimeRegulationEnabledCb(
DtFedTimeCb cb,
void* usr );
158 virtual
void removeTimeRegulationEnabledCb(
DtFedTimeCb cb,
void* usr );
162 virtual
void addTimeConstrainedEnabledCb(
DtFedTimeCb cb,
void* usr );
163 virtual
void removeTimeConstrainedEnabledCb(
DtFedTimeCb cb,
void* usr );
165 virtual
void setRemoveObjectOnAttOutOfScope(
bool remove);
166 virtual
bool removeObjectOnAttOutOfScope() const;
172 virtual
void addFederateSaveCb(const
DtString& label,
177 virtual
void removeFederateSaveCb(const
DtString& label,
185 virtual
void addFederateRestoreCb(const
DtString& label,
190 virtual
void removeFederateRestoreCb(const
DtString& label,
196 virtual
bool waitingForSaveOrRestore() const;
205 virtual
void timeAdvanceGrant( const RTI::
FedTime& theTime )
206 throw( RTI::InvalidFederationTime,
207 RTI::TimeAdvanceWasNotInProgress,
208 RTI::FederateInternalError );
210 virtual
void timeRegulationEnabled( const RTI::
FedTime& theTime )
211 throw( RTI::InvalidFederationTime,
212 RTI::EnableTimeRegulationWasNotPending,
213 RTI::FederateInternalError );
215 virtual
void timeConstrainedEnabled( const RTI::
FedTime& theTime )
216 throw( RTI::InvalidFederationTime,
217 RTI::EnableTimeConstrainedWasNotPending,
218 RTI::FederateInternalError );
220 virtual
void startRegistrationForObjectClass(
221 RTI::ObjectClassHandle theClass )
222 throw( RTI::ObjectClassNotPublished,
223 RTI::FederateInternalError );
225 virtual
void stopRegistrationForObjectClass(
226 RTI::ObjectClassHandle theClass )
227 throw( RTI::ObjectClassNotPublished,
228 RTI::FederateInternalError );
230 virtual
void turnInteractionsOn(
231 RTI::InteractionClassHandle theHandle )
232 throw( RTI::InteractionClassNotPublished,
233 RTI::FederateInternalError );
235 virtual
void turnInteractionsOff(
236 RTI::InteractionClassHandle theHandle )
237 throw( RTI::InteractionClassNotPublished,
238 RTI::FederateInternalError );
240 virtual
void discoverObjectInstance(
242 RTI::ObjectClassHandle theObjectClass,
243 const
char* theObjectName )
244 throw( RTI::CouldNotDiscover,
245 RTI::ObjectClassNotKnown,
246 RTI::FederateInternalError );
248 virtual
void reflectAttributeValues(
253 RTI::EventRetractionHandle theHandle )
254 throw( RTI::ObjectNotKnown,
255 RTI::AttributeNotKnown,
256 RTI::FederateOwnsAttributes,
257 RTI::InvalidFederationTime,
258 RTI::FederateInternalError );
260 virtual
void reflectAttributeValues(
264 throw( RTI::ObjectNotKnown,
265 RTI::AttributeNotKnown,
266 RTI::FederateOwnsAttributes,
267 RTI::FederateInternalError);
269 virtual
void receiveInteraction(
270 RTI::InteractionClassHandle theInteraction,
274 RTI::EventRetractionHandle theHandle )
275 throw( RTI::InteractionClassNotKnown,
276 RTI::InteractionParameterNotKnown,
277 RTI::InvalidFederationTime,
278 RTI::FederateInternalError );
280 virtual
void receiveInteraction(
281 RTI::InteractionClassHandle theInteraction,
284 throw( RTI::InteractionClassNotKnown,
285 RTI::InteractionParameterNotKnown,
286 RTI::FederateInternalError );
288 virtual
void removeObjectInstance(
292 RTI::EventRetractionHandle theHandle )
293 throw( RTI::ObjectNotKnown,
294 RTI::InvalidFederationTime,
295 RTI::FederateInternalError );
297 virtual
void removeObjectInstance(
300 throw( RTI::ObjectNotKnown,
301 RTI::FederateInternalError );
303 virtual
void attributesInScope (
305 const RTI::AttributeHandleSet& theAttributes)
306 throw ( RTI::ObjectNotKnown,
307 RTI::AttributeNotKnown,
308 RTI::FederateInternalError);
310 virtual
void attributesOutOfScope (
312 const RTI::AttributeHandleSet& theAttributes)
313 throw ( RTI::ObjectNotKnown,
314 RTI::AttributeNotKnown,
315 RTI::FederateInternalError);
318 virtual
void provideAttributeValueUpdate(
320 const RTI::AttributeHandleSet& theAttributes )
321 throw( RTI::ObjectNotKnown,
322 RTI::AttributeNotKnown,
323 RTI::AttributeNotOwned,
324 RTI::FederateInternalError );
326 virtual
void turnUpdatesOnForObjectInstance(
328 const RTI::AttributeHandleSet& theAttributes )
329 throw( RTI::ObjectNotKnown,
330 RTI::AttributeNotOwned,
331 RTI::FederateInternalError );
333 virtual
void turnUpdatesOffForObjectInstance(
335 const RTI::AttributeHandleSet& theAttributes )
336 throw( RTI::ObjectNotKnown,
337 RTI::AttributeNotOwned,
338 RTI::FederateInternalError );
341 virtual
void requestAttributeOwnershipAssumption(
343 const RTI::AttributeHandleSet& offeredAttributes,
345 throw( RTI::ObjectNotKnown,
346 RTI::AttributeNotKnown,
347 RTI::AttributeAlreadyOwned,
348 RTI::AttributeNotPublished,
349 RTI::FederateInternalError );
351 virtual
void attributeOwnershipDivestitureNotification(
353 const RTI::AttributeHandleSet& releasedAttributes )
354 throw( RTI::ObjectNotKnown,
355 RTI::AttributeNotKnown,
356 RTI::AttributeNotOwned,
357 RTI::AttributeDivestitureWasNotRequested,
358 RTI::FederateInternalError );
360 virtual
void attributeOwnershipAcquisitionNotification(
362 const RTI::AttributeHandleSet& securedAttributes )
363 throw( RTI::ObjectNotKnown,
364 RTI::AttributeNotKnown,
365 RTI::AttributeAcquisitionWasNotRequested,
366 RTI::AttributeAlreadyOwned,
367 RTI::AttributeNotPublished,
368 RTI::FederateInternalError );
370 virtual
void attributeOwnershipUnavailable(
372 const RTI::AttributeHandleSet& theAttributes )
373 throw( RTI::ObjectNotKnown,
374 RTI::AttributeNotKnown,
375 RTI::AttributeAlreadyOwned,
376 RTI::AttributeAcquisitionWasNotRequested,
377 RTI::FederateInternalError );
379 virtual
void requestAttributeOwnershipRelease(
381 const RTI::AttributeHandleSet& candidateAttributes,
383 throw( RTI::ObjectNotKnown,
384 RTI::AttributeNotKnown,
385 RTI::AttributeNotOwned,
386 RTI::FederateInternalError );
388 virtual
void confirmAttributeOwnershipAcquisitionCancellation(
390 const RTI::AttributeHandleSet& theAttributes )
391 throw( RTI::ObjectNotKnown,
392 RTI::AttributeNotKnown,
393 RTI::AttributeAlreadyOwned,
394 RTI::AttributeAcquisitionWasNotCanceled,
395 RTI::FederateInternalError );
397 virtual
void informAttributeOwnership(
399 RTI::AttributeHandle theAttribute,
400 RTI::FederateHandle theOwner )
401 throw( RTI::ObjectNotKnown,
402 RTI::AttributeNotKnown,
403 RTI::FederateInternalError );
405 virtual
void attributeIsNotOwned(
407 RTI::AttributeHandle theAttribute )
408 throw( RTI::ObjectNotKnown,
409 RTI::AttributeNotKnown,
410 RTI::FederateInternalError );
412 virtual
void attributeOwnedByRTI(
414 RTI::AttributeHandle theAttribute )
415 throw( RTI::ObjectNotKnown,
416 RTI::AttributeNotKnown,
417 RTI::FederateInternalError);
422 virtual
void initiateFederateSave(
424 throw( RTI::UnableToPerformSave,
425 RTI::FederateInternalError );
427 virtual
void federationSaved()
428 throw( RTI::FederateInternalError);
430 virtual
void federationNotSaved()
431 throw( RTI::FederateInternalError );
437 virtual
void initiateFederateRestore (
439 RTI::FederateHandle handle)
441 RTI::SpecifiedSaveLabelDoesNotExist,
442 RTI::CouldNotRestore,
443 RTI::FederateInternalError);
445 virtual
void federationRestored ()
447 RTI::FederateInternalError);
451 virtual
void synchronizationPointRegistrationSucceeded( const
char* label )
452 throw( RTI::FederateInternalError );
454 virtual
void synchronizationPointRegistrationFailed( const
char* label )
455 throw( RTI::FederateInternalError );
457 virtual
void federationSynchronized( const
char* label )
458 throw( RTI::FederateInternalError );
460 virtual
void announceSynchronizationPoint(
461 const
char* label, const
char* tag )
462 throw( RTI::FederateInternalError );
465 virtual
void addSynchPointRegSucceededCb(const
DtString& label,
470 virtual
void removeSynchPointRegSucceededCb(const
DtString& label,
475 virtual
void addSynchPointRegFailedCb(const
DtString& label,
480 virtual
void removeSynchPointRegFailedCb(const
DtString& label,
485 virtual
void addFederationSynchedCb(const
DtString& label,
490 virtual
void removeFederationSynchedCb(const
DtString& label,
495 virtual
void addAnnounceSynchPointCb(const
DtString& label,
500 virtual
void removeAnnounceSynchPointCb(const
DtString& label,
507 virtual const RTI::Region* getRegionFromAttributes(
510 virtual const RTI::Region* getRegionFromParameters(
513 struct DtFederateSaveCbInfo
519 struct DtFederateRestoreCbInfo
525 struct DtLabelledFederateSaveCbInfo
532 struct DtLabelledFederateRestoreCbInfo
539 struct DtGeneralSynchPointCbInfo
545 struct DtLabelledSynchPointCbInfo
552 struct DtGeneralAnnounceCbInfo
558 struct DtLabelledAnnounceCbInfo
565 static void attributesOutOfScopeCb(
void* usr);
585 std::list<DtFederateSaveCbInfo> myFederateSaveCbList;
586 std::list<DtLabelledFederateSaveCbInfo> myLabFederateSaveCbList;
587 std::list<DtFederateRestoreCbInfo> myFederateRestoreCbList;
588 std::list<DtLabelledFederateRestoreCbInfo> myLabFederateRestoreCbList;
590 std::list<DtLabelledSynchPointCbInfo> myLabSynchPtRegSucceededCbList;
591 std::list<DtLabelledSynchPointCbInfo> myLabSynchPtRegFailedCbList;
592 std::list<DtLabelledSynchPointCbInfo> myLabFederationSynchedCbList;
593 std::list<DtLabelledAnnounceCbInfo> myLabAnnounceSynchPointCbList;
595 std::list<DtGeneralSynchPointCbInfo> mySynchPtRegSucceededCbList;
596 std::list<DtGeneralSynchPointCbInfo> mySynchPtRegFailedCbList;
597 std::list<DtGeneralSynchPointCbInfo> myFederationSynchedCbList;
598 std::list<DtGeneralAnnounceCbInfo> myAnnounceSynchPointCbList;
600 bool myRemoveObjectOnAttOutOfScope;
603 virtual void applyFedsSynchedCallbacks(
const char* label);
604 virtual void applyRegistrationSucceededCallbacks(
const char* label);
605 virtual void applyRegistrationFailedCallbacks(
const char* label);
608 virtual bool applyAnnounceCallbacks(
const char* label,
const char* tag);
612 bool myWaitingForSave;
613 bool myWaitingForRestore;