📄 rtia_federate.cc
字号:
tm->setTimeConstrained(req->getBoolean(), e); break ; case Message::TICK_REQUEST: D.Out(pdDebug, "Receiving Message from Federate, type TickRequest."); rep.setBoolean(tm->tick(e)); break ; default: D.Out(pdExcept, "Receiving Message from Federate, Unknown Type %d.", req->type); throw RTIinternalError(); } stat.federateService(req->type);}// ----------------------------------------------------------------------------//! RTIA processes a service request coming from federate.voidRTIA::processFederateRequest(Message *req){ Message rep ; //rep.setException(e_NO_EXCEPTION); rep.type = req->type ; try { TypeException e ; chooseFederateProcessing(req, rep, e); rep.setException(e); } catch (ArrayIndexOutOfBounds &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ArrayIndexOutOfBounds); } catch (AttributeAlreadyOwned &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeAlreadyOwned); } catch (AttributeAlreadyBeingDivested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeAlreadyBeingDivested); } catch (AttributeAlreadyBeingAcquired &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeAlreadyBeingAcquired); } catch (AttributeAcquisitionWasNotRequested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeAcquisitionWasNotRequested); } catch (AttributeDivestitureWasNotRequested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeDivestitureWasNotRequested); } catch (AttributeNotDefined &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeNotDefined); } catch (AttributeNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeNotKnown); } catch (AttributeNotOwned &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeNotOwned); } catch (AttributeNotPublished &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeNotPublished); } catch (AttributeNotSubscribed &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_AttributeNotSubscribed); } catch (ConcurrentAccessAttempted &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ConcurrentAccessAttempted); } catch (CouldNotDiscover &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_CouldNotDiscover); } catch (CouldNotOpenRID &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_CouldNotOpenRID); } catch (CouldNotRestore &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_CouldNotRestore); } catch (DeletePrivilegeNotHeld &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_DeletePrivilegeNotHeld); } catch (ErrorReadingRID &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ErrorReadingRID); } catch (EventNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_EventNotKnown); } catch (FederateAlreadyPaused &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateAlreadyPaused); } catch (FederateAlreadyExecutionMember &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateAlreadyExecutionMember); } catch (FederateDoesNotExist &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateDoesNotExist); } catch (FederateInternalError &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateInternalError); } catch (FederateNameAlreadyInUse &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateNameAlreadyInUse); } catch (FederateNotExecutionMember &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateNotExecutionMember); } catch (FederateNotPaused &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateNotPaused); } catch (FederateNotPublishing &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateNotPublishing); } catch (FederateNotSubscribing &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateNotSubscribing); } catch (FederateOwnsAttributes &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateOwnsAttributes); } catch (FederatesCurrentlyJoined &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederatesCurrentlyJoined); } catch (FederateWasNotAskedToReleaseAttribute &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederateWasNotAskedToReleaseAttribute); } catch (FederationAlreadyPaused &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederationAlreadyPaused); } catch (FederationExecutionAlreadyExists &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederationExecutionAlreadyExists); } catch (FederationExecutionDoesNotExist &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederationExecutionDoesNotExist); } catch (FederationNotPaused &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederationNotPaused); } catch (FederationTimeAlreadyPassed &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_FederationTimeAlreadyPassed); } catch (IDsupplyExhausted &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_IDsupplyExhausted); } catch (InteractionClassNotDefined &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InteractionClassNotDefined); } catch (InteractionClassNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InteractionClassNotKnown); } catch (InteractionClassNotPublished &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InteractionClassNotPublished); } catch (InteractionParameterNotDefined &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InteractionParameterNotDefined); } catch (InteractionParameterNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InteractionParameterNotKnown); } catch (InvalidDivestitureCondition &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidDivestitureCondition); } catch (InvalidExtents &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidExtents); } catch (InvalidFederationTime &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidFederationTime); } catch (InvalidFederationTimeDelta &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidFederationTimeDelta); } catch (InvalidObjectHandle &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidObjectHandle); } catch (InvalidOrderType &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidOrderType); } catch (InvalidResignAction &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidResignAction); } catch (InvalidRetractionHandle &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidRetractionHandle); } catch (InvalidRoutingSpace &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidRoutingSpace); } catch (InvalidTransportType &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_InvalidTransportType); } catch (MemoryExhausted &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_MemoryExhausted); } catch (NameNotFound &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_NameNotFound); } catch (NoPauseRequested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_NoPauseRequested); } catch (NoResumeRequested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_NoResumeRequested); } catch (ObjectClassNotDefined &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ObjectClassNotDefined); } catch (ObjectClassNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ObjectClassNotKnown); } catch (ObjectClassNotPublished &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ObjectClassNotPublished); } catch (ObjectClassNotSubscribed &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ObjectClassNotSubscribed); } catch (ObjectNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ObjectNotKnown); } catch (ObjectAlreadyRegistered &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ObjectAlreadyRegistered); } catch (RegionNotKnown &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_RegionNotKnown); } catch (RestoreInProgress &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_RestoreInProgress); } catch (RestoreNotRequested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_RestoreNotRequested); } catch (RTIinternalError &e) { cout << "RTIA sends InternalError to Fed., " ; if (e._reason != NULL) cout << "reason : " << e._reason << endl ; else cout << "no reason given." << endl ; D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_RTIinternalError); } catch (SpaceNotDefined &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_SpaceNotDefined); } catch (SaveInProgress &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_SaveInProgress); } catch (SaveNotInitiated &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_SaveNotInitiated); } catch (SpecifiedSaveLabelDoesNotExist &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_SpecifiedSaveLabelDoesNotExist); } catch (TimeAdvanceAlreadyInProgress &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_TimeAdvanceAlreadyInProgress); } catch (TimeAdvanceWasNotInProgress &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_TimeAdvanceWasNotInProgress); } catch (TooManyIDsRequested &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_TooManyIDsRequested); } catch (UnableToPerformSave &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_UnableToPerformSave); } catch (UnimplementedService &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_UnimplementedService); } catch (UnknownLabel &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_UnknownLabel); } catch (ValueCountExceeded &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ValueCountExceeded); } catch (ValueLengthExceeded &e) { D.Out(pdExcept, "Catched %s Exception.", e._name); rep.setException(e_ValueLengthExceeded); } // Default Handler catch (Exception &e) { D.Out(pdExcept, "Unknown Exception : %s.", e._name); rep.setException(e_RTIinternalError); } delete req ; comm->sendUN(&rep); D.Out(pdDebug, "Reply send to Unix socket.");}}} // namespace certi/rtia// $Id: RTIA_federate.cc,v 3.27 2003/11/13 10:52:20 breholee Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -