MAK RTIspy API Documentation for HLA 1.3
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
DtExtendedRtiMsgForwarder Class Reference
+ Inheritance diagram for DtExtendedRtiMsgForwarder:
+ Collaboration diagram for DtExtendedRtiMsgForwarder:

List of all members.

Public Types

typedef
DtThreadSafeBufferQueue< char > 
DtCharBufferQueue

Public Member Functions

virtual ~DtExtendedRtiMsgForwarder ()
 Default Dtor.
virtual void applyFilters ()
 Instruct the forwarder to register all filters - called after all desired filters are registered (accessor for protected base member: applyRegisteredFilters)
virtual void sendByTransport (const DtForwarderPort::DtForwarderMsg &msg)
 Check transport metadata and send message to appropriate socket(s)
virtual void sendToAllReliable (const DtForwarderPort::DtForwarderMsg &msg)
 Apply registered filters and send message to unfiltered TCP sockets.
virtual void sendBestEffort (const DtForwarderPort::DtForwarderMsg &msg)
 Apply registered filters and send message to LAN via UDP socket.
virtual void sendMessageToWan (const DtRtiMsg &msg)
 Allow filters to send messages only to the WAN (not back to the LAN) (useful to distributed forwarder mode filters)
virtual bool flush ()
 Send buffered messages.
virtual const
DtCharBufferQueue::Buffer
getNextMsg ()
 Get the next message received from the connected sockets.
virtual void selectParams (MAKRti::DtSelectParamWithWrite &selectParams)
 Get a set of file descriptors to select against for socket notification.
virtual
DtForwarderPort::DtAddressPortList 
newConnections () const
 Get the list of connections created since last call.
virtual
DtForwarderPort::DtAddressPortList 
droppedConnections () const
 Get the list of connections lost since last call.
virtual
DtForwarderPort::DtAddressPortList 
connections () const
 Get the list of all current connections to this port.
virtual void listenToMulticastGroup (const MAKRti::DtInetAddr &mcastAddr)
 Listen / drop multicast groups.
virtual void dropMulticastGroup (const MAKRti::DtInetAddr &mcastAddr)
virtual void federateJoined (const MAKRti::DtString &, const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, unsigned int, const DtInetAddrAndPort &, const MAKRti::DtString &, unsigned int, const MAKRti::DtString &, const MAKRti::DtString &, DtHlaVersionId)
 callbacks when the federate tracking filter notices a federate join/resign event.
virtual void federateResigned (const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, unsigned int, const DtInetAddrAndPort &)
virtual void updateSocketQueueStatus (unsigned int connId, int connQueueStatus)
virtual void addFederateJoinedCb (DtForwarderPort::DtFederateAddedCb callback, void *usr)
virtual void addFederateResignedCb (DtForwarderPort::DtFederateRemovedCb callback, void *usr)
virtual void addSocketAdditionCb (DtForwarderPort::DtConnectionChangeCb cb, void *usr)
virtual void addSocketRemovalCb (DtForwarderPort::DtConnectionChangeCb cb, void *usr)
virtual void addSocketQueueCb (DtForwarderPort::DtSocketQueueCb cb, void *usr)
virtual void addExecConnectionEstablishedCb (DtForwarderPort::DtExecAddChangeCb callback, void *usr)
 Register/Unregister a callback for new connections.
virtual void removeExecConnectionEstablishedCb (DtForwarderPort::DtExecAddChangeCb callback, void *usr)
virtual void addExecConnectionLostCb (DtForwarderPort::DtExecRemovedChangeCb callback, void *usr)
 Register/Unregister a callback for new connections.
virtual void removeExecConnectionLostCb (DtForwarderPort::DtExecRemovedChangeCb callback, void *usr)
virtual const
DtFederateTrackingFilter
fedHandleTrackingFilter () const

Static Public Member Functions

static DtExtendedRtiMsgForwardercreate (unsigned int id, const DtRIDParameters &params, bool postMessagesToParent=true)
 Creator.

Static Public Attributes

static const unsigned int theForwarderId
 Address space for connection IDs for this LAN.

Protected Types

typedef std::pair
< DtInetAddrAndPort, int > 
DtAddressAndSockIdPair
typedef std::pair< bool,
DtAddressAndSockIdPair
DtBoolAddressSocketIdPair
 These lists are mutable since they are simply used to cache a reflection of back-end thread lists (rather than requiring synchronization)

Protected Member Functions

 DtExtendedRtiMsgForwarder (unsigned long id, const DtRIDParameters &params, bool postMessagesToParent=true)
 Default Ctor.
virtual void init ()
 Virtual ctor idiom (continues initialization after both base and derived are initialized)
virtual void tcpSocketAdditionCb (DtTcpMsgSocket *sock)
 Over-ride socket addition/removal callback to track socket list.
virtual void tcpSocketRemovalCb (DtTcpMsgSocket *sock)
virtual void refreshConnectionList () const
 Get all changes to connections since last call This method is const so that const front-end threads can call it.

Protected Attributes

DtUdpMsgSocketmyUdpRcvSocket
DtUdpMsgSocketmyUdpSendSocket
std::auto_ptr
< DtCharBufferQueue::Buffer
myLastReceivedMsg
DtCharBufferQueue myInMsgQueue
DtCharBufferQueue myOutMsgQueue
DtMessageBufferFiltermyOutMsgFilter
DtNetworkMapLanRequestFiltermyNetMapRequestFilter
DtFederateTrackingFiltermyFedHandleTracker
DtClock myClock
 Local timer.
MAKRti::DtTime myLastDiscoveryTickTime
 Time of last pass for mcast discovery.
DtForwarderPort::DtFederateAddedCallbackList myFederateJoinedCbs
DtForwarderPort::DtFederateRemovedCallbackList myFederateResignedCbs
DtForwarderPort::DtSocketQueueCallbackList mySocketQueueCbs
DtForwarderPort::DtCallbackList mySocketAddedCbs
DtForwarderPort::DtCallbackList mySocketRemovedCbs
DtThreadSafeQueue
< DtBoolAddressSocketIdPair
mySocketListChanges
std::set< DtAddressAndSockIdPairmyConnections
DtForwarderPort::DtAddressPortList myNewConnections
DtForwarderPort::DtAddressPortList myDroppedConnections
bool myForwardMessagesToParent
 Should the local forwarder pass a copy of all messages on to the Parent or simply forward within the local LAN (allows optimization when this is a stand-alone forwarder)

Member Typedef Documentation

These lists are mutable since they are simply used to cache a reflection of back-end thread lists (rather than requiring synchronization)

  • changes to the actual lists occur asynchronously in the back-end, so these lists may need to be updated before any use.

Constructor & Destructor Documentation

DtExtendedRtiMsgForwarder::DtExtendedRtiMsgForwarder ( unsigned long  id,
const DtRIDParameters params,
bool  postMessagesToParent = true 
) [protected]

Default Ctor.

Referenced by create().


Member Function Documentation

Register/Unregister a callback for new connections.

References DtRtiExecTrackingFilter::addExecConnectionEstablishedCb(), and DtRtiMsgForwarder::myRtiExecMonitor.

Referenced by DtLanForwarderPort::DtLanForwarderPort().

Register/Unregister a callback for new connections.

References DtRtiExecTrackingFilter::addExecConnectionLostCb(), and DtRtiMsgForwarder::myRtiExecMonitor.

Referenced by DtLanForwarderPort::DtLanForwarderPort().

References mySocketQueueCbs.

Instruct the forwarder to register all filters - called after all desired filters are registered (accessor for protected base member: applyRegisteredFilters)

References DtRtiMsgForwarder::applyRegisteredFilters().

Referenced by DtLanForwarderPort::DtLanForwarderPort().

Get the list of all current connections to this port.

References myConnections, and refreshConnectionList().

Referenced by DtLanForwarderPort::connections().

DtExtendedRtiMsgForwarder * DtExtendedRtiMsgForwarder::create ( unsigned int  id,
const DtRIDParameters params,
bool  postMessagesToParent = true 
) [static]

Creator.

  • Caller may set postMessagesToParent as an optimization if there is never any need for the parent to access the message stream (ie - if this is being used by a stand-alone forwarder and getNextMsg is used simply to tick the Forwarder)

References DtExtendedRtiMsgForwarder(), and init().

void DtExtendedRtiMsgForwarder::dropMulticastGroup ( const MAKRti::DtInetAddr &  mcastAddr) [virtual]

Get the list of connections lost since last call.

References myDroppedConnections, and refreshConnectionList().

void DtExtendedRtiMsgForwarder::federateJoined ( const MAKRti::DtString &  federateName,
const MAKRti::DtString &  federateType,
const MAKRti::DtString &  federationName,
unsigned int  connectId,
unsigned int  fedHandle,
const DtInetAddrAndPort connAddr,
const MAKRti::DtString &  connHost,
unsigned int  processId,
const MAKRti::DtString &  processName,
const MAKRti::DtString &  commandArgs,
DtHlaVersionId  hlaVersion 
) [virtual]

callbacks when the federate tracking filter notices a federate join/resign event.

References myFederateJoinedCbs.

Referenced by DtFederateTrackingFilter::handleJoinConfirmMsg().

void DtExtendedRtiMsgForwarder::federateResigned ( const MAKRti::DtString &  federateName,
const MAKRti::DtString &  federateType,
unsigned int  connectId,
unsigned int  fedHandle,
const DtInetAddrAndPort connAddr 
) [virtual]
bool DtExtendedRtiMsgForwarder::flush ( ) [inline, virtual]

Send buffered messages.

Returns the status indicating error, flush is complete or incomplete.

References DtUdpMsgSocket::flush(), DtUdpMsgSocket::isOpen(), and myUdpSendSocket.

Referenced by DtLanForwarderPort::flush().

void DtExtendedRtiMsgForwarder::init ( ) [protected, virtual]
void DtExtendedRtiMsgForwarder::listenToMulticastGroup ( const MAKRti::DtInetAddr &  mcastAddr) [virtual]

Listen / drop multicast groups.

References DtUdpMsgSocket::joinMulticastGroup(), and myUdpRcvSocket.

Referenced by DtLanForwarderPort::listenToMulticastGroup().

Get the list of connections created since last call.

References myNewConnections, and refreshConnectionList().

void DtExtendedRtiMsgForwarder::refreshConnectionList ( ) const [protected, virtual]

Get all changes to connections since last call This method is const so that const front-end threads can call it.

  • this hides the fact that changes actually occur in a separate thread and the front-end merely reflects back-end state
  • ie - the actual state is stored in the back-end and this method IS const with respect to it

References myConnections, myDroppedConnections, myNewConnections, mySocketListChanges, and DtThreadSafeQueue< T >::pop().

Referenced by connections(), droppedConnections(), newConnections(), and selectParams().

void DtExtendedRtiMsgForwarder::selectParams ( MAKRti::DtSelectParamWithWrite &  selectParams) [virtual]

Get a set of file descriptors to select against for socket notification.

References DtMsgSocket::descriptor(), myConnections, myUdpRcvSocket, and refreshConnectionList().

Referenced by DtLanForwarderPort::selectParams().

Check transport metadata and send message to appropriate socket(s)

References sendBestEffort(), sendToAllReliable(), and DtForwarderPort::DtForwarderMsg::transport.

Referenced by DtLanForwarderPort::sendByTransport().

void DtExtendedRtiMsgForwarder::sendMessageToWan ( const DtRtiMsg msg) [virtual]

Allow filters to send messages only to the WAN (not back to the LAN) (useful to distributed forwarder mode filters)

References myOutMsgQueue, DtRtiMsgForwarder::myParams, DtThreadSafeBufferQueue< T >::push(), and DtRtiMtdTransportType::set().

Referenced by DtNetworkMapLanRequestFilter::doFilter().

void DtExtendedRtiMsgForwarder::tcpSocketAdditionCb ( DtTcpMsgSocket sock) [protected, virtual]
void DtExtendedRtiMsgForwarder::tcpSocketRemovalCb ( DtTcpMsgSocket sock) [protected, virtual]
void DtExtendedRtiMsgForwarder::updateSocketQueueStatus ( unsigned int  connId,
int  connQueueStatus 
) [virtual]

References mySocketQueueCbs.


Member Data Documentation

Local timer.

Referenced by getNextMsg().

Referenced by init(), and ~DtExtendedRtiMsgForwarder().

Should the local forwarder pass a copy of all messages on to the Parent or simply forward within the local LAN (allows optimization when this is a stand-alone forwarder)

Referenced by init().

Time of last pass for mcast discovery.

Referenced by getNextMsg().

Referenced by getNextMsg().

Referenced by init(), and ~DtExtendedRtiMsgForwarder().

Referenced by init(), and ~DtExtendedRtiMsgForwarder().

Referenced by getNextMsg(), init(), and sendMessageToWan().

const unsigned int DtExtendedRtiMsgForwarder::theForwarderId [static]

Address space for connection IDs for this LAN.


The documentation for this class was generated from the following files:

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)