MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
forwarderInfo.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: forwarderInfo.h,v $ $Revision: 1.3 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DtForwarderInfo_H_
13 #define DtForwarderInfo_H_
14 
15 #include <rtiMsConfig.h>
16 #include <map>
17 #include <vlutil/vlString.h>
18 #include <vlutil/vlInetAddr.h>
19 #include <rtiVersion.h>
21 #include <vlutil/vlSmartPointers.h>
22 
25 {
26 public:
27 
30  DtAssistantNetworkCompInfo(const MAKRti::DtString& name);
32 
34  virtual ~DtAssistantNetworkCompInfo();
35 
37  virtual DtAssistantNetworkCompInfo& operator=(const DtAssistantNetworkCompInfo& other);
38  virtual bool operator==(const DtAssistantNetworkCompInfo& other) const;
39  virtual bool operator!=(const DtAssistantNetworkCompInfo& other) const;
40 
42 
43  MAKRti::DtString name() const { return myName; }
44  void setName(const MAKRti::DtString& n) { myName = n; }
45 
46  MAKRti::DtInetAddr address() const { return myAddress; }
47  void setAddress(const MAKRti::DtInetAddr& a) { myAddress = a; }
48 
49  MAKRti::DtInetAddr privateAddress() const { return myPrivateAddress; }
50  void setPrivateAddress(const MAKRti::DtInetAddr& a) { myPrivateAddress = a; }
51 
52  MAKRti::DtString hostName() const { return myHostName; }
53  void setHostName(const MAKRti::DtString& n) { myHostName = n; }
54 
55  int port() const { return myPort; }
56  void setPort(int p) { myPort = p; }
57 
58  MAKRti::DtString hostPort() const {return myHostName + ":" + MAKRti::DtString(myPort);}
59 
60  MAKRti::DtString processName() const { return myProcessName; }
61  void setProcessName(const MAKRti::DtString& n) { myProcessName = n; }
62 
63  MAKRti::DtString typeName() const { return myTypeName; }
64  void setTypeName(const MAKRti::DtString& n) { myTypeName = n; }
65 
66  MAKRti::DtString commandArgs() const { return myCommandArgs; }
67  void setCommandArgs(const MAKRti::DtString& a) { myCommandArgs = a; }
68 
69  MAKRti::DtString pid() const { return myPid; }
70  void setPid(const MAKRti::DtString& p) { myPid = p; }
71 
72  MAKRti::DtString federationName() const { return myFederationName; }
73  void setFederationName(const MAKRti::DtString& h) { myFederationName = h; }
74 
75  int federateHandle() const { return myFederateHandle; }
76  void setFederateHandle(int h) { myFederateHandle = h; }
77 
78  unsigned connectionId() const { return myConnId; }
79  void setConnectionId(unsigned i) { myConnId = i; }
80 
81  int queueStatus() const { return myQueueStatus; }
82  void setQueueStatus(int q) { myQueueStatus = q; }
83 
84  DtHlaVersionId hlaVersion() const { return myHlaVersion; }
85  void setHlaVersion(DtHlaVersionId v) { myHlaVersion = v; }
86 
87  DtAssistantMsgFederateStatus federateStatus() const { return myFederateStatus; }
88  void setFederateStatus(DtAssistantMsgFederateStatus v) { myFederateStatus = v; }
89 
90 
92 
95  bool isValid() const { return !myAddress.isAnyAddr(); }
96 
99  bool isDropped() const;
100 
101 protected:
102 
103  MAKRti::DtString myName;
104  MAKRti::DtInetAddr myAddress;
105  MAKRti::DtInetAddr myPrivateAddress;
106  MAKRti::DtString myHostName;
107  MAKRti::DtString myProcessName;
108  MAKRti::DtString myTypeName;
109  MAKRti::DtString myCommandArgs;
110  MAKRti::DtString myPid;
111  MAKRti::DtString myFederationName;
112  int myPort;
114  unsigned myConnId;
118 };
119 
120 typedef std::list<DtAssistantNetworkCompInfo> DtAssistantNetworkCompInfoList;
121 
124 {
125 
126 public:
127 
129  DtAssistantForwarderInfo(bool isLocal);
130 
133 
135  DtAssistantForwarderInfo & operator = ( const DtAssistantForwarderInfo & rhs );
136  bool operator!=( const DtAssistantForwarderInfo & other ) const;
137  bool operator==( const DtAssistantForwarderInfo & other ) const;
138 
140  void updateFromStateMsg(const DtAssistantForwarderStateMsg& msg);
141 
144  const DtAssistantMsg* lastStateMsg() const { return myLastStateMessage.get(); }
145 
147 
148  typedef std::pair<MAKRti::DtString, int> DtFedexNameFedHdlPair;
149  typedef std::map<DtFedexNameFedHdlPair, DtAssistantNetworkCompInfo> DtCompByFederationAndHandleMap;
150  // TODO figure out why this typedef for Forwarders uses DtAssistantNetworkCompInfo instead of DtAssistantForwarderInfo
151  typedef std::map<DtInetAddrAndPort, DtAssistantNetworkCompInfo> DtPeerForwarderByAddrMap;
153 
155 
156  MAKRti::DtInetAddr address() const { return myAddr; }
157  int port() const { return myPort; }
158  MAKRti::DtString name() const;
159  MAKRti::DtString hostName() const;
160  const DtPeerForwarderByAddrMap* peerForwarders() const { return &myPeerForwarders; }
161  const DtAssistantNetworkCompInfo* rtiexecInfo() const { return &myRtiexec; }
162  const DtAssistantNetworkCompInfo* federateInfo(
163  const MAKRti::DtString& federation, int handle) const;
164  const DtCompByFederationAndHandleMap* federates() const { return &myFederateConns; }
165  const DtAssistantNetworkCompInfoList* unclassifiedConns() const { return &myUnclassifiedConns; }
166  const DtAssistantNetworkCompInfo* unclassifiedConnInfo(
167  unsigned connId ) const;
168  bool isDropped();
170 
171 protected:
172 
174  MAKRti::DtInetAddr myAddr;
175 
177  int myPort;
178 
180  MAKRti::DtString myName;
181 
183  MAKRti::DtString myHostName;
184 
187 
190 
194 
197  std::list<DtAssistantNetworkCompInfo> myUnclassifiedConns;
198 
200  bool myIsLocal;
201 
203  DtBoost::shared_ptr<DtAssistantMsg> myLastStateMessage;
204 };
205 
206 
207 #endif
int queueStatus() const
Methods to get and set network component information.
Definition: forwarderInfo.h:81
void setTypeName(const MAKRti::DtString &n)
Methods to get and set network component information.
Definition: forwarderInfo.h:64
void setProcessName(const MAKRti::DtString &n)
Methods to get and set network component information.
Definition: forwarderInfo.h:61
MAKRti::DtString myHostName
Host name of this forwarder.
Definition: forwarderInfo.h:183
MAKRti::DtString hostPort() const
Methods to get and set network component information.
Definition: forwarderInfo.h:58
int myPort
Forwarder port for this forwarder.
Definition: forwarderInfo.h:177
MAKRti::DtInetAddr address() const
Methods to get forwarder information.
Definition: forwarderInfo.h:156
MAKRti::DtString myTypeName
Definition: forwarderInfo.h:108
bool myIsLocal
Whether or not this forwarder is local to this assistant.
Definition: forwarderInfo.h:200
std::map< DtInetAddrAndPort, DtAssistantNetworkCompInfo > DtPeerForwarderByAddrMap
Typedefs for information storage.
Definition: forwarderInfo.h:151
MAKRti::DtString processName() const
Methods to get and set network component information.
Definition: forwarderInfo.h:60
MAKRti::DtString myPid
Definition: forwarderInfo.h:110
void setHlaVersion(DtHlaVersionId v)
Methods to get and set network component information.
Definition: forwarderInfo.h:85
DtAssistantMsgFederateStatus myFederateStatus
Definition: forwarderInfo.h:117
MAKRti::DtInetAddr myAddress
Definition: forwarderInfo.h:104
MAKRti::DtInetAddr address() const
Methods to get and set network component information.
Definition: forwarderInfo.h:46
This file contains the declaration of DtAssistantForwarderStateMsg.
MAKRti::DtString pid() const
Methods to get and set network component information.
Definition: forwarderInfo.h:69
void setCommandArgs(const MAKRti::DtString &a)
Methods to get and set network component information.
Definition: forwarderInfo.h:67
Base class for assistant Messages.
Definition: assistantMsg.h:152
DtHlaVersionId
Definition: rtiVersion.h:42
void setFederationName(const MAKRti::DtString &h)
Methods to get and set network component information.
Definition: forwarderInfo.h:73
MAKRti::DtString commandArgs() const
Methods to get and set network component information.
Definition: forwarderInfo.h:66
int myFederateHandle
Definition: forwarderInfo.h:113
MAKRti::DtInetAddr myPrivateAddress
Definition: forwarderInfo.h:105
int myQueueStatus
Definition: forwarderInfo.h:115
DtHlaVersionId hlaVersion() const
Methods to get and set network component information.
Definition: forwarderInfo.h:84
MAKRti::DtString myFederationName
Definition: forwarderInfo.h:111
Stores information on a single component connected to a forwarder.
Definition: forwarderInfo.h:24
MAKRti::DtString myHostName
Definition: forwarderInfo.h:106
void setPrivateAddress(const MAKRti::DtInetAddr &a)
Methods to get and set network component information.
Definition: forwarderInfo.h:50
unsigned myConnId
Definition: forwarderInfo.h:114
int port() const
Methods to get and set network component information.
Definition: forwarderInfo.h:55
MAKRti::DtString hostName() const
Methods to get and set network component information.
Definition: forwarderInfo.h:52
unsigned connectionId() const
Methods to get and set network component information.
Definition: forwarderInfo.h:78
DtPeerForwarderByAddrMap myPeerForwarders
Map of forwarder addr&amp;port to connected peer forwarder info.
Definition: forwarderInfo.h:186
void setQueueStatus(int q)
Methods to get and set network component information.
Definition: forwarderInfo.h:82
MAKRti::DtString myProcessName
Definition: forwarderInfo.h:107
const DtPeerForwarderByAddrMap * peerForwarders() const
Methods to get forwarder information.
Definition: forwarderInfo.h:160
void setAddress(const MAKRti::DtInetAddr &a)
Methods to get and set network component information.
Definition: forwarderInfo.h:47
std::pair< MAKRti::DtString, int > DtFedexNameFedHdlPair
Typedefs for information storage.
Definition: forwarderInfo.h:148
std::map< DtFedexNameFedHdlPair, DtAssistantNetworkCompInfo > DtCompByFederationAndHandleMap
Typedefs for information storage.
Definition: forwarderInfo.h:149
MAKRti::DtInetAddr myAddr
Address of this forwarder.
Definition: forwarderInfo.h:174
The DtAssistantForwarderStateMsg defines a wrapper for the RTI Assistant forwarder state message sent...
Definition: assistantForwarderStateMsg.h:31
MAKRti::DtString myCommandArgs
Definition: forwarderInfo.h:109
void setHostName(const MAKRti::DtString &n)
Methods to get and set network component information.
Definition: forwarderInfo.h:53
MAKRti::DtString federationName() const
Methods to get and set network component information.
Definition: forwarderInfo.h:72
void setPort(int p)
Methods to get and set network component information.
Definition: forwarderInfo.h:56
int myPort
Definition: forwarderInfo.h:112
MAKRti::DtString myName
Definition: forwarderInfo.h:103
void setFederateStatus(DtAssistantMsgFederateStatus v)
Methods to get and set network component information.
Definition: forwarderInfo.h:88
const DtAssistantMsg * lastStateMsg() const
Returns a pointer to the last state message we received for this forwarder.
Definition: forwarderInfo.h:144
int port() const
Methods to get forwarder information.
Definition: forwarderInfo.h:157
#define DT_DLL_ASSISTANTAPP
Definition: rtiMsConfig.h:122
const DtAssistantNetworkCompInfo * rtiexecInfo() const
Methods to get forwarder information.
Definition: forwarderInfo.h:161
const DtCompByFederationAndHandleMap * federates() const
Methods to get forwarder information.
Definition: forwarderInfo.h:164
std::list< DtAssistantNetworkCompInfo > myUnclassifiedConns
List of unclassified connections.
Definition: forwarderInfo.h:197
DtHlaVersionId myHlaVersion
Definition: forwarderInfo.h:116
void setFederateHandle(int h)
Methods to get and set network component information.
Definition: forwarderInfo.h:76
void setPid(const MAKRti::DtString &p)
Methods to get and set network component information.
Definition: forwarderInfo.h:70
void setConnectionId(unsigned i)
Methods to get and set network component information.
Definition: forwarderInfo.h:79
void setName(const MAKRti::DtString &n)
Methods to get and set network component information.
Definition: forwarderInfo.h:44
DtBoost::shared_ptr< DtAssistantMsg > myLastStateMessage
The last received forwarder state message.
Definition: forwarderInfo.h:203
MAKRti::DtString name() const
Methods to get and set network component information.
Definition: forwarderInfo.h:43
const DtAssistantNetworkCompInfoList * unclassifiedConns() const
Methods to get forwarder information.
Definition: forwarderInfo.h:165
DtAssistantMsgFederateStatus federateStatus() const
Methods to get and set network component information.
Definition: forwarderInfo.h:87
int federateHandle() const
Methods to get and set network component information.
Definition: forwarderInfo.h:75
DtAssistantNetworkCompInfo myRtiexec
Info on the rtiexec connected to this forwarder.
Definition: forwarderInfo.h:189
MAKRti::DtString typeName() const
Methods to get and set network component information.
Definition: forwarderInfo.h:63
Stores the current state of a single forwarder.
Definition: forwarderInfo.h:123
MAKRti::DtString myName
Name of this forwarder.
Definition: forwarderInfo.h:180
MAKRti::DtInetAddr privateAddress() const
Methods to get and set network component information.
Definition: forwarderInfo.h:49
std::list< DtAssistantNetworkCompInfo > DtAssistantNetworkCompInfoList
Definition: forwarderInfo.h:120
DtAssistantMsgFederateStatus
Definition: assistantMsg.h:143
DtCompByFederationAndHandleMap myFederateConns
Map of federation name/connection handle pairs to info on federate connections.
Definition: forwarderInfo.h:193
bool isValid() const
Returns whether this entry contains valid data.
Definition: forwarderInfo.h:95

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)