MAK RTIspy API Documentation for HLA 1516
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtMessageFilter Class Reference

DtMessageFilter is a base class for filters applied to DtFilteredTcpForwarder. More...

+ Inheritance diagram for DtMessageFilter:
+ Collaboration diagram for DtMessageFilter:

List of all members.

Public Member Functions

 DtMessageFilter (const char *name)
 Default Ctor ( created with empty list of filtered messages )
 DtMessageFilter (const char *name, const std::set< DtRtiMsgKind > &filteredKinds)
 Ctor taking a set of filtered message kinds.
virtual ~DtMessageFilter ()
 Default Dtor.
MAKRti::DtString const & name () const
 Return filter name.
const std::set< DtRtiMsgKind > & filteredMsgKinds () const
 Returns the set of all message types to which this filter may be applied - used to map messages to filters NOTE: isFilteredMsgKind may still reject the message.
virtual void filter (const DtTcpMsgSocket *fromSocket, const DtTcpMsgSocketMap *connectionList, DtTcpMsgSocketMap *destinationList, caddr_t packet, size_t size)
 If applicable message type, Apply filter to the message and modify destination list to add or remove filtered connections from full connection list NOTE: Generally it is only necessary to override the isFilteredMsgKind and doFilter() methods since all real work should be done there.
virtual bool isFilteredMsgKind (DtRtiMsgKind kind) const
 Does this filter apply to this message?

Static Public Member Functions

static void addToSocketMap (DtTcpMsgSocketMap *sockMap, DtTcpMsgSocket *sock)
 Adds the given socket to the given socket map.
static void removeFromSocketMap (DtTcpMsgSocketMap *sockMap, DtTcpMsgSocket *sock)
 Remove the given socket from the given socket map.

Protected Member Functions

virtual void doFilter (const DtTcpMsgSocket *fromSocket, const DtTcpMsgSocketMap *connectionList, DtTcpMsgSocketMap *destinationList, caddr_t packet, size_t size)
 Apply filter to the message and modify destination list to add or remove filtered connections from full connection list.

Protected Attributes

std::set< DtRtiMsgKindmyFilteredMsgKinds
MAKRti::DtString myName

Detailed Description

DtMessageFilter is a base class for filters applied to DtFilteredTcpForwarder.

DtMessageFilter and its derived classes process incoming messages and return a list of connections. The default DtMessageFilter returns an unmodified list.


Constructor & Destructor Documentation

DtMessageFilter::DtMessageFilter ( const char *  name) [inline]

Default Ctor ( created with empty list of filtered messages )

DtMessageFilter::DtMessageFilter ( const char *  name,
const std::set< DtRtiMsgKind > &  filteredKinds 
) [inline]

Ctor taking a set of filtered message kinds.

DtMessageFilter::~DtMessageFilter ( ) [inline, virtual]

Default Dtor.


Member Function Documentation

void DtMessageFilter::addToSocketMap ( DtTcpMsgSocketMap sockMap,
DtTcpMsgSocket sock 
) [inline, static]

Adds the given socket to the given socket map.

References DtTcpMsgSocket::inetTcpSocket().

Referenced by DtFedexMsgFilter::doFilter(), and DtUpdateInterRoutingFilter::doFilter().

void DtMessageFilter::doFilter ( const DtTcpMsgSocket fromSocket,
const DtTcpMsgSocketMap connectionList,
DtTcpMsgSocketMap destinationList,
caddr_t  packet,
size_t  size 
) [inline, protected, virtual]

Apply filter to the message and modify destination list to add or remove filtered connections from full connection list.

Reimplemented in DtRtiExecTrackingFilter, DtUpdateInterRoutingFilter, DtMessageBufferFilter, DtFedexMsgFilter, DtFederateTrackingFilter, DtRoutePrinterFilter, DtNetworkMapLanRequestFilter, DtConnectConfirmFilter, and DtDeleteSocketFilter.

Referenced by filter().

void DtMessageFilter::filter ( const DtTcpMsgSocket fromSocket,
const DtTcpMsgSocketMap connectionList,
DtTcpMsgSocketMap destinationList,
caddr_t  packet,
size_t  size 
) [inline, virtual]

If applicable message type, Apply filter to the message and modify destination list to add or remove filtered connections from full connection list NOTE: Generally it is only necessary to override the isFilteredMsgKind and doFilter() methods since all real work should be done there.

References doFilter(), and isFilteredMsgKind().

const std::set< DtRtiMsgKind > & DtMessageFilter::filteredMsgKinds ( ) const [inline]

Returns the set of all message types to which this filter may be applied - used to map messages to filters NOTE: isFilteredMsgKind may still reject the message.

References myFilteredMsgKinds.

Referenced by DtFilteredTcpForwarder::addPacketFilter(), and DtFilteredTcpForwarder::removePacketFilter().

bool DtMessageFilter::isFilteredMsgKind ( DtRtiMsgKind  kind) const [inline, virtual]

Does this filter apply to this message?

  • Called internally by filter to determine whether to perform filtering

Reimplemented in DtMessageBufferFilter.

References myFilteredMsgKinds.

Referenced by DtNetworkMapLanRequestFilter::doFilter(), DtRtiExecTrackingFilter::doFilter(), and filter().

MAKRti::DtString const & DtMessageFilter::name ( ) const [inline]

Return filter name.

References myName.

void DtMessageFilter::removeFromSocketMap ( DtTcpMsgSocketMap sockMap,
DtTcpMsgSocket sock 
) [inline, static]

Remove the given socket from the given socket map.

References DtTcpMsgSocket::inetTcpSocket().

Referenced by DtFedexMsgFilter::doFilter().


Member Data Documentation

MAKRti::DtString DtMessageFilter::myName [protected]

Referenced by name().


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

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)