VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DtVrfMessageInterface Class Reference
Inheritance diagram for DtVrfMessageInterface:
Inheritance graph
[legend]

Public Member Functions

 DtVrfMessageInterface (DtExerciseConn *exConn, bool useDefaultInterfaceFactory=true)
 Contructor.
virtual ~DtVrfMessageInterface ()
 destructor
virtual bool init ()
 Creates all the other pieces.
virtual bool createMessageExecutive ()
 Creator functions.
virtual void createSplitMessageCollector ()
 Replaces mySplitMessageCollector with a new one.
virtual DtSplitMessageCollectorsplitMessageCollector ()
virtual const
DtSplitMessageCollector
splitMessageCollector () const
virtual bool deliverMessage (const DtSimInterfaceMessage &msg)
 Send a message.
virtual bool receiveMessage (const DtSimInterfaceMessage &msg)
virtual bool createAndDeliverMessage (const DtSimulationAddress &recipient, const DtSimInterfaceContent &content, bool overrideTimestampOrder=true)
virtual bool getContentFromNet (DtDataInteraction *dataInter, DtSimInterfaceContent *&content) const
 Create/set objects based on DtDataInteraction information.
virtual bool getContentFromNet (unsigned nBufferSize, int nContentType, const char *pContentBuffer, DtSimInterfaceContent *&content) const
virtual bool setContentForNet (DtDataInteraction *dataInter, DtSimInterfaceContent *content) const
virtual void setSequence (DtU32 num)
 Get/Set the sequence number.
virtual DtU32 sequence () const
virtual void setSessionId (DtU32 num)
 Get/Set the session id.
virtual DtU32 sessionId () const
virtual void setVrfMessageVersionSupported (DtU32 num)
 Get/Set the vrf message version.
virtual DtU32 vrfMessageVersionSupported () const
virtual bool isMessageVrfVersionSupported (DtDataInteraction *) const
 Returns true if this data interaction passes the message version check.
virtual void addVrfMessageVersionValidCallback (DtIsValidVrfMessageVersionFcn fcn, void *usr)
 Register vrf message interface version valid.
virtual void removeVrfMessageVersionValidCallback (DtIsValidVrfMessageVersionFcn fcn, void *usr)
virtual bool isVrfMessageVersionTransparentMessageType (int messageType) const
 Returns true if the given message type is message verson transparent (i.e.
virtual bool isSessionTransparentMessageType (int messageType)
 Returns true if the given message type is session transparent (i.e.
virtual DtExerciseConn * exerciseConn ()
 Get the exercise connection ptr.
virtual void clearExerciseConn ()
 Sets the exercise conn to NULL.
virtual DtInterfaceContentFactoryfactory () const
 Get/Set the factory used for creating interface content msgs.
virtual void setFactory (DtInterfaceContentFactory *fact)
virtual
DtInterfaceMessageExecutive
messageExecutive () const
 Get the message executive ptr.
virtual const DtSimulationAddress & messageAddress () const
 Get the address that should be used as the sender for all messages originating from the backend.
virtual void receiveMessage (DtDataInteraction *dataInter)
 Process a received data interaction from the network.
virtual bool sendMessage (const DtSimInterfaceMessage &message)
 Send a sim interface message.
virtual void addMessageCallback (int type, DtMessageCallbackFcn fcn, void *usrData)
 Add/Remove interface message callback functions.
virtual void removeMessageCallback (int type, DtMessageCallbackFcn fcn, void *usrData)
virtual bool sendSplitContent (const char *pContentBuffer, unsigned int nBufferSize, int nContentType, const DtSimulationAddress &sender, const DtSimulationAddress &recipient, DtSplitMessageHandle &msgHandleReturn)
 Sends oversize message content as multiple DtSimInterfaceMessages with DtIfSplitContent.
virtual bool sendSplitContent (const char *pContentBuffer, unsigned int nBufferSize, int nContentType, const DtSimulationAddress &sender, const DtSimulationAddress &recipient)
 Sends oversize message content as multiple DtSimInterfaceMessages with DtIfSplitContent.
virtual bool isQueuedMessage (const DtSimInterfaceMessage &message)
 Determines if a message should get put into the receive queue.
virtual void processReceiveMessageQueue ()
 Receives any interface messages we have in the myReceiveMessageQueue.
virtual void setQueueMessages (bool)
 Set to false to not queue messages in HLA. Default is true.
virtual bool queueMessages () const
virtual void processReassembledContent (const char *pContent, int nContentSize, int nContentType, const DtSimulationAddress &messageIdSender, int messageIdNumber, const DtSimulationAddress &recipient)
 Reconstitute a message based on previously split content.
virtual bool receiveMessage (const DtSimInterfaceContent &content)
 Call this to receive a message internally – this will not go out over the network.

Static Public Member Functions

static void netMessageCallback (DtDataInteraction *dataInter, void *usr)

Protected Member Functions

bool sendNormalMessage (const DtSimInterfaceMessage &message)
 Send a message, called from sendMessage if message content does not exceed maximum size.
 DtVrfMessageInterface (const DtVrfMessageInterface &orig)
DtVrfMessageInterfaceoperator= (const DtVrfMessageInterface &orig)
 DtVrfMessageInterface ()

Static Protected Member Functions

static bool matchPattern (const DtSimulationAddress &address, const DtSimulationAddress &pattern)
 Utiltiy function that returns true if the address matches the given pattern.
static void postDrainCallback (void *usr)
 calls processSendMessageQueue();

Protected Attributes

DtInterfaceContentFactorymyContentFactory
DtInterfaceMessageExecutivemyMessageExecutive
DtExerciseConn * myExerciseConnection
bool myCreatedInterfaceFactory
DtU32 mySequenceNumber
DtU32 mySessionId
DtSplitMessageCollectormySplitMessageCollector
DtU32 myVrfMessageVersionSupported
 The vrf version is set (by default) from the values found in version.h.
DtList myCallbacks
DtList myReceiveMessageQueue
 Used to hold interface messages which will cause response messages to be sent until after drainInput, when they can safely be sent (with the DMSO RTI).
bool myQueueMessages
 Set to false to not queue messages in HLA. Default is true.

Constructor & Destructor Documentation

DtVrfMessageInterface::DtVrfMessageInterface ( DtExerciseConn *  exConn,
bool  useDefaultInterfaceFactory = true 
)

Contructor.

virtual DtVrfMessageInterface::~DtVrfMessageInterface ( )
virtual

destructor

DtVrfMessageInterface::DtVrfMessageInterface ( const DtVrfMessageInterface orig)
protected
DtVrfMessageInterface::DtVrfMessageInterface ( )
protected

Member Function Documentation

virtual bool DtVrfMessageInterface::init ( )
virtual

Creates all the other pieces.

Reimplemented in DtVrfMsgPrinter.

virtual bool DtVrfMessageInterface::createMessageExecutive ( )
virtual

Creator functions.

These can be overridden to create managed objects that are derived from the base objects we provide.

virtual void DtVrfMessageInterface::createSplitMessageCollector ( )
virtual

Replaces mySplitMessageCollector with a new one.

DtSplitMessageCollector * DtVrfMessageInterface::splitMessageCollector ( )
inlinevirtual
const DtSplitMessageCollector * DtVrfMessageInterface::splitMessageCollector ( ) const
inlinevirtual
virtual bool DtVrfMessageInterface::deliverMessage ( const DtSimInterfaceMessage msg)
virtual

Send a message.

virtual bool DtVrfMessageInterface::receiveMessage ( const DtSimInterfaceMessage msg)
virtual
virtual bool DtVrfMessageInterface::createAndDeliverMessage ( const DtSimulationAddress &  recipient,
const DtSimInterfaceContent content,
bool  overrideTimestampOrder = true 
)
virtual
virtual bool DtVrfMessageInterface::getContentFromNet ( DtDataInteraction *  dataInter,
DtSimInterfaceContent *&  content 
) const
virtual

Create/set objects based on DtDataInteraction information.

virtual bool DtVrfMessageInterface::getContentFromNet ( unsigned  nBufferSize,
int  nContentType,
const char *  pContentBuffer,
DtSimInterfaceContent *&  content 
) const
virtual
virtual bool DtVrfMessageInterface::setContentForNet ( DtDataInteraction *  dataInter,
DtSimInterfaceContent content 
) const
virtual
virtual void DtVrfMessageInterface::setSequence ( DtU32  num)
virtual

Get/Set the sequence number.

DtU32 DtVrfMessageInterface::sequence ( ) const
inlinevirtual

References mySequenceNumber.

void DtVrfMessageInterface::setSessionId ( DtU32  num)
inlinevirtual

Get/Set the session id.

References mySessionId.

DtU32 DtVrfMessageInterface::sessionId ( ) const
inlinevirtual

References mySessionId.

void DtVrfMessageInterface::setVrfMessageVersionSupported ( DtU32  num)
inlinevirtual

Get/Set the vrf message version.

References myVrfMessageVersionSupported.

DtU32 DtVrfMessageInterface::vrfMessageVersionSupported ( ) const
inlinevirtual
virtual bool DtVrfMessageInterface::isMessageVrfVersionSupported ( DtDataInteraction *  ) const
virtual

Returns true if this data interaction passes the message version check.

This will be true if: 1) The Major, Minor and Extra version info match between the version of the message interface or 2) Any installed version check callbacks return true. NOTE that it is important that if a callback returns true it is sure that it will not have a detremental effect in the system. Returning true to support a message that might otherwise would be ignored for version reasons could cause system instability

Note that if a data interaction does not have a version record, the version of that interaction will be assumed to be 0.

virtual void DtVrfMessageInterface::addVrfMessageVersionValidCallback ( DtIsValidVrfMessageVersionFcn  fcn,
void *  usr 
)
virtual

Register vrf message interface version valid.

virtual void DtVrfMessageInterface::removeVrfMessageVersionValidCallback ( DtIsValidVrfMessageVersionFcn  fcn,
void *  usr 
)
virtual
bool DtVrfMessageInterface::isVrfMessageVersionTransparentMessageType ( int  messageType) const
inlinevirtual

Returns true if the given message type is message verson transparent (i.e.

delivered to all message interfaces, regardless of their vrf message version)

References DtVrfObjectDataMessageType.

bool DtVrfMessageInterface::isSessionTransparentMessageType ( int  messageType)
inlinevirtual

Returns true if the given message type is session transparent (i.e.

delivered to all message interfaces, regardless of their session ID)

References DtVrfObjectDataMessageType.

DtExerciseConn * DtVrfMessageInterface::exerciseConn ( )
inlinevirtual

Get the exercise connection ptr.

References myExerciseConnection.

void DtVrfMessageInterface::clearExerciseConn ( )
inlinevirtual

Sets the exercise conn to NULL.

References myExerciseConnection.

virtual DtInterfaceContentFactory* DtVrfMessageInterface::factory ( ) const
virtual

Get/Set the factory used for creating interface content msgs.

virtual void DtVrfMessageInterface::setFactory ( DtInterfaceContentFactory fact)
virtual
virtual DtInterfaceMessageExecutive* DtVrfMessageInterface::messageExecutive ( ) const
virtual

Get the message executive ptr.

virtual const DtSimulationAddress& DtVrfMessageInterface::messageAddress ( ) const
virtual

Get the address that should be used as the sender for all messages originating from the backend.

virtual void DtVrfMessageInterface::receiveMessage ( DtDataInteraction *  dataInter)
virtual

Process a received data interaction from the network.

Reimplemented in DtVrfMsgPrinter.

virtual bool DtVrfMessageInterface::sendMessage ( const DtSimInterfaceMessage message)
virtual

Send a sim interface message.

virtual void DtVrfMessageInterface::addMessageCallback ( int  type,
DtMessageCallbackFcn  fcn,
void *  usrData 
)
virtual

Add/Remove interface message callback functions.

virtual void DtVrfMessageInterface::removeMessageCallback ( int  type,
DtMessageCallbackFcn  fcn,
void *  usrData 
)
virtual
virtual bool DtVrfMessageInterface::sendSplitContent ( const char *  pContentBuffer,
unsigned int  nBufferSize,
int  nContentType,
const DtSimulationAddress &  sender,
const DtSimulationAddress &  recipient,
DtSplitMessageHandle msgHandleReturn 
)
virtual

Sends oversize message content as multiple DtSimInterfaceMessages with DtIfSplitContent.

This is called from sendMessage() when the size of content will exceed the maximum allowable packet size. sendSplitContent() will break up the buffer into chunks and transmit them as DtIfSplitContent, to be reconstructed on the receiving end.

Returns
true if success, false if failure.
Parameters
[in]pContentBufferThe original content, assumed to be oversized.
[in]nBufferSizeThe size of pContentBuffer in bytes.
[in]nContentTypeThe original content type.
[in]senderThe simulator from which the message is being sent.
[in]recipientThe simulator(s) to which the message should be sent.
[out]msgHandleReturnWill contain information about how the DtIfSplitContent messages were prepared.
virtual bool DtVrfMessageInterface::sendSplitContent ( const char *  pContentBuffer,
unsigned int  nBufferSize,
int  nContentType,
const DtSimulationAddress &  sender,
const DtSimulationAddress &  recipient 
)
virtual

Sends oversize message content as multiple DtSimInterfaceMessages with DtIfSplitContent.

This call will redirect to sendSplitContent(...), above.

virtual bool DtVrfMessageInterface::isQueuedMessage ( const DtSimInterfaceMessage message)
virtual

Determines if a message should get put into the receive queue.

virtual void DtVrfMessageInterface::processReceiveMessageQueue ( )
virtual

Receives any interface messages we have in the myReceiveMessageQueue.

This function should only be called by postDrainCallback(). WARNING: Calling this function from within an RTI callback will cause the DMSO RTI to throw concurrent modification exceptions. Use with caution and be sure to test with the DMSO RTI after adding a call to this function.

virtual void DtVrfMessageInterface::setQueueMessages ( bool  )
virtual

Set to false to not queue messages in HLA. Default is true.

virtual bool DtVrfMessageInterface::queueMessages ( ) const
virtual
virtual void DtVrfMessageInterface::processReassembledContent ( const char *  pContent,
int  nContentSize,
int  nContentType,
const DtSimulationAddress &  messageIdSender,
int  messageIdNumber,
const DtSimulationAddress &  recipient 
)
virtual

Reconstitute a message based on previously split content.

static void DtVrfMessageInterface::netMessageCallback ( DtDataInteraction *  dataInter,
void *  usr 
)
static
virtual bool DtVrfMessageInterface::receiveMessage ( const DtSimInterfaceContent content)
virtual

Call this to receive a message internally – this will not go out over the network.

The sender and recipient will be the address of this exercise connection

bool DtVrfMessageInterface::sendNormalMessage ( const DtSimInterfaceMessage message)
protected

Send a message, called from sendMessage if message content does not exceed maximum size.

static bool DtVrfMessageInterface::matchPattern ( const DtSimulationAddress &  address,
const DtSimulationAddress &  pattern 
)
staticprotected

Utiltiy function that returns true if the address matches the given pattern.

Returns true for the following cases: address.site == -1 && address.applicationId == -1 address.site == pattern.site && address.applicationId == -1 address.site == pattern.site && address.applicationId == pattern.applicationId

returns false otherwise

static void DtVrfMessageInterface::postDrainCallback ( void *  usr)
staticprotected

calls processSendMessageQueue();

DtVrfMessageInterface& DtVrfMessageInterface::operator= ( const DtVrfMessageInterface orig)
protected

Member Data Documentation

DtInterfaceContentFactory* DtVrfMessageInterface::myContentFactory
protected
DtInterfaceMessageExecutive* DtVrfMessageInterface::myMessageExecutive
protected
DtExerciseConn* DtVrfMessageInterface::myExerciseConnection
protected

Referenced by clearExerciseConn(), and exerciseConn().

bool DtVrfMessageInterface::myCreatedInterfaceFactory
protected
DtU32 DtVrfMessageInterface::mySequenceNumber
protected

Referenced by sequence().

DtU32 DtVrfMessageInterface::mySessionId
protected

Referenced by sessionId(), and setSessionId().

DtSplitMessageCollector* DtVrfMessageInterface::mySplitMessageCollector
protected

Referenced by splitMessageCollector().

DtU32 DtVrfMessageInterface::myVrfMessageVersionSupported
protected

The vrf version is set (by default) from the values found in version.h.

Call setVrfMessageVersionSupported after construction to change to a new version

Referenced by setVrfMessageVersionSupported(), and vrfMessageVersionSupported().

DtList DtVrfMessageInterface::myCallbacks
protected
DtList DtVrfMessageInterface::myReceiveMessageQueue
protected

Used to hold interface messages which will cause response messages to be sent until after drainInput, when they can safely be sent (with the DMSO RTI).

bool DtVrfMessageInterface::myQueueMessages
protected

Set to false to not queue messages in HLA. Default is true.


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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)