MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
assistantInfo.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: assistantInfo.h,v $ $Revision: 1.11 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef assistantInfo_H_
10 #define assistantInfo_H_
11 
14 
15 #include <rtiUtil.h>
16 #include "hostNameAddress.h"
17 #include "assistantMsg.h"
18 
20 class DtAssistantInfo;
22 
23 #define DtAssistantUuidNIL DtU128(0)
24 
25 typedef std::set< DtAssistantInfo > DtAssistantInfoSet;
26 
27 // If this type ever changes, DtAssistantToAssistantConnectionMsg must be changed as well
29 
31 typedef std::pair<MAKRti::DtInetAddr, MAKRti::DtInetAddr> DtPublicPrivateAddrPair;
32 
34 {
35  DtUDP = 0,
36  DtTCP = 1
37 };
40 {
41  // Hostname will be unknown until we get a message back
42  MAKRti::DtString hostName;
43  // Local address
44  MAKRti::DtInetAddr localDeviceAddress;
45  // Remote address is what the user inputs (IP address) TODO should this be DtString and inetAddr later?
46  MAKRti::DtInetAddr remoteAddress;
47  // 2nd Part of the remote endpoint. This port by default is the assistant port default (6003) and the user can change this
48  MAKRti::DtU32 port;
49  // TCP or UDP, default UDP.
51  // UUID is not displayed or initially known, but is used as a key when we get a message back
53 
54  // =D
56  // If you have to ask what these are, then you are better off not knowing
57  MAKRti::DtInetAddr advancedPublicAddressToUse;
58  MAKRti::DtU32 advancedPublicPortToUse;
59 };
63  {
64  return (DtU128)a.connectionId < (DtU128)b.connectionId;
65  }
67  {
68  return a.remoteAddress < b.remoteAddress;
69  }
70  else
71  {
72  return (DtU128)a.connectionId < (DtU128)b.connectionId;
73  }
74  }
75 };
78  return a.remoteAddress < b.remoteAddress;
79  }
80 };
81 struct cmpByUuid {
83  return a.uuid < b.uuid;
84  }
85 };
88  return a.connectionId < b.connectionId;
89  }
90 };
91 typedef std::set< DtAssistantConnectionStruct, cmpByPublicAddress > DtAssistantSetByAddresses;
92 typedef std::set< DtAssistantConnectionStruct, cmpByUuid > DtAssistantSetByUuid;
93 typedef std::set< DtAssistantConnectionStruct, cmpByConnectionIdThenPublicAddress > DtRemoteAssistantSet;
94 
97 {
98 public:
99 
101  DtAssistantInfo();
103 
104  // Dummy Constructor
105  DtAssistantInfo(const DtAssistantUuid& uuid);
106 
107  DtAssistantInfo(const DtAssistantInfo& other);
108  DtAssistantInfo(DtAssistantUuid uuid, int id, const MAKRti::DtString& host, const MAKRti::DtInetAddr& addr,
109  const DtInetAddr& publicAddr,
110  const DtInetAddrSet& networkInterfaces, const MAKRti::DtInetAddr& localInterface,
111  bool isForeign = false);
112  DtAssistantInfo(DtAssistantUuid uuid, int id, const DtHostNameAddress& host,
113  const DtInetAddr& publicAddr,
114  const DtInetAddrSet& networkInterfaces, const MAKRti::DtInetAddr& interfaceAddr,
115  bool isForeign = false );
117 
119  ~DtAssistantInfo();
120 
122  DtAssistantInfo& operator=(const DtAssistantInfo& other);
123 
125  bool operator<(const DtAssistantInfo& other) const;
126 
128  bool operator==(const DtAssistantInfo& other) const;
129 
131  bool operator!=(const DtAssistantInfo& other) const;
132 
134  DtHostNameAddress host() const;
135 
137  void setHost( const DtHostNameAddress& host );
138 
140  const MAKRti::DtString& hostName() const;
141 
143  void setHostName( const MAKRti::DtString& name );
144 
146  const MAKRti::DtInetAddr& address() const;
147 
149  void setAddress( const MAKRti::DtInetAddr& addr );
150 
152  const MAKRti::DtInetAddr& publicAddress() const;
153 
155  void setPublicAddress(const MAKRti::DtInetAddr& addr);
156 
158  const DtInetAddrSet& networkInterfaces() const;
159 
161  void setNetworkInterfaces(const DtInetAddrSet& addresses);
162 
164  const MAKRti::DtInetAddr& localInterface() const;
165 
167  void setLocalInterface( const MAKRti::DtInetAddr& interfaceAddr );
168 
170  void setIsForeign(bool isForeignValue);
171 
173  bool isForeign() const;
174 
175  void setUuid(const DtAssistantUuid& uuid);
176  const DtAssistantUuid& uuid() const;
177 
179  void setIsConnected(bool isConnectedValue);
180 
182  bool isConnected() const;
183 
186  int id() const;
187 
190  void setId( int id );
191 
194  DtAssistantInfoSet::const_iterator findMatchingHostInfo( const DtAssistantInfoSet& set );
195 
197  void removeMatchingHostName( DtAssistantInfoSet& sourceSet );
198 
200  bool isThisAssistant() const;
201 
203  bool isValid() const;
204 
206  static void setThisAssistantId( int id );
207 
212  static int collectMatching( const DtRtiConnectionInfo& connection,
213  const DtAssistantInfoSet& sourceSet, DtAssistantInfoSet& matchSet );
214 
218  static int collectMatching( const DtString& hostName, const DtInetAddr& address,
219  const DtAssistantInfoSet& sourceSet, DtAssistantInfoSet& matchSet );
220 
221 protected:
222 
225 
227  MAKRti::DtInetAddr myPublicAddr;
228 
231 
233  MAKRti::DtInetAddr myLocalInterface;
234 
236  int myId;
237 
240 
243 
244  // The following are used by the rtiAssistant for GUI purposes
246 
248 
250 
253 
254 public:
255 
257 
259 };
260 
261 #endif // assistantInfo_H_
262 
int myRemoteAssistantPort
Definition: assistantInfo.h:249
Definition: assistantInfo.h:36
DtAssistantUuid uuid
Definition: assistantInfo.h:52
MAKRti::DtInetAddr remoteAddress
Definition: assistantInfo.h:46
DtAssistantUuid myUuid
Definition: assistantInfo.h:245
DtUuid DtAssistantUuid
Definition: assistantUtil.h:17
MAKRti::DtNetU128 DtUuid
Definition: assistantUtil.h:16
Definition: assistantInfo.h:35
MAKRti::DtU32 advancedPublicPortToUse
Definition: assistantInfo.h:58
#define DtAssistantUuidNIL
Definition: assistantInfo.h:23
static int theIdOfThisAssistant
The ID of this assistant. Must be set with setThisAssistantInfo().
Definition: assistantInfo.h:252
DtHostNameAddress myHost
Host on which the assistant is running.
Definition: assistantInfo.h:224
bool myIsConnected
Is the assistant connected.
Definition: assistantInfo.h:242
static const DtAssistantInfo DtDefaultAssistantInfo
Definition: assistantInfo.h:256
std::set< DtAssistantInfo > DtAssistantInfoSet
Definition: assistantInfo.h:25
bool operator()(const DtAssistantConnectionStruct &a, const DtAssistantConnectionStruct &b) const
Definition: assistantInfo.h:61
Stores basic information about a remote assistant.
Definition: assistantInfo.h:96
Structure Remote Assistant to be displayed.
Definition: assistantInfo.h:39
std::set< DtAssistantConnectionStruct, cmpByPublicAddress > DtAssistantSetByAddresses
Definition: assistantInfo.h:91
std::set< DtAssistantConnectionStruct, cmpByUuid > DtAssistantSetByUuid
Definition: assistantInfo.h:92
DtInetAddrSet myNetworkInterfaces
Network interfaces on the assistant host.
Definition: assistantInfo.h:230
Definition: assistantInfo.h:81
MAKRti::DtInetAddr advancedPublicAddressToUse
Definition: assistantInfo.h:57
Definition: assistantInfo.h:60
MAKRti::DtString hostName
Definition: assistantInfo.h:42
bool operator()(const DtAssistantConnectionStruct &a, const DtAssistantConnectionStruct &b) const
Definition: assistantInfo.h:82
Definition: assistantInfo.h:76
#define DT_DLL_ASSISTANT
Default – Unix or Win32 static.
Definition: rtiMsConfig.h:150
int myId
ID used to distinguish between assistants running on the same machine.
Definition: assistantInfo.h:236
DtAssistantConnectionType connectionType
Definition: assistantInfo.h:50
DtHostNameAddress stores information on a host, input as either hostname, IP address, or both.
Definition: hostNameAddress.h:23
const int DtAssistantAnyId
Definition: assistantInfo.h:30
static const DtAssistantUuid DtInvalidAssistantInfo
Definition: assistantInfo.h:258
std::pair< MAKRti::DtInetAddr, MAKRti::DtInetAddr > DtPublicPrivateAddrPair
Definition: assistantInfo.h:31
DT_DLL_RTIUTIL typedef std::set< MAKRti::DtInetAddr > DtInetAddrSet
Definition: rtiUtil.h:506
MAKRti::DtInetAddr myPublicAddr
Public address of remote host (WAN). This is the same as the address in myHost when detected on a loc...
Definition: assistantInfo.h:227
DtAssistantConnectionType
Definition: assistantInfo.h:33
bool myIsForeign
Does the executing assistant consider this assistant to be foreign (running across WAN) ...
Definition: assistantInfo.h:239
MAKRti::DtInetAddr localDeviceAddress
Definition: assistantInfo.h:44
#define DtASSISTANT_DEFAULT_DEST_ID
Definition: assistantMsg.h:33
MAKRti::DtInetAddr myLocalInterface
Address of local interface to remote host.
Definition: assistantInfo.h:233
Definition: assistantInfo.h:86
bool operator()(const DtAssistantConnectionStruct &a, const DtAssistantConnectionStruct &b) const
Definition: assistantInfo.h:87
DtAssistantConnectionType myConnectionType
Definition: assistantInfo.h:247
DtUuid DtAssistantConnectionId
Definition: assistantInfo.h:28
bool operator()(const DtAssistantConnectionStruct &a, const DtAssistantConnectionStruct &b) const
Definition: assistantInfo.h:77
std::set< DtAssistantConnectionStruct, cmpByConnectionIdThenPublicAddress > DtRemoteAssistantSet
Definition: assistantInfo.h:93
Stores the information on an RTI connection known by the Assistant.
Definition: assistantConnectionInfo.h:36
MAKRti::DtU32 port
Definition: assistantInfo.h:48
DtAssistantConnectionId connectionId
Definition: assistantInfo.h:55

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)