MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
forwarderObserver.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: forwarderObserver.h,v $ $Revision: 1.11 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DtRtiForwarderObserver_H_
13 #define DtRtiForwarderObserver_H_
14 
15 #include "rtiMsConfig.h"
16 #include "rtiMsg.h"
17 #include "rtiMsgCbMgr.h"
18 #include "forwarderObserverMgr.h"
19 
20 namespace MAKRti
21 {
22  class DtInetAddr;
23 }
24 
25 
29 {
30 
31 public:
32 
35 
37  virtual ~DtRtiForwarderObserver();
38 
40  virtual void setMgr( DtRtiForwarderObserverMgr* mgr );
41 
45  virtual void initMgr();
46 
48  virtual void removeMgr();
49 
52 
53 
55  virtual int clientToForwarderConnectionEstablished(
56  const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
57  const MAKRti::DtString& connType, unsigned int connID, const DtInetAddrAndPort& connAddr ) = 0;
58 
60  virtual int clientToForwarderConnectionLost(
61  const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
62  unsigned int connID, const DtInetAddrAndPort& connAddr ) = 0;
63 
65  virtual void clientToForwarderFederateJoined(
66  const MAKRti::DtString& connName, const MAKRti::DtString& connType,
67  const MAKRti::DtString& federationName,
68  unsigned int connID, unsigned int fedHandle,
69  const DtInetAddrAndPort& connAddr, const MAKRti::DtString& connHost,
70  unsigned int processId, const MAKRti::DtString& processName,
71  const MAKRti::DtString& commandArgs, DtHlaVersionId hlaVersion ) = 0;
72 
74  virtual void clientToForwarderFederateLost(
75  const MAKRti::DtString& connName, const MAKRti::DtString& connType,
76  unsigned int connID, unsigned int fedHandle,
77  const DtInetAddrAndPort& connAddr ) = 0;
78 
80  virtual int forwarderToForwarderExecConnected(
81  const MAKRti::DtString& connName, unsigned int connID,
82  const DtInetAddrAndPort& connAddr,
83  const MAKRti::DtString& connHost, bool fullyCompliant ) = 0;
84 
86  virtual int forwarderToForwarderExecLost(
87  const MAKRti::DtString& connName, unsigned int connID,
88  const DtInetAddrAndPort& connAddr ) = 0;
89 
91  virtual int clientToForwarderExecConnected(
92  const MAKRti::DtString& connName, unsigned int connID,
93  const DtInetAddrAndPort& connAddr, const MAKRti::DtString& connHost,
94  bool fullyCompliant ) = 0;
95 
97  virtual int clientToForwarderExecLost(
98  const MAKRti::DtString& connName, unsigned int connID,
99  const DtInetAddrAndPort& connAddr ) = 0;
100 
102  virtual void forwarderToForwarderConnectionEstablished(
103  const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
104  unsigned int connID, const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr) = 0;
105 
107  virtual void forwarderToForwarderConnectionLost(
108  const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
109  unsigned int connID, const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr) = 0;
110 
112  virtual void forwarderToForwarderConnectionChanged(
113  const MAKRti::DtString& connName, const MAKRti::DtString& hostName,
114  unsigned int oldConnID, unsigned int newConnID, const DtInetAddrAndPort& connAddr ) = 0;
115 
118  virtual void waitingForFowrarderConnections(
119  const DtForwarderPort::DtConnAndNameMap& allNeededFws,
120  const DtForwarderPort::DtConnAndNameMap& stillNeededFws ) = 0;
121 
124  virtual void notWaitingForFowrarderConnections() = 0;
125 
126 
129  virtual void addRtiMsgCallback( DtRtiMsgKind msgKind,
130  DtRtiMsgCbMgr::DtCallbackFcn fcn, bool isMomCallback = false );
131 
134  virtual void removeRtiMsgCallback( DtRtiMsgKind msgKind,
135  DtRtiMsgCbMgr::DtCallbackFcn fcn, bool isMomCallback = false );
136 
139  virtual void addTickCallback( DtTickCbFn fcn, MAKRti::DtTime interval );
140 
142  virtual void removeTickCallback( DtTickCbFn fcn );
143 
144  virtual int clientToForwarderSocketQueueUpdate( unsigned int connId, int connQueueStatus ) = 0;
145 
146 
148  virtual unsigned long connectionId() const;
149 
150 protected:
151 
153  virtual void addCallbacks() = 0;
154 
157  virtual void removeCallbacks() = 0;
158 
159 private:
160 
163 
165  DtRtiForwarderObserver& operator=( const DtRtiForwarderObserver& orig );
166 
167 protected:
168 
171 
172 };
173 
174 
175 inline unsigned long DtRtiForwarderObserver::connectionId() const
176 {
177  if( myMgr )
178  {
179  return myMgr->connectionId();
180  }
181  else
182  {
183  return 0;
184  }
185 }
186 
187 
188 #endif
189 
190 
std::pair< MAKRti::DtInetAddr, int > DtInetAddrAndPort
Definition: rtiUtil.h:147
void(* DtCallbackFcn)(const DtRtiMsg &msg, void *userData)
Definition: messageCallbackManager.h:39
DtRtiMsgKind
Definition: rtiMsgKind.h:9
DtHlaVersionId
Definition: rtiVersion.h:41
virtual unsigned long connectionId() const
Retrieve information about this node.
void(* DtTickCbFn)(void *usr)
Tick callback function signatures.
Definition: exec.h:69
std::map< DtInetAddrAndPort, MAKRti::DtString > DtConnAndNameMap
Definition: forwarderPort.h:59
The DtRtiForwarderObserver is the base class for all observers of RTI Forwarder events.
Definition: forwarderObserver.h:28
The DtRtiForwarderObserverMgr is the class which manages all RTI Forwarder observers.
Definition: forwarderObserverMgr.h:91
virtual unsigned long connectionId() const
Get the connection ID for this forwarder (thread safe)
Definition: forwarderObserver.h:175
#define DT_DLL_FORWARDER
Definition: rtiMsConfig.h:124
DtRtiForwarderObserverMgr * myMgr
Pointer to the observer manager.
Definition: forwarderObserver.h:170

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)