![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 2005 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: forwarderFaultManager.h,v $ $Revision: 1.4 $ $State: Exp $ 00007 *********************************************************************/ 00010 00011 #ifndef DtForwarderFaultManager_H_ 00012 #define DtForwarderFaultManager_H_ 00013 00014 #include "rtiMsConfig.h" 00015 #include <vector> 00016 #include <map> 00017 #include <vlutil/vlTime.h> 00018 00019 class DtConnectionMgr; 00020 class DtJoinMsg; 00021 class DtForwarderConnectionLostMsg; 00022 class DtForwarderPingMsg; 00023 00024 00030 class DT_DLL_EXEC DtForwarderFaultManager 00031 { 00032 private: 00034 DtForwarderFaultManager(); 00035 public: 00036 00038 DtForwarderFaultManager( DtConnectionMgr* connectMgr, 00039 MAKRti::DtTime heartbeatPeriod ); 00040 00042 virtual ~DtForwarderFaultManager(); 00043 00047 virtual void tick(); 00048 00049 public: 00050 00052 static void processJoin(const DtJoinMsg& msg, void* usr); 00053 00055 static void processConnectionLost(const DtForwarderConnectionLostMsg& msg, void* usr); 00056 00058 static void processPing(const DtForwarderPingMsg& msg, void* usr); 00059 00060 protected: 00061 00062 typedef std::vector< unsigned long > DtConnIdList; 00063 typedef std::map< unsigned long, DtConnIdList > DtForwarderIdToConnIdsMap; 00064 00065 protected: 00066 00069 virtual void processJoin(const DtJoinMsg& msg); 00070 00073 virtual void processConnectionLost(const DtForwarderConnectionLostMsg& msg); 00074 00077 virtual void processPing(const DtForwarderPingMsg& msg); 00078 00080 virtual void pingAllForwarders() const; 00081 00083 virtual void pingForwarder( unsigned long forwarderId ) const; 00084 00086 virtual void resignForwarder( unsigned long forwarderId ) const; 00087 00089 virtual void disconnectFederates( const DtConnIdList& federates ) const; 00090 00091 protected: 00092 00093 DtForwarderIdToConnIdsMap myForwarderToFederatesMap; 00094 DtConnectionMgr* myConnectMgr; 00095 MAKRti::DtClock myClock; 00096 MAKRti::DtTime myHeartbeatPeriod; 00097 MAKRti::DtTime myLastHeartbeat; 00098 }; 00099 00100 #endif //! DtForwarderFaultManager_H_