📄 federationslist.cc
字号:
RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->broadcastInteraction(federate, interaction, parameters, values, list_size, time, tag);}// ----------------------------------------------------------------------------/*! Called by processRegisterSynchronization and processSynchronizationAchieved.*/voidFederationsList::manageSynchronization(Handle handle, FederateHandle federate, bool state, const char *label, const char *tag) throw (FederationAlreadyPaused, FederationNotPaused, FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError){ checkHandle(handle); // It may throw RTIinternalError // It may throw FederationExecutionDoesNotExist Federation *federation = NULL ; searchFederation(handle, federation); // It may throw a bunch of exceptions. if (state) federation->registerSynchronization(federate, label, tag); else federation->unregisterSynchronization(federate, label);}// ----------------------------------------------------------------------------//! Called by processRegisterSynchronization.voidFederationsList::broadcastSynchronization(Handle handle, FederateHandle federate, const char *label, const char *tag) throw (FederationExecutionDoesNotExist, RTIinternalError){ checkHandle(handle); // It may throw RTIinternalError // It may throw FederationExecutionDoesNotExist Federation *federation = NULL ; searchFederation(handle, federation); federation->broadcastSynchronization(federate, label, tag);}// ----------------------------------------------------------------------------// publishInteractionvoidFederationsList::publishInteraction(Handle handle, FederateHandle federate, InteractionClassHandle interaction, bool pub) throw (InteractionClassNotDefined, FederationExecutionDoesNotExist, FederateNotExecutionMember, SaveInProgress, SecurityError, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->publishInteraction(federate, interaction, pub);}// ----------------------------------------------------------------------------// publishObjectvoidFederationsList::publishObject(Handle handle, FederateHandle federate, ObjectClassHandle object_class, AttributeHandle *attributes, UShort list_size, bool pub) throw (ObjectClassNotDefined, AttributeNotDefined, FederationExecutionDoesNotExist, FederateNotExecutionMember, SaveInProgress, RestoreInProgress, SecurityError, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->publishObject(federate, object_class, attributes, list_size, pub);}// ----------------------------------------------------------------------------// subscribeInteractionvoidFederationsList::subscribeInteraction(Handle handle, FederateHandle federate, InteractionClassHandle interaction, bool sub) throw (InteractionClassNotDefined, FederationExecutionDoesNotExist, FederateNotExecutionMember, SaveInProgress, SecurityError, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->subscribeInteraction(federate, interaction, sub);}// ----------------------------------------------------------------------------// subscribeObjectvoidFederationsList::subscribeObject(Handle handle, FederateHandle federate, ObjectClassHandle object_class, AttributeHandle *attributes, UShort list_size, bool sub) throw (ObjectClassNotDefined, AttributeNotDefined, FederationExecutionDoesNotExist, FederateNotExecutionMember, SaveInProgress, RestoreInProgress, SecurityError, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->subscribeObject(federate, object_class, attributes, list_size, sub);}// ----------------------------------------------------------------------------// removeConstrainedvoidFederationsList::removeConstrained(Handle handle, FederateHandle federate) throw (FederationExecutionDoesNotExist, FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); // It may throw a bunch of exceptions. federation->removeConstrained(federate);}// ----------------------------------------------------------------------------// destroyFederationvoidFederationsList::destroyFederation(Handle handle) throw (FederatesCurrentlyJoined, FederationExecutionDoesNotExist, RTIinternalError){ Federation *federation ; // It may throw RTIinternalError checkHandle(handle); // It may throw FederationExecutionDoesNotExist int rank = searchFederation(handle, federation); // It may throw FederatesCurrentlyJoined if (federation->empty()) { list<Federation *>::iterator i = begin(); for (int j = 1 ; i != end() && j <= rank ; j++) { if (j == rank) { erase(i); } } delete federation ; }}// ----------------------------------------------------------------------------// removevoidFederationsList::remove(Handle handle, FederateHandle federate) throw (FederationExecutionDoesNotExist, FederateOwnsAttributes, FederateNotExecutionMember, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); // It may throw FederationExecutionDoesNotExist searchFederation(handle, federation); // It may throw FederateOwnsAttributes or FederateNotExecutionMember federation->remove(federate);}// ----------------------------------------------------------------------------// removeRegulatorvoidFederationsList::removeRegulator(Handle handle, FederateHandle federate) throw (FederationExecutionDoesNotExist, FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->removeRegulator(federate);}// ----------------------------------------------------------------------------/*! This Method tries to remove all references to this Federate in the Federation. To be used when a Federate is supposed to have crashed.*/voidFederationsList::killFederate(Handle handle, FederateHandle federate) throw (){ Federation *federation = NULL ; try { // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->kill(federate); } catch (Exception &e) { return ; }}// ----------------------------------------------------------------------------// isOwnerboolFederationsList::isOwner(Handle handle, FederateHandle federate, ObjectHandle id, AttributeHandle attribute) throw (FederateNotExecutionMember, ObjectNotKnown, AttributeNotDefined, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *f = NULL ; // It may throw FederationExecutionDoesNotExist. searchFederation(handle, f); // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); D.Out(pdDebug, "Owner of Attribute %u of Object %u .", attribute, id); return(f->isOwner(federate, id, attribute));}// ----------------------------------------------------------------------------// searchOwnervoidFederationsList::searchOwner(Handle handle, FederateHandle federate, ObjectHandle id, AttributeHandle attribute) throw (FederateNotExecutionMember, ObjectNotKnown, AttributeNotDefined, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); D.Out(pdDebug, "Owner of Attribute %u of Object %u .", attribute, id); federation->queryAttributeOwnership(federate, id, attribute);}// ----------------------------------------------------------------------------// negotiateDivestiturevoidFederationsList::negotiateDivestiture(Handle handle, FederateHandle federate, ObjectHandle id, AttributeHandle *attributes, UShort list_size, const char *tag) throw (FederateNotExecutionMember, ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, AttributeAlreadyBeingDivested, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); D.Out(pdDebug, "NegotiatedAttributeOwnershipDivestiture of Object %u.", id); federation->negotiateDivestiture(federate, id, attributes, list_size, tag);}// ----------------------------------------------------------------------------// acquireIfAvailablevoidFederationsList::acquireIfAvailable(Handle handle, FederateHandle federate, ObjectHandle id, AttributeHandle *attributes, UShort list_size) throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined, AttributeNotPublished, FederateOwnsAttributes, AttributeAlreadyBeingAcquired, FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -