📄 rtiambassador.hh
字号:
// -*- mode:C++ ; tab-width:4 ; c-basic-offset:4 ; indent-tabs-mode:nil -*-// ----------------------------------------------------------------------------// 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: RTIambassador.hh,v 3.9 2003/03/12 10:02:38 breholee Exp $// ----------------------------------------------------------------------------#ifndef _CERTI_RTI_AMBASSADOR_HH#define _CERTI_RTI_AMBASSADOR_HH#include <csignal>#include <iostream>using std::cout ;using std::cerr ;using std::endl ;#include <sys/types.h>#include <unistd.h>#include <stdlib.h>#include <cstring>#include <assert.h>#include "fedtime.hh"#include "SocketUN.hh"namespace certi {class FederateAmbassador ;class RootObject ;class Message ;class CAttributeHandleValuePairSet ;class AttributeHandleSet ;/*! This class is used by applications for calls to RTI. RTIambassador is separated into two parts. This part uses an UNIX socket for sending and receiving data to/from rtia.*/class RTIambassador : private SocketUN{public: RTIambassador(void) throw (MemoryExhausted, RTIinternalError); ~RTIambassador(void); // Data Integrity void objectToString(const char *char_initial, ULong taille, char *char_final); void getObjectToStringLength(char *char_initial, ULong taille_initiale, ULong& taille); // Federation Management ------------------------------------------------- void createFederationExecution(const char *executionName, const char *FED) throw (FederationExecutionAlreadyExists, ConcurrentAccessAttempted, CouldNotOpenFED, ErrorReadingFED, SaveInProgress, RestoreInProgress, RTIinternalError); void destroyFederationExecution(const char *executionName) throw (FederatesCurrentlyJoined, FederationExecutionDoesNotExist, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError); FederateHandle joinFederationExecution(const char *yourName, const char *executionName, FederateAmbassadorPtr federateAmbassadorReference) throw (FederateAlreadyExecutionMember, FederationExecutionDoesNotExist, CouldNotOpenRID, //CERTI ErrorReadingRID, //CERTI CouldNotOpenFED, //not implemented ErrorReadingFED, //not implemented ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError); void resignFederationExecution(ResignAction theAction) throw (FederateOwnsAttributes, FederateNotExecutionMember, InvalidResignAction, ConcurrentAccessAttempted, RTIinternalError); void registerFederationSynchronizationPoint(const char *label, const char *theTag) throw ( FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError); void registerFederationSynchronizationPoint(const char *label, const char *theTag, const FederateHandleSet& syncSet) throw (FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError, UnimplementedService); //CERTI void synchronizationPointAchieved(const char *label) throw (SynchronizationPointLabelWasNotAnnounced, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress, RTIinternalError); void requestFederationSave(const char *label, const FedTime& theTime) throw (FederationTimeAlreadyPassed, InvalidFederationTime, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void requestFederationSave(const char *label) throw (FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void federateSaveBegun() throw (SaveNotInitiated, FederateNotExecutionMember, ConcurrentAccessAttempted, RestoreInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void federateSaveComplete() throw (SaveNotInitiated, FederateNotExecutionMember, ConcurrentAccessAttempted, RestoreInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void federateSaveNotComplete() throw (SaveNotInitiated, FederateNotExecutionMember, ConcurrentAccessAttempted, RestoreInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void requestFederationRestore(const char *label) throw (SpecifiedSaveLabelDoesNotExist, //CERTI FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void federateRestoreComplete() throw (UnknownLabel, RestoreNotRequested, RTICannotRestore, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI void federateRestoreNotComplete() throw (UnknownLabel, RestoreNotRequested, FederateNotExecutionMember, RTICannotRestore, ConcurrentAccessAttempted, SaveInProgress, //not implemented RTIinternalError, UnimplementedService); //CERTI // Declaration Management ------------------------------------------------ void publishObjectClass(ObjectClassHandle theClass, const AttributeHandleSet& attributeList) throw (ObjectClassNotDefined, AttributeNotDefined, OwnershipAcquisitionPending, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemeted RestoreInProgress, //not implemented SecurityError, //CERTI RTIinternalError); void unpublishObjectClass(ObjectClassHandle theClass) throw (ObjectClassNotDefined, ObjectClassNotPublished, //not implemented OwnershipAcquisitionPending, //not implemented FederateOwnsAttributes, //CERTI FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemeted RestoreInProgress, //not implemented SecurityError, //CERTI RTIinternalError); void publishInteractionClass(InteractionClassHandle theInteraction) throw (InteractionClassNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented SecurityError, //RTI RTIinternalError); void unpublishInteractionClass(InteractionClassHandle theInteraction) throw (InteractionClassNotDefined, InteractionClassNotPublished, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented SecurityError, //RTI RTIinternalError); void subscribeObjectClassAttributes(ObjectClassHandle theClass, const AttributeHandleSet& attributeList, Boolean active = RTI_TRUE) throw (ObjectClassNotDefined, AttributeNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented SecurityError, //RTI RTIinternalError); void unsubscribeObjectClass(ObjectClassHandle theClass) throw (ObjectClassNotDefined, ObjectClassNotSubscribed, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented SecurityError, //RTI RTIinternalError); void subscribeInteractionClass(InteractionClassHandle theClass, Boolean active = RTI_TRUE) throw (InteractionClassNotDefined, FederateNotExecutionMember, ConcurrentAccessAttempted, FederateLoggingServiceCalls, //not implemented SaveInProgress, //not implemented RestoreInProgress, //not implemented SecurityError, //RTI RTIinternalError); void unsubscribeInteractionClass(InteractionClassHandle theClass) throw (InteractionClassNotDefined, InteractionClassNotSubscribed, //not implemented FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented RestoreInProgress, //not implemented SecurityError, //RTI RTIinternalError); // Object Management ----------------------------------------------------- ObjectHandle registerObjectInstance(ObjectClassHandle theClass, const char *theObjectName) throw (ObjectClassNotDefined, ObjectClassNotPublished, InvalidObjectHandle, //RTI ObjectAlreadyRegistered, FederateNotExecutionMember, ConcurrentAccessAttempted, SaveInProgress, //not implemented
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -