00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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
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
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
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
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
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 }}
00123
00124 #endif // _CERTI_RTIA_FEDERATION_MANAGEMENT
00125
00126