📄 federation.hh
字号:
// ----------------------------------------------------------------------------// CERTI - HLA RunTime Infrastructure// Copyright (C) 2002, 2003, 2004 ONERA//// This file is part of CERTI//// CERTI is free software ; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation ; either version 2 of the License, or// (at your option) any later version.//// CERTI 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 General Public License for more details.//// You should have received a copy of the GNU 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: Federation.hh,v 3.28 2004/03/04 20:19:05 breholee Exp $// ----------------------------------------------------------------------------#ifndef _CERTI_RTIG_FEDERATION_HH#define _CERTI_RTIG_FEDERATION_HH#include "Federate.hh"#include "RootObject.hh"#include "LBTS.hh"#include "SecurityServer.hh"#include "HandleManager.hh"#include "RTItypes.hh"#ifdef FEDERATION_USES_MULTICAST#include "SocketMC.hh"#endif// Libraries#ifdef HAVE_XML#include <libxml/xmlmemory.h> // FIXME: should be in the .cc#include <libxml/parser.h>#include <libxml/tree.h>#endif // HAVE_XMLnamespace certi {namespace rtig {class Federation : private std::list<Federate *>{ // ATTRIBUTES --------------------------------------------------------------private: Handle handle ; char *name ; //! Labels and Tags not on synchronization. std::map<const char *, const char *> synchronizationLabels ; HandleManager<FederateHandle> federateHandles ; HandleManager<ObjectHandle> objectHandles ; // This object is initialized when the Federation is created, with // the reference of the RTIG managed Socket Server. The reference of // this object is passed down the Classes Tree with the help of RootObj. SecurityServer *server ; RootObject *root ; LBTS regulators ;#ifdef FEDERATION_USES_MULTICAST SocketMC *MCLink ;#endif bool saveXmlData(); bool restoreXmlData(); // METHODS -----------------------------------------------------------------public:#ifdef FEDERATION_USES_MULTICAST Federation(const char *, FederationHandle, SocketServer*, AuditFile*, SocketMC*)#else Federation(const char *, Handle, SocketServer*, AuditFile*)#endif throw (CouldNotOpenRID, ErrorReadingRID, MemoryExhausted, SecurityError, RTIinternalError); ~Federation(); int getNbFederates() const ; int getNbRegulators() const ; bool isSynchronizing() const ; Handle getHandle() const ; const char *getName() const ; // ------------------------- // -- Federate Management -- // ------------------------- FederateHandle add(const char *theName, SocketTCP *theTCPLink) throw (FederateAlreadyExecutionMember, MemoryExhausted, RTIinternalError); bool empty() const throw (FederatesCurrentlyJoined); bool check(FederateHandle theHandle) const throw (FederateNotExecutionMember); void kill(FederateHandle theFederate) throw (); void remove(FederateHandle theHandle) throw (FederateOwnsAttributes, FederateNotExecutionMember); // --------------------- // -- Time Management -- // --------------------- void addRegulator(FederateHandle theHandle, FederationTime theTime) throw (FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError); // includes Time Regulation already enabled. void updateRegulator(FederateHandle theHandle, FederationTime theTime) throw (FederateNotExecutionMember, RTIinternalError); void removeRegulator(FederateHandle theHandle) throw (FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError); // includes Time Regulation already disabled. void addConstrained(FederateHandle theHandle) throw (FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError); // includes Time constrained already enabled. void removeConstrained(FederateHandle theHandle) throw (FederateNotExecutionMember, SaveInProgress, RestoreInProgress, RTIinternalError); // includes Time constrained already disabled. // Synchronization Management. void registerSynchronization(FederateHandle the_federate, const char *the_label, const char *the_tag) throw (FederateNotExecutionMember, FederationAlreadyPaused, SaveInProgress, RestoreInProgress, RTIinternalError); void unregisterSynchronization(FederateHandle theFederate, const char *theLabel) throw (FederateNotExecutionMember, FederationNotPaused, SaveInProgress, RestoreInProgress, RTIinternalError); void broadcastSynchronization(FederateHandle federate, const char *label, const char *tag) throw (RTIinternalError); // Save Management. void requestFederationSave(FederateHandle, const char *, FederationTime) throw (FederateNotExecutionMember, SaveInProgress); void federateSaveBegun(FederateHandle) throw (FederateNotExecutionMember); void federateSaveStatus(FederateHandle, bool) throw (FederateNotExecutionMember); void requestFederationRestore(FederateHandle the_federate, const char *the_label) throw (FederateNotExecutionMember); void federateRestoreStatus(FederateHandle the_federate, bool the_status) throw (FederateNotExecutionMember); // ----------------------- // -- Object Management -- // ----------------------- void deleteObject(FederateHandle theFederateHandle, ObjectHandle theObjectHandle, const char *theUserTag) throw (FederateNotExecutionMember, DeletePrivilegeNotHeld, ObjectNotKnown, SaveInProgress, RestoreInProgress, RTIinternalError); void publishObject(FederateHandle theFederateHandle, ObjectClassHandle theObjectHandle, AttributeHandle *theAttributeList, UShort theListSize, bool PubOrUnpub) throw (ObjectClassNotDefined, AttributeNotDefined, FederateNotExecutionMember, SaveInProgress, SecurityError, RestoreInProgress, RTIinternalError); ObjectHandle registerObject(FederateHandle theFederateHandle, ObjectClassHandle theClass, const char *theName) throw (FederateNotExecutionMember, FederateNotPublishing, ObjectAlreadyRegistered, ObjectClassNotDefined, ObjectClassNotPublished, SaveInProgress, RestoreInProgress, RTIinternalError); void subscribeObject(FederateHandle theFederateHandle, ObjectClassHandle theObjectHandle, AttributeHandle *theAttributeList, UShort theListSize, bool SubOrUnSub) throw (ObjectClassNotDefined, AttributeNotDefined, FederateNotExecutionMember, SaveInProgress, SecurityError, RestoreInProgress, RTIinternalError); void updateAttributeValues(FederateHandle theFederateHandle, ObjectHandle theObjectHandle, AttributeHandle *theAttributeList, AttributeValue *theValueList, UShort theListSize, FederationTime theTime, const char *theTag) throw (FederateNotExecutionMember, ObjectNotKnown, AttributeNotDefined, AttributeNotOwned, SaveInProgress, RestoreInProgress, RTIinternalError);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -