📄 federationslist.cc
字号:
// It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); D.Out(pdTrace, "theObjectClass = %d, name = %s.", object_class, name); return(federation->registerObject(federate, object_class, name));}// ----------------------------------------------------------------------------// checkHandle/*! handle can be any type of handle, not only a Federation handle. Throw an exception if Handle is not correct(too low or too big)*/voidFederationsList::checkHandle(FederationHandle handle) throw (RTIinternalError){D.Out(pdTrace, "checkHandle"); if (handle <= 0) { D.Out(pdExcept, "Illegal Handle %d.", handle); throw RTIinternalError("Negative or null FederationHandle."); }}// ----------------------------------------------------------------------------// updateRegulatorvoidFederationsList::updateRegulator(FederationHandle handle, FederateHandle federate, FederationTime time) throw (FederationExecutionDoesNotExist, FederateNotExecutionMember, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->updateRegulator(federate, time);}// ----------------------------------------------------------------------------// updateAttributevoidFederationsList::updateAttribute(FederationHandle handle, FederateHandle federate, ObjectHandle id, AttributeHandle *attributes, AttributeValue *values, UShort list_size, FederationTime time, const char *tag) throw (FederateNotExecutionMember, FederationExecutionDoesNotExist, ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, SaveInProgress, RestoreInProgress, RTIinternalError){ Federation *federation = NULL ; // It may throw RTIinternalError. checkHandle(handle); checkHandle(federate); // It may throw FederationExecutionDoesNotExist. searchFederation(handle, federation); federation->updateAttributeValues(federate, id, attributes, values, list_size, time, tag);}// ----------------------------------------------------------------------------// updateParametervoidFederationsList::updateParameter(FederationHandle handle, FederateHandle federate, InteractionClassHandle interaction, ParameterHandle *parameters, ParameterValue *values, UShort list_size, FederationTime time, const char *tag) throw (FederateNotExecutionMember, FederateNotPublishing, FederationExecutionDoesNotExist, InteractionClassNotDefined, InteractionParameterNotDefined, SaveInProgress, RestoreInProgress, 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(FederationHandle 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){ D.Out(pdTrace, "call registerSynchronization"); federation->registerSynchronization(federate, label, tag);} else{ D.Out(pdTrace, "call unregisterSynchronization"); federation->unregisterSynchronization(federate, label);}}// ---------------------------------------------------------------------------//! Called by processRegisterSynchronization.voidFederationsList::broadcastSynchronization(FederationHandle 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(FederationHandle 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(FederationHandle 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(FederationHandle 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(FederationHandle 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(FederationHandle 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(FederationHandle 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(FederationHandle handle, FederateHandle federate) throw (FederationExecutionDoesNotExist, FederateOwnsAttributes, FederateNotExecutionMember,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -