11 #ifndef DtForwarderNode_H_
12 #define DtForwarderNode_H_
18 #include <vlutil/vlConfig.h>
19 #include <vlutil/vlUtil.h>
20 #include <vlutil/vlTime.h>
54 #define DtForwarderIntfcIn 0x01
55 #define DtForwarderIntfcOut 0x02
56 #define DtForwarderIntfcLan 0x04
114 const MAKRti::DtInetEndpoint& forwarderAddrToConnectTo,
115 bool writeToPipeWhenReady );
125 virtual int tick(
double maxTime = 0.0f );
130 virtual void addTickCallback(
DtTickCbFn fn,
void* usr, MAKRti::DtTime interval );
131 virtual void removeTickCallback(
DtTickCbFn fn,
void* usr );
134 virtual inline bool ready()
const;
140 virtual inline std::shared_ptr<DtRouteMap> routeMap()
const;
148 virtual void selectParams( MAKRti::DtSelectParamWithWrite& selectParams );
151 virtual unsigned long localNodeId()
const;
158 virtual MAKRti::DtString localNodeName()
const;
161 virtual MAKRti::DtString localNodeHostName()
const;
193 virtual void packageAndSendReliable(
DtRtiMsg& msg,
unsigned int sendViaIntfc );
194 virtual void packageAndSendReliable(
DtRtiMsg& msg,
unsigned int sendViaIntfc,
198 virtual void setMetadataControl(
DtMetadataType type,
bool onOff );
202 virtual void lanPortListenToMulticastGroup(
const MAKRti::DtInetAddr& mcastAddr );
203 virtual void lanPortDropMulticastGroup(
const MAKRti::DtInetAddr& mcastAddr );
207 virtual bool lanPortUpdateFederateConnectionId(
unsigned long orig,
208 unsigned long final );
214 virtual DtInetAddrAndPort nextForwarderOnRoute(
const MAKRti::DtString& targetGroupName );
224 virtual void abortPendingConnections();
227 virtual unsigned int abortedConnections();
230 virtual bool connectionInformation(
231 unsigned int& numForwarderToForwarderConns,
232 std::vector<MAKRti::DtString>& forwarderIdentifiers,
233 std::vector<MAKRti::DtString>& forwarderConnectionHostNames,
234 std::vector<DtInetAddrAndPort>& forwarderConnectionAddrs,
235 unsigned int& numForwarderExecConns,
236 unsigned int& numForwarderClientConns,
237 std::vector<MAKRti::DtString>& clientConnectionHostNames,
238 std::vector<MAKRti::DtInetAddr>& clientConnectionAddrs);
243 virtual void continueWithoutUnconnectedFws();
246 virtual void connectForwarder(
const DtString& host,
const MAKRti::DtInetAddr& ipAddress,
int port);
250 static int forwarderToForwarderConnectionChanged(
251 const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
252 unsigned int oldConnID,
unsigned int newConnID,
254 virtual int forwarderToForwarderConnectionChanged(
255 const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
256 unsigned int oldConnID,
unsigned int newConnID,
const DtInetAddrAndPort& connAddr );
266 MAKRti::DtInetEndpoint forwarderAddrToConnectTo,
267 bool writeToPipeWhenReady );
274 MAKRti::DtInetEndpoint forwarderAddrToConnectTo,
275 bool writeToPipeWhenReady );
280 static void setCreatorFunction( DtForwarderNodeCreatorFcn creator );
283 static int newInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
284 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
285 static int newOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
286 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
287 static int lostInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
288 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
289 static int lostOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
290 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
291 static void inOutForwarderPortReady(
unsigned long forwarderNodeId,
void* usr);
303 int refreshConnections();
306 void writeMessageToPipe(
const MAKRti::DtString& msg );
309 int newInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
310 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
311 int newOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
312 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
313 int lostInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
314 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
315 int lostOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
316 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
317 void inOutForwarderPortReady(
unsigned long forwarderNodeId);
413 return (
outPort()->pendingConnectionsAborted() +
lanPort()->pendingConnectionsAborted());
virtual Boolean tick(TickTime minimum, TickTime maximum)
The DtForwarderPort is an Abstract Base Class which provides the interface to a collection of connect...
Definition: inOutForwarderPort.h:33
DtMessageProcessor< DtInetAddrAndPort, DtForwarderPort::DtForwarderMsg > DtForwarderMessageProcessor
Definition: forwarderNode.h:104
User-defined Message Processing Function Object.
Definition: messageProcessor.h:31
std::pair< MAKRti::DtInetAddr, int > DtInetAddrAndPort
Definition: rtiUtil.h:148
The DtForwarderNode class defines a 3-way message distribution architecture for building forwarding n...
Definition: forwarderNode.h:99
static const MAKRti::DtInetAddr theFirstHostInetAddr
Definition: forwarderNode.h:369
The DtForwarderPort is an Abstract Base Class which provides the interface to a collection of connect...
Definition: forwarderPort.h:38
Info for tick callbacks.
Definition: exec.h:94
This class manages the RTI's start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
DtInetAddrAndPort myLocalNodeAddress
IP address and port of the local node.
Definition: forwarderNode.h:357
std::list< DtTickCallbackInfo > myTickCallbacks
List of tick callbacks.
Definition: forwarderNode.h:372
bool myAddTcpDestinationListMetadata
Metadata control indicators.
Definition: forwarderNode.h:360
bool myWriteToPipeWhenReady
Whether the forwarder should write to the pipe once it is ready.
Definition: forwarderNode.h:366
The DtForwarderFaultProcessor class provides connection fault processing to the Forwarder Node...
Definition: forwarderFaultProcessor.h:36
std::shared_ptr< DtRouteMap > myRoutes
Routing file configuration Keep this variable before myLocalPort in the class declaration!! ...
Definition: forwarderNode.h:341
void * myData
Definition: exec.h:106
bool myAddUdpDestinationListMetadata
Definition: forwarderNode.h:361
bool operator<(const DtTickCallbackInfo &other) const
Definition: forwarderNode.h:41
DtForwarderPort * myRemoteInputPort
IN Port - incoming message path from other DtForwarderNodes.
Definition: forwarderNode.h:344
virtual DtForwarderPort * outPort() const
Definition: forwarderNode.h:406
DtTickCallbackInfo(DtTickCbFn fn, void *data, MAKRti::DtTime interval)
Definition: forwarderNode.h:38
DtTime myNextExecutionTime
Definition: exec.h:109
const DtRIDParameters * myParams
RID file configuration.
Definition: forwarderNode.h:323
virtual unsigned int abortedConnections()
Get the count of failed/aborted connection attempts.
Definition: forwarderNode.h:411
void(* DtTickCbFn)(void *usr)
Tick callback function signatures.
Definition: exec.h:76
virtual bool ready() const
Is the forwarder fully connected and actively forwarding?
Definition: forwarderNode.h:381
bool myAddTransportTypeMetadata
Definition: forwarderNode.h:362
std::pair< DtInetAddrAndPort, DtForwarderMsg > DtAddressMsgPair
Definition: forwarderPort.h:59
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
MAKRti::DtTime myInterval
Definition: forwarderNode.h:49
static DtForwarderNodeCreatorFcn theCreator
Definition: forwarderNode.h:376
DtForwarderMessageProcessor * myToLanMsgProcessor
Definition: forwarderNode.h:328
Definition: routeMap.h:41
virtual DtForwarderPort * inPort() const
Get a pointer to the IN/OUT/LAN port.
Definition: forwarderNode.h:396
bool myAddMcastMetadata
Definition: forwarderNode.h:363
MAKRti::DtTime myNextExecutionTime
Definition: forwarderNode.h:50
DtTime myInterval
Definition: exec.h:108
virtual DtForwarderPort * lanPort() const
Definition: forwarderNode.h:401
DtTickCbFn myFn
Definition: exec.h:107
DtForwarderPort * myLocalPort
LAN Port - bidirectional message path to/from local message sources/sinks Keep this variable after my...
Definition: forwarderNode.h:354
DtForwarderMessageProcessor * myToOutMsgProcessor
Outgoing message processors allow user defined operations to be performed on messages before sending ...
Definition: forwarderNode.h:327
virtual std::shared_ptr< DtRouteMap > routeMap() const
Get the Route Map.
Definition: forwarderNode.h:391
virtual const DtRIDParameters * params() const
Get the RID parameters object.
Definition: forwarderNode.h:386
The DtMessageProcessor template class allows user to register simple message processing function obje...
Definition: messageProcessor.h:24
#define DT_DLL_FORWARDER
Definition: rtiMsConfig.h:153
DtForwarderPort * myRemoteOutputPort
OUT Port - outgoing message path to other DtForwarderNodes.
Definition: forwarderNode.h:347
DtClock myClock
A clock used for basic timing.
Definition: forwarderNode.h:334
DtForwarderFaultProcessor * myFaultProcessor
Fault handler.
Definition: forwarderNode.h:331
std::vector< DtInetAddrAndPort > DtAddressPortList
Definition: routeMap.h:59
bool myIsReady
Is the Forwarder in a "Good" state and ready to forward?
Definition: forwarderNode.h:337
DtInOutForwarderPort * myRemoteInOutPort
In/Out port used by default for both in and out.
Definition: forwarderNode.h:350