FederationManagement.hh

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 // CERTI - HLA RunTime Infrastructure
00003 // Copyright (C) 2002-2005  ONERA
00004 //
00005 // This file is part of CERTI
00006 //
00007 // CERTI is free software ; you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation ; either version 2 of the License, or
00010 // (at your option) any later version.
00011 //
00012 // CERTI is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY ; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with this program ; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00020 //
00021 // $Id: FederationManagement.hh,v 3.24 2008/06/10 13:41:44 rousse Exp $
00022 // ----------------------------------------------------------------------------
00023 
00024 #ifndef _CERTI_RTIA_FEDERATION_MANAGEMENT
00025 #define _CERTI_RTIA_FEDERATION_MANAGEMENT
00026 
00027 #include "certi.hh"
00028 #include "NetworkMessage.hh"
00029 #include "Communications.hh"
00030 #include "Statistics.hh"
00031 
00032 namespace certi {
00033 namespace rtia {
00034 
00035 class TimeManagement ;
00036 
00037 class FederationManagement
00038 {
00039 public:
00040   FederationManagement(Communications *, Statistics*);
00041     ~FederationManagement();
00042 
00043     void checkFederationSaving(void) throw (SaveInProgress);
00044     void checkFederationRestoring(void) throw (RestoreInProgress);
00045 
00046     // -- Create/Destroy --
00047     void createFederationExecution(std::string theName, TypeException &e)
00048          throw ( FederationExecutionAlreadyExists,
00049                  CouldNotOpenFED,ErrorReadingFED,
00050                  RTIinternalError);
00051     void destroyFederationExecution(std::string theName, TypeException &e);
00052 
00053     // -- Join/Resign --
00054     FederateHandle joinFederationExecution(std::string Federate,
00055                                            std::string Federation,
00056                                            TypeException &e);
00057 
00058     void resignFederationExecution(RTI::ResignAction action,
00059                                    TypeException &e);
00060 
00061     // Synchronization.
00062     void registerSynchronization(std::string label,
00063                                  std::string tag,
00064                                  TypeException &e);
00065     void registerSynchronization(std::string label,
00066                                  std::string tag,
00067                                  unsigned short array_size,
00068                                  std::vector <FederateHandle> &fed_array,
00069                                  TypeException &e);
00070     void unregisterSynchronization(std::string label,
00071                                    TypeException &e);
00072     void synchronizationPointRegistrationFailed(const char *label);
00073     void synchronizationPointRegistrationSucceeded(const char *label);
00074     void federationSynchronized(const char *label);
00075     void announceSynchronizationPoint(const char *label,
00076                                       const char *tag);
00077 
00078     // Saving.
00079     void requestFederationSave(std::string label, FederationTime the_time, TypeException &e);
00080     void requestFederationSave(std::string label, TypeException &e);
00081     void federateSaveBegun(TypeException &);
00082     void federateSaveStatus(bool, TypeException &);
00083     void initiateFederateSave(const char *label);
00084     void federationSavedStatus(bool);
00085 
00086     // Restoring.
00087     void requestFederationRestore(std::string label,
00088                                   TypeException &e);
00089     void federateRestoreStatus(bool status, TypeException &e);
00090     void requestFederationRestoreStatus(bool status,
00091                                         const char *label,
00092                                         const char *reason);
00093     void federationRestoreBegun(void);
00094     void initiateFederateRestore(const char *label,
00095                                  FederateHandle handle);
00096     void federationRestoredStatus(bool status);
00097 
00098     // Attributes
00099     TimeManagement *tm ;
00100     Handle _numero_federation ;
00101     FederateHandle federate ;
00102     bool _fin_execution ;
00103     std::string  _FEDid ;
00104 
00105 private:
00106     Communications *comm ;
00107     Statistics     *stat;
00108 
00109     bool _est_createur_federation ;
00110     bool _est_membre_federation ;
00111 
00112     bool savingState ;
00113     bool restoringState ;
00114 
00115     std::list<char *> synchronizationLabels ; 
00116 
00117     std::string _nom_federation ;
00118     std::string _nom_federe;
00119     
00120 };
00121 
00122 }} // namespace certi/rtia
00123 
00124 #endif // _CERTI_RTIA_FEDERATION_MANAGEMENT
00125 
00126 // $Id: FederationManagement.hh,v 3.24 2008/06/10 13:41:44 rousse Exp $

Generated on Thu Apr 30 15:53:48 2009 for CERTIDeveloperDocumentation by doxygen 1.5.5