📄 objectservices.cc
字号:
// ----------------------------------------------------------------------------// CERTI - HLA RunTime Infrastructure// Copyright (C) 2002, 2003 ONERA//// This file is part of CERTI-libRTI//// CERTI-libRTI is free software ; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public License// as published by the Free Software Foundation ; either version 2 of// the License, or (at your option) any later version.//// CERTI-libRTI is distributed in the hope that it will be useful, but// WITHOUT ANY WARRANTY ; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this program ; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307// USA//// $Id: ObjectServices.cc,v 3.1 2003/07/04 12:00:58 breholee Exp $// ----------------------------------------------------------------------------#include <config.h>#include "RTIambassador.hh"#include "Message.hh"namespace certi {static pdCDebug D("LIBRTI", "(libRTI OM) - ");// ===========================================================================// OBJECT MANAGEMENT// ===========================================================================// ----------------------------------------------------------------------------// Register ObjectObjectHandleRTIambassador::registerObjectInstance(ObjectClassHandle theClass, const char *theObjectName) throw (ObjectClassNotDefined, ObjectClassNotPublished, InvalidObjectHandle, //RTI ObjectAlreadyRegistered, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::REGISTER_OBJECT_INSTANCE ; req.setName(theObjectName); req.setObjectClass(theClass); executeService(&req, &rep); return rep.getObject();}// ----------------------------------------------------------------------------ObjectHandleRTIambassador::registerObjectInstance(ObjectClassHandle theClass) throw (ObjectClassNotDefined, ObjectClassNotPublished, InvalidObjectHandle, //RTI ObjectAlreadyRegistered, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::REGISTER_OBJECT_INSTANCE ; req.setName("\0"); req.setObjectClass(theClass); executeService(&req, &rep); return rep.getObject();}// ----------------------------------------------------------------------------// Update Attribute ValuesEventRetractionHandleRTIambassador::updateAttributeValues(ObjectHandle theObject, const AttributeHandleValuePairSet& theAttributes, const FedTime& theTime, const char *theTag) throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::UPDATE_ATTRIBUTE_VALUES ; req.setObject(theObject); req.setFedTime(theTime); req.setTag(theTag); req.setAHVPS(theAttributes); req.setBoolean(RTI_TRUE); executeService(&req, &rep); return rep.getEventRetraction();}// ----------------------------------------------------------------------------voidRTIambassador::updateAttributeValues(ObjectHandle the_object, const AttributeHandleValuePairSet& attrs, const char *the_tag) throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService) //CERTI{ throw UnimplementedService(); Message req, rep ; req.type = Message::UPDATE_ATTRIBUTE_VALUES ; req.setObject(the_object); req.setTag(the_tag); req.setAHVPS(attrs); req.setBoolean(RTI_FALSE); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Send InteractionEventRetractionHandleRTIambassador::sendInteraction(InteractionClassHandle theInteraction, const ParameterHandleValuePairSet& theParameters, const FedTime& theTime, const char *theTag) throw (InteractionClassNotDefined, InteractionClassNotPublished, InteractionParameterNotDefined, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::SEND_INTERACTION ; req.setInteractionClass(theInteraction); req.setFedTime(theTime); req.setTag(theTag); req.setPHVPS(theParameters); req.setBoolean(RTI_TRUE); executeService(&req, &rep); return rep.getEventRetraction();}// ----------------------------------------------------------------------------voidRTIambassador::sendInteraction(InteractionClassHandle the_interaction, const ParameterHandleValuePairSet ¶meters, const char *the_tag) throw (InteractionClassNotDefined, InteractionClassNotPublished, InteractionParameterNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService) //CERTI{ throw UnimplementedService(); Message req, rep ; req.type = Message::SEND_INTERACTION ; req.setInteractionClass(the_interaction); req.setTag(the_tag); req.setPHVPS(parameters); req.setBoolean(RTI_FALSE); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Delete ObjectEventRetractionHandleRTIambassador::deleteObjectInstance(ObjectHandle theObject, const FedTime& theTime, const char *theTag) throw (ObjectNotKnown, DeletePrivilegeNotHeld, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::DELETE_OBJECT_INSTANCE ; req.setObject(theObject); req.setFedTime(theTime); req.setTag(theTag); executeService(&req, &rep); return rep.getEventRetraction();}// ----------------------------------------------------------------------------voidRTIambassador::deleteObjectInstance(ObjectHandle theObject, const char *theTag) throw (ObjectNotKnown, DeletePrivilegeNotHeld, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService) //CERTI{ throw UnimplementedService(); Message req, rep ; req.type = Message::DELETE_OBJECT_INSTANCE ; req.setObject(theObject); req.setTag(theTag); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Local Delete Object InstancevoidRTIambassador::localDeleteObjectInstance(ObjectHandle theObject) throw (ObjectNotKnown, FederateOwnsAttributes, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService) //CERTI{ throw UnimplementedService(); Message req, rep ; req.type = Message::LOCAL_DELETE_OBJECT_INSTANCE ; req.setObject(theObject); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Change Attribute Transportation TypevoidRTIambassador::changeAttributeTransportationType(ObjectHandle theObject, const AttributeHandleSet& theAttributes, TransportationHandle theType) throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, InvalidTransportType, //CERTI InvalidTransportationHandle, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::CHANGE_ATTRIBUTE_TRANSPORTATION_TYPE ; req.setObject(theObject); req.setTransportation(theType); req.setAHS(theAttributes); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Change Interaction Transportation TypevoidRTIambassador::changeInteractionTransportationType(InteractionClassHandle theClass, TransportationHandle theType) throw (InteractionClassNotDefined, InteractionClassNotPublished, InvalidTransportType, //CERTI InvalidTransportationHandle, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError){ Message req, rep ; req.type = Message::CHANGE_INTERACTION_TRANSPORTATION_TYPE ; req.setInteractionClass(theClass); req.setTransportation(theType); executeService(&req, &rep);}// ----------------------------------------------------------------------------// Request Attribute Value UpdatevoidRTIambassador::requestObjectAttributeValueUpdate(ObjectHandle theObject, const AttributeHandleSet &ahs) throw (ObjectNotKnown, // not implemented AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService) //CERTI{ throw UnimplementedService(); Message req, rep ; req.type = Message::REQUEST_OBJECT_ATTRIBUTE_VALUE_UPDATE ; req.setObject(theObject); req.setAHS(ahs); executeService(&req, &rep);}// ----------------------------------------------------------------------------voidRTIambassador::requestClassAttributeValueUpdate(ObjectClassHandle theClass, const AttributeHandleSet &attrs) throw (ObjectClassNotDefined, AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService) //CERTI{ throw UnimplementedService(); Message req, rep ; req.type = Message::REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE ; req.setObjectClass(theClass); req.setAHS(attrs); executeService(&req, &rep);}}// $Id: ObjectServices.cc,v 3.1 2003/07/04 12:00:58 breholee Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -