MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
remoteAssistantInfoMgr.h
Go to the documentation of this file.
1 /****************************************************************************
2 * Copyright (c) 2017 VT MAK
3 * All rights reserved.
4 ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "rtiMsConfig.h"
13 #include "assistantMgr.h"
15 #include "assistantAppUtil.h"
16 
18 
20 class DtRtiAssistantPeer;
23 
24 typedef std::map< DtAssistantConnectionStruct, DtTime, cmpByConnectionId > DtAssistantPendingConnectionsWithTimeouts;
25 
26 
30 {
31  Q_OBJECT;
32 public:
33 
35  DtRemoteAssistantInfoMgr(DtBoost::shared_ptr<DtRtiAssistantServer> server,
36  DtBoost::shared_ptr<DtRtiAssistantPeer> peer, DtAssistantSignalRouter& signalRouter, DtBoost::shared_ptr<DtAssistantConnectionInfoMgr> connInfoMgr);
37 
39  virtual ~DtRemoteAssistantInfoMgr();
40 
42  virtual void initialize();
43  virtual void tick();
44 
46  static void processAssistantToAssistantConnectionMsg(const DtAssistantToAssistantConnectionMsg& msg, void* usr);
47  virtual void processAssistantToAssistantConnectionMsg(const DtAssistantToAssistantConnectionMsg& msg);
48  static void handleAssistantConnectionLost(const DtAssistantConnectionStruct& sock, void* usr);
49  virtual void handleAssistantConnectionLost(const DtAssistantConnectionStruct& sock);
50 signals:
51 
53  void assistantToAssistantConnectionAdded(const DtAssistantConnectionStruct&);
54 
56  void assistantToAssistantConnectionRemoved(const DtAssistantConnectionStruct&);
57 
58  void assistantToAssistantConnectionChanged(const DtAssistantConnectionStruct&, DtAssistantConnectionState);
59 
61  void queryAssistantInfo(const DtAssistantUuid&, DtAssistantInfo* infoIn);
62 
63 public slots:
64 
66  void processConnectionAdded(const DtAssistantConnectionStruct& conn);
67 
69  void processConnectionRemoved(const DtAssistantConnectionStruct& conn);
70 
72  void processConnectionConnect(const DtAssistantConnectionStruct& conn);
73  void processConnectionDisconnect(const DtAssistantConnectionStruct& conn);
74 
75  virtual void processAssistantFound(const DtAssistantInfo&);
76  virtual void processAssistantLost(const DtAssistantInfo&);
77  void assistantConnectionInfoUpdated(const DtAssistantConnectionStruct&, const DtAssistantConnectionStruct&);
78 protected:
79  void processTimeouts();
80  void processPendingSyns(const DtTime& now);
81  void processPendingSynAcks(const DtTime& now);
82  void processPendingAssistantInfos(const DtTime& now);
83  void processPendingFins(const DtTime& now);
84  void timeoutConnection(const DtAssistantConnectionStruct&, DtTime = 0.0);
85  void resetConnection(const DtAssistantConnectionStruct);
86  void handleSyn(const DtAssistantToAssistantConnectionMsg& msg);
87  void handleSynAck(const DtAssistantToAssistantConnectionMsg& msg);
88  void handleAck(const DtAssistantToAssistantConnectionMsg& msg);
89  void handleFin(const DtAssistantToAssistantConnectionMsg& msg);
90  void handleRst(const DtAssistantToAssistantConnectionMsg& msg);
91  void handleFinAck(const DtAssistantToAssistantConnectionMsg& msg);
92  bool isAlreadyConnected(const DtAssistantToAssistantConnectionMsg& msg, bool wanOnly = false) const;
93  bool allowConnections() const;
94  DtAssistantConnectionId newConnectionId() const;
95  void addAssistantConnection(const DtAssistantConnectionStruct& connection, bool remote);
96  void removeAssistantConnection(const DtAssistantConnectionStruct& connection);
97  void connectingAssistantConnection(const DtAssistantConnectionStruct& uuid, const DtAssistantConnectionId& otherConnId);
98  void disconnectingAssistantConnection(const DtAssistantConnectionStruct& uuid, DtAssistantConnectionState state = DtDisconnected);
99  void addPendingAssistantInfo(const DtAssistantConnectionStruct& conn);
100  virtual bool isConnecting(const DtAssistantConnectionStruct& conn) const;
101  DtBoost::shared_ptr<DtAssistantConnectionInfoMgr> myConnInfoMgr;
102 
104  MAKRti::DtClock myClock;
106  unsigned int myTimeout;
110  std::map< DtAssistantUuid, DtTime > myPendingAssistantInfos;
111  std::map< DtAssistantUuid, std::pair< DtAssistantConnectionStruct, DtAssistantConnectionId > > myAssistantUuidToConnectionMap;
112 
113 };
114 

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)