MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rtiExecHandshakeProcessor.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2005 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: rtiExecHandshakeProcessor.h,v $ $Revision: 1.8 $ $State: Exp $
7 *********************************************************************/
10 
11 #ifndef DtRtiExecHandshakeProcessor_H_
12 #define DtRtiExecHandshakeProcessor_H_
13 
14 #include "forwarderNode.h"
15 #include "execHandshakeMsg.h"
16 #include "routeMap.h"
17 #include "rtiMsConfig.h"
18 
19 #include <vlutil/vlUtil.h>
20 #include <map>
21 #include <set>
22 
25 template< typename ParentType > class DtRtiExecConnectionFilter;
28 
38 {
39 public:
41  typedef bool (DtRtiExecHandshakeProcessor::* HandshakeMsgHandlerMemberCb)(
42  const DtInetAddrAndPort& src, const DtRtiExecHandshakeMsg& msg );
43  typedef bool (DtRtiExecHandshakeProcessor::* DestinationProcessingMemberCb)(
44  const DtInetAddrAndPort& src, DtForwarderPort::DtAddressPortList& destinations );
45 
47  DtRtiExecHandshakeProcessor( DtBoost::shared_ptr<DtForwarderNode> parent );
48 
50  virtual ~DtRtiExecHandshakeProcessor();
51 
53  virtual bool gotMsgToLanPort( const DtInetAddrAndPort& src,
54  const DtRtiExecHandshakeMsg& msg );
55 
57  virtual bool gotMsgToOutPort( const DtInetAddrAndPort& src,
58  const DtRtiExecHandshakeMsg& msg );
59 
61  virtual bool gotRtiExecConnect( const DtInetAddrAndPort& src,
62  const DtRtiExecConnectMsg& msg );
63 
65  virtual bool gotRtiExecDisconnect( const DtInetAddrAndPort& src,
66  const DtRtiExecDisconnectMsg& msg );
67 
70  virtual bool processExecHandshakeDestinations ( const DtInetAddrAndPort& src,
71  DtForwarderPort::DtAddressPortList& destinations );
72 
75  virtual bool ignoreExecHandshakeDestinations ( const DtInetAddrAndPort& src,
76  DtForwarderPort::DtAddressPortList& destinations );
77 
80  virtual bool ignoreExecConnectDestinations ( const DtInetAddrAndPort& src,
81  DtForwarderPort::DtAddressPortList& destinations );
82 
84  virtual bool isLocalGroupMember( const DtInetAddrAndPort& addr );
85  virtual DtInetAddrAndPort locateGroupPortal( const DtInetAddrAndPort& addr );
86 
88  virtual DtInetAddrAndPort localNodeAddress();
89 
90 public:
91 
93  static int lostConnection( const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
94  unsigned int connID, const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr, void* usr);
95 
96 protected:
97 
99  virtual int lostConnection( const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
100  unsigned int connID, const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
101 
104  virtual void sendResponseMsg( DtRtiExecHandshakeMsg::DtHandshakeStatus status,
105  DtHandle src, DtHandle dest, const MAKRti::DtString& hostName, bool fullyCompliant,
106  const DtInetAddrAndPort* addr = 0 );
107 
109  virtual bool processInToOutMsg( const DtInetAddrAndPort& src,
110  const DtRtiExecHandshakeMsg& msg );
111 
113  virtual bool processLanToOutMsg( const DtInetAddrAndPort& src,
114  const DtRtiExecHandshakeMsg& msg );
115 
116 
117 protected:
118 
120  typedef std::set< unsigned int > DtConnIdList;
121  typedef std::map< unsigned int, PendingRequest > DtConnIdToRequestMap;
122 
125  {
126  public:
127  typedef std::set< unsigned int > DtConnIdList;
128 
130  currentStatus( DtRtiExecHandshakeMsg::HsResponseGranted ),
131  destinationHandle( 0 ),
132  sourceHandle( 0 ),
133  sourceAddress(),
134  pendingOutResponses(),
135  pendingLanResponses() {}
136 
137  PendingRequest( const DtInetAddrAndPort& src, DtHandle destHandle,
138  DtHandle srcHandle,
139  const DtRouteMap::DtAddressPortList& expectedOutResponses,
140  const DtConnIdList& expectedLanResponses ) :
141  currentStatus( DtRtiExecHandshakeMsg::HsResponseGranted ),
142  destinationHandle( destHandle ),
143  sourceHandle( srcHandle ),
144  sourceAddress( src ),
145  pendingOutResponses( expectedOutResponses ),
146  pendingLanResponses( expectedLanResponses ) {}
147 
154  };
155 
156 
157 protected:
158 
159  DtBoost::shared_ptr<DtForwarderNode> myParent;
163 
166 
169 
173 
174 };
175 
176 #endif
177 
Simple message processing filter which monitors the connection to the rtiexec It catches rtiexec conn...
Definition: rtiExecConnectionFilter.h:27
std::set< unsigned int > DtConnIdList
Definition: rtiExecHandshakeProcessor.h:119
std::pair< MAKRti::DtInetAddr, int > DtInetAddrAndPort
Definition: rtiUtil.h:147
Definition: execDisconnectMsg.h:21
DtRtiExecConnectionFilter< DtRtiExecHandshakeProcessor > * myRtiExecConnectionFilter
Definition: rtiExecHandshakeProcessor.h:162
bool myHaveConnectionIdOfLocalRtiExec
Definition: rtiExecHandshakeProcessor.h:172
DtHandle sourceHandle
Definition: rtiExecHandshakeProcessor.h:150
Simple helper class to hold status of pending rtiexec Handshakes.
Definition: rtiExecHandshakeProcessor.h:124
DtHandle destinationHandle
Definition: rtiExecHandshakeProcessor.h:149
DtConnIdToRequestMap myPendingRequests
Map of outstanding rtiexec Requests to Responses.
Definition: rtiExecHandshakeProcessor.h:168
std::map< unsigned int, PendingRequest > DtConnIdToRequestMap
Definition: rtiExecHandshakeProcessor.h:121
DtBoost::shared_ptr< DtForwarderNode > myParent
Definition: rtiExecHandshakeProcessor.h:159
The DtRtiExecHandshakeProcessor class consists of filters for RtiExecHandshake messages for all three...
Definition: rtiExecHandshakeProcessor.h:37
DtRouteMap::DtAddressPortList DtAddressPortList
Definition: forwarderPort.h:51
DtHandshakeStatus
Definition: execHandshakeMsg.h:26
DtInetAddrAndPort sourceAddress
Definition: rtiExecHandshakeProcessor.h:151
unsigned long myConnectionIdOfLocalRtiExec
If valid, this represents the connID of a local exec.
Definition: rtiExecHandshakeProcessor.h:171
Definition: execConnectMsg.h:25
std::set< unsigned int > DtConnIdList
Definition: rtiExecHandshakeProcessor.h:127
DtRtiExecHandshakeFilter * myMsgToLanFilter
Definition: rtiExecHandshakeProcessor.h:160
Simple message processing filter which forwards rtiexec handshake messages to its parent handshake pr...
Definition: rtiExecHandshakeFilter.h:25
PendingRequest(const DtInetAddrAndPort &src, DtHandle destHandle, DtHandle srcHandle, const DtRouteMap::DtAddressPortList &expectedOutResponses, const DtConnIdList &expectedLanResponses)
Definition: rtiExecHandshakeProcessor.h:137
DtConnIdList myLocalRtiExecConnIds
List of local rtiexec Candidates.
Definition: rtiExecHandshakeProcessor.h:165
DtRtiExecHandshakeMsg::DtHandshakeStatus currentStatus
Definition: rtiExecHandshakeProcessor.h:148
unsigned long DtHandle
The internal types.
Definition: internalTypes.h:25
DtRtiExecHandshakeFilter * myMsgToOutFilter
Definition: rtiExecHandshakeProcessor.h:161
PendingRequest()
Definition: rtiExecHandshakeProcessor.h:129
Definition: execHandshakeMsg.h:23
DtConnIdList pendingLanResponses
Definition: rtiExecHandshakeProcessor.h:153
#define DT_DLL_FORWARDER
Definition: rtiMsConfig.h:124
DtRouteMap::DtAddressPortList pendingOutResponses
Definition: rtiExecHandshakeProcessor.h:152
std::vector< DtInetAddrAndPort > DtAddressPortList
Definition: routeMap.h:59

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)