📄 supportservices.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: SupportServices.cc,v 3.3 2003/10/27 10:42:47 breholee Exp $// ----------------------------------------------------------------------------#include "RTIambassador.hh"#include <config.h>#include "Message.hh"#include <iostream>using std::endl ;namespace certi {static pdCDebug D("LIBRTI_SUPPORT", __FILE__);// ===========================================================================// RTI SUPPORT SERVICES// ===========================================================================// ----------------------------------------------------------------------------/** Get object class handle \param theName Name of the object class */ObjectClassHandleRTIambassador::getObjectClassHandle(const char *theName) throw (NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_OBJECT_CLASS_HANDLE ; req.setName(theName); executeService(&req, &rep); return rep.getObjectClass();}// ----------------------------------------------------------------------------/** Get object class name. \param handle Handle of the object class \return The class name associated with the handle, memory has to be freed by the caller.*/char *RTIambassador::getObjectClassName(ObjectClassHandle handle) throw (ObjectClassNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_OBJECT_CLASS_NAME ; req.setObjectClass(handle); executeService(&req, &rep); return strdup(rep.getName());}// ----------------------------------------------------------------------------/** Get attribute handle. \param theName Name of the attribute \param whichClass Handle of the attribute's class */AttributeHandleRTIambassador::getAttributeHandle(const char *theName, ObjectClassHandle whichClass) throw (ObjectClassNotDefined, NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_ATTRIBUTE_HANDLE ; req.setName(theName); req.setObjectClass(whichClass); executeService(&req, &rep); return rep.getAttribute();}// ----------------------------------------------------------------------------/** Get attribute name. \param theHandle Handle of the attribute \param whichClass Handle of the attribute's class */char *RTIambassador::getAttributeName(AttributeHandle theHandle, ObjectClassHandle whichClass) throw (ObjectClassNotDefined, AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_ATTRIBUTE_NAME ; req.setAttribute(theHandle); req.setObjectClass(whichClass); executeService(&req, &rep); return strdup(rep.getName());}// ----------------------------------------------------------------------------// Get Interaction Class HandleInteractionClassHandleRTIambassador::getInteractionClassHandle(const char *theName) throw (NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_INTERACTION_CLASS_HANDLE ; req.setName(theName); executeService(&req, &rep); return rep.getInteractionClass();}// ----------------------------------------------------------------------------// Get Interaction Class Namechar *RTIambassador::getInteractionClassName(InteractionClassHandle theHandle) throw (InteractionClassNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_INTERACTION_CLASS_NAME ; req.setInteractionClass(theHandle); executeService(&req, &rep); return strdup(rep.getName());}// ----------------------------------------------------------------------------// Get Parameter HandleParameterHandleRTIambassador::getParameterHandle(const char *theName, InteractionClassHandle whichClass) throw (InteractionClassNotDefined, NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_PARAMETER_HANDLE ; req.setName(theName); req.setInteractionClass(whichClass); executeService(&req, &rep); return rep.getParameter();}// ----------------------------------------------------------------------------// Get Parameter Namechar *RTIambassador::getParameterName(ParameterHandle theHandle, InteractionClassHandle whichClass) throw (InteractionClassNotDefined, InteractionParameterNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_PARAMETER_NAME ; req.setParameter(theHandle); req.setInteractionClass(whichClass); executeService(&req, &rep); return strdup(rep.getName());}// ----------------------------------------------------------------------------// Get Object Instance HandleObjectHandleRTIambassador::getObjectInstanceHandle(const char *theName) throw (ObjectNotKnown, NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError, UnimplementedService){ Message req, rep ; req.type = Message::GET_OBJECT_INSTANCE_HANDLE ; req.setName(theName); executeService(&req, &rep); return rep.getObject();}// ----------------------------------------------------------------------------// Get Object Instance Namechar *RTIambassador::getObjectInstanceName(ObjectHandle theHandle) throw (ObjectNotKnown, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError, UnimplementedService){ Message req, rep ; req.type = Message::GET_OBJECT_INSTANCE_NAME ; req.setObject(theHandle); executeService(&req, &rep); return strdup(rep.getName());}// ----------------------------------------------------------------------------/** Get routing space handle \param rs_name Name of the routing space */SpaceHandleRTIambassador::getRoutingSpaceHandle(const char *rs_name) throw (NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ D[pdDebug] << "Get routing space handle: " << rs_name << endl ; Message req, rep ; req.type = Message::GET_SPACE_HANDLE ; req.setName(rs_name); executeService(&req, &rep); return rep.getSpace();}// ----------------------------------------------------------------------------/** Get routing space name \param handle Handle of the routing space */char *RTIambassador::getRoutingSpaceName(SpaceHandle handle) throw (SpaceNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ; req.type = Message::GET_SPACE_NAME ; req.setSpace(handle); executeService(&req, &rep); return strdup(rep.getName());}// ----------------------------------------------------------------------------/** Get dimension handle \parameter dimension Name of the dimension \parameter space The dimension's routing space handle */DimensionHandleRTIambassador::getDimensionHandle(const char *dimension, SpaceHandle space) throw (SpaceNotDefined, NameNotFound, FederateNotExecutionMember, ConcurrentAccessAttempted, RTIinternalError){ Message req, rep ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -