📄 rtiambassador.cc
字号:
// ----------------------------------------------------------------------------// Cancel Negotiated Attribute Ownership DivestiturevoidRTIambassador::cancelNegotiatedAttributeOwnershipDivestiture(ObjectHandle theObject, const AttributeHandleSet& attrs) throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, AttributeDivestitureWasNotRequested, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; // Envoyer la requete au RTI req.type = CANCEL_NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE ; req.object = (ObjectHandle) theObject ; req.handleArraySize = attrs.size(); for (int i = 0 ; i < attrs.size(); i++) { req.handleArray[i] = attrs.getHandle(i); } executeService(&req, &rep);}// ----------------------------------------------------------------------------// Cancel Attribute Ownership AcquisitionvoidRTIambassador::cancelAttributeOwnershipAcquisition(ObjectHandle theObject, const AttributeHandleSet& attrs) throw (ObjectNotKnown, AttributeNotDefined, AttributeAlreadyOwned, AttributeAcquisitionWasNotRequested, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; // Envoyer la requete au RTI req.type = CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION ; req.object = (ObjectHandle) theObject ; req.handleArraySize = attrs.size(); for (int i = 0 ; i < attrs.size(); i++) { req.handleArray[i] = attrs.getHandle(i); } executeService(&req, &rep);}// ----------------------------------------------------------------------------// Attribute Ownership Acquisition If AvailablevoidRTIambassador::attributeOwnershipAcquisitionIfAvailable(ObjectHandle theObject, const AttributeHandleSet& desired) throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined, AttributeNotPublished, FederateOwnsAttributes, AttributeAlreadyBeingAcquired, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; // Envoyer la requete au RTI req.type = ATTRIBUTE_OWNERSHIP_ACQUISITION_IF_AVAILABLE ; req.object = (ObjectHandle) theObject ; req.handleArraySize = desired.size(); for (int i = 0 ; i < desired.size(); i++) { req.handleArray[i] = desired.getHandle(i); D.Out(pdTrace, "Objet %u Attribut %u", theObject, req.handleArray[i]); } executeService(&req, &rep);}// ----------------------------------------------------------------------------// Query Attribute OwnershipvoidRTIambassador::queryAttributeOwnership(ObjectHandle theObject, AttributeHandle theAttribute) throw (ObjectNotKnown, AttributeNotDefined, AttributeNotKnown, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTIA/RTIG req.type = QUERY_ATTRIBUTE_OWNERSHIP ; req.object = theObject ; req.attribute = theAttribute ; executeService(&req, &rep);}// ----------------------------------------------------------------------------// 5.16 Is Attribute Owned By FederateBooleanRTIambassador::isAttributeOwnedByFederate(ObjectHandle theObject, AttributeHandle theAttribute) throw (ObjectNotKnown, AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTIA req.type = IS_ATTRIBUTE_OWNED_BY_FEDERATE ; req.object = theObject ; req.attribute = theAttribute ; executeService(&req, &rep); return ((strcmp(rep.getTag(), "RTI_TRUE") == 0) ? RTI_TRUE : RTI_FALSE);}// ===========================================================================// TIME MANAGEMENT// ===========================================================================// ----------------------------------------------------------------------------// Enable Time RegulationvoidRTIambassador::enableTimeRegulation(const FedTime& /*theFederateTime*/, const FedTime& /*theLookahead*/) throw (FederationTimeAlreadyPassed, TimeRegulationAlreadyEnabled, //not implemented EnableTimeRegulationPending, //not implemented TimeAdvanceAlreadyInProgress, //not implemented InvalidFederationTime, //not implemented InvalidLookahead, //not implemented ConcurrentAccessAttempted, //not implemented FederateNotExecutionMember, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = SET_TIME_REGULATING ; req.boolean = RTI_TRUE ; executeService(&req, &rep);}// ----------------------------------------------------------------------------// Disable Time RegulationvoidRTIambassador::disableTimeRegulation(void) throw (FederationTimeAlreadyPassed, TimeRegulationWasNotEnabled, //not implemented ConcurrentAccessAttempted, FederateNotExecutionMember, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = SET_TIME_REGULATING ; req.boolean = RTI_FALSE ; executeService(&req, &rep);}// ----------------------------------------------------------------------------// Enable Time ConstrainedvoidRTIambassador::enableTimeConstrained(void) throw (TimeConstrainedAlreadyEnabled, //not implemented EnableTimeConstrainedPending, //not implemented TimeAdvanceAlreadyInProgress, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = SET_TIME_CONSTRAINED ; req.boolean = RTI_TRUE ; executeService(&req, &rep);}// ----------------------------------------------------------------------------// Disable Time ConstrainedvoidRTIambassador::disableTimeConstrained(void) throw ( TimeConstrainedWasNotEnabled, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = SET_TIME_CONSTRAINED ; req.boolean = RTI_FALSE ; executeService(&req, &rep);}// ----------------------------------------------------------------------------// Time Advance RequestvoidRTIambassador::timeAdvanceRequest(FedTime& theTime) throw (TimeAdvanceAlreadyInProgress, FederationTimeAlreadyPassed, InvalidFederationTime, EnableTimeRegulationPending, //not implemented EnableTimeConstrainedPending, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = TIME_ADVANCE_REQUEST ; req.date = (FederationTime) (RTIfedTime(theTime)._fedTime); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Time Advance Request AvailablevoidRTIambassador::timeAdvanceRequestAvailable(const FedTime& /*theTime*/) throw (InvalidFederationTime, FederationTimeAlreadyPassed, TimeAdvanceAlreadyInProgress, EnableTimeRegulationPending, EnableTimeConstrainedPending, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService){ throw UnimplementedService();}// ----------------------------------------------------------------------------// Next Event RequestvoidRTIambassador::nextEventRequest(const FedTime& theTime) throw (TimeAdvanceAlreadyInProgress, FederationTimeAlreadyPassed, InvalidFederationTime, EnableTimeRegulationPending, //not implemented EnableTimeConstrainedPending, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = NEXT_EVENT_REQUEST ; req.date = (FederationTime) ((RTIfedTime&) theTime).getTime(); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Next Event Request AvailablevoidRTIambassador::nextEventRequestAvailable(const FedTime& /*theTime*/) throw (InvalidFederationTime, FederationTimeAlreadyPassed, TimeAdvanceAlreadyInProgress, EnableTimeRegulationPending, EnableTimeConstrainedPending, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService){ throw UnimplementedService();}// ----------------------------------------------------------------------------// Flush Queue RequestvoidRTIambassador::flushQueueRequest(const FedTime& /*theTime*/) throw (TimeAdvanceAlreadyInProgress, FederationTimeAlreadyPassed, InvalidFederationTime, EnableTimeRegulationPending, //not implemented EnableTimeConstrainedPending, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ throw UnimplementedService();}// ----------------------------------------------------------------------------// Enable Asynchronous DeliveryvoidRTIambassador::enableAsynchronousDelivery(void) throw (AsynchronousDeliveryAlreadyEnabled, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService){ throw UnimplementedService();}// ----------------------------------------------------------------------------// Disable Asynchronous DeliveryvoidRTIambassador::disableAsynchronousDelivery(void) throw (AsynchronousDeliveryAlreadyDisabled, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService){ throw UnimplementedService();}// ----------------------------------------------------------------------------// Query LBTSvoidRTIambassador::queryLBTS(FedTime& theTime) throw (FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = REQUEST_LBTS ; executeService(&req, &rep); theTime = RTIfedTime(rep.date);}// ----------------------------------------------------------------------------// Query Federate TimevoidRTIambassador::queryFederateTime(FedTime& theTime) throw (FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError){ Message req, rep ; // envoyer la requete au RTI req.type = REQUEST_FEDERATE_TIME ; executeService(&req, &rep); theTime = RTIfedTime(rep.date);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -