VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtVrfMessageInterface Class Reference
Inheritance diagram for DtVrfMessageInterface:
Inheritance graph
[legend]

Public Member Functions

 DtVrfMessageInterface (DtCommunicationManager *exConn, bool useDefaultInterfaceFactory=true)
 
virtual ~DtVrfMessageInterface ()
 
virtual bool init ()
 
virtual bool createMessageExecutive ()
 
virtual bool deliverMessage (const DtSimInterfaceMessage &msg, bool overrideTimestampOrder=true, bool sendImmediately=false)
 
virtual bool receiveMessage (const DtSimInterfaceMessage &msg)
 
virtual bool createAndDeliverMessage (const DtSimulationAddress &recipient, const DtSimInterfaceContent &content, bool overrideTimestampOrder=true, bool sendImmediately=false)
 
virtual bool getContentFromNet (const makVrfEvents::DtDataEvent *dataInter, DtSimInterfaceContent *&content) const
 
virtual bool getContentFromNet (unsigned nBufferSize, int nContentType, const char *pContentBuffer, DtSimInterfaceContent *&content) const
 
virtual bool setContentForNet (makVrfEvents::DtDataEvent *dataInter, DtSimInterfaceContent *content) const
 
virtual void setSequence (DtU32 num)
 
virtual DtU32 sequence () const
 
virtual void setVrfMessageVersionSupported (DtU32 num)
 
virtual DtU32 vrfMessageVersionSupported () const
 
virtual bool isMessageVrfVersionSupported (const makVrfEvents::DtDataEvent *) const
 
virtual void addVrfMessageVersionValidCallback (DtIsValidVrfMessageVersionFcn fcn, void *usr)
 
virtual void removeVrfMessageVersionValidCallback (DtIsValidVrfMessageVersionFcn fcn, void *usr)
 
virtual bool isVrfMessageVersionTransparentMessageType (int messageType) const
 
virtual bool isSessionTransparentMessageType (int messageType)
 
DtCommunicationManagercommunicationManager () const
 
virtual void setConnectionManager (DtCommunicationManager *cm)
 
virtual void addEvent (const makVrfEvents::DtEvent &)
 
virtual DtInterfaceContentFactoryfactory () const
 
virtual void setFactory (DtInterfaceContentFactory *fact)
 
virtual
DtInterfaceMessageExecutive
messageExecutive () const
 
virtual const DtSimulationAddress & messageAddress () const
 
virtual bool receiveMessage (const makVrfEvents::DtDataEvent *dataInter)
 
virtual bool sendMessage (const DtSimInterfaceMessage &message, bool overrideTimestampOrder, bool sendImmediately=false)
 
virtual void addMessageCallback (int type, DtMessageCallbackFcn fcn, void *usrData)
 
virtual void removeMessageCallback (int type, DtMessageCallbackFcn fcn, void *usrData)
 
virtual void setCommunicationManager (DtCommunicationManager *)
 
virtual void netMessageCallback (const makVrfEvents::DtEvent &)
 
virtual bool receiveMessage (const DtSimInterfaceContent &content)
 
Get/Set the session ID.

The session ID is sent inside of a Data interaction along with a VR-Forces Interface Content message. When the DtVrfMessageInterface receives an Interface Content message, it first looks at this session ID. If it does not match the receiver's session ID, the message is discarded immediately. Otherwise, it is passed along for further processing. If a VR-Forces Interface Content message does not have a session ID, the message is automatically processed.

The default session ID is 1. A session ID of -1 indicates that all VR - Forces content messages should be processed, regardless of session ID. A user can set the session ID via the Launcher or using the -i command line option.

You can specify use of a session ID programmatically using the function DtSimInterfaceContent::setUseSessionId(). This flag is set on a per message basis, not message type basis.

See the VR-Forces Users Guide for more on sessions.

virtual void setSessionId (DtU32 num)
 
virtual DtU32 sessionId () const
 

Static Public Member Functions

static DtVrfMessageInterfacecreate (DtCommunicationManager *exConn, bool useDefaultInterfaceFactory=true)
 
static
DtVrfMessageInterfaceCreatorFcn 
setCreator (DtVrfMessageInterfaceCreatorFcn)
 
static
DtVrfMessageInterfaceCreatorFcn 
creator ()
 

Protected Member Functions

virtual void removeConnections ()
 
virtual void initializeConnections ()
 
virtual bool sendNormalMessage (const DtSimInterfaceMessage &message, bool overrideTimestampOrder, bool sendImmediately=false)
 

Static Protected Member Functions

static bool matchPattern (const DtSimulationAddress &address, const DtSimulationAddress &pattern)
 

Protected Attributes

DtInterfaceContentFactorymyContentFactory
 
DtInterfaceMessageExecutivemyMessageExecutive
 
DtCommunicationManagermyCommunicationManager
 
bool myCreatedInterfaceFactory
 
DtU32 mySequenceNumber
 
DtU32 mySessionId
 
DtU32 myVrfMessageVersionSupported
 
DtList myCallbacks
 

Static Protected Attributes

static
DtVrfMessageInterfaceCreatorFcn 
theCreatorFcn
 

Private Member Functions

 DtVrfMessageInterface (const DtVrfMessageInterface &orig)
 
DtVrfMessageInterfaceoperator= (const DtVrfMessageInterface &orig)
 
 DtVrfMessageInterface ()
 

Constructor & Destructor Documentation

DtVrfMessageInterface::DtVrfMessageInterface ( DtCommunicationManager exConn,
bool  useDefaultInterfaceFactory = true 
)
virtual DtVrfMessageInterface::~DtVrfMessageInterface ( )
virtual

destructor

DtVrfMessageInterface::DtVrfMessageInterface ( const DtVrfMessageInterface orig)
private
DtVrfMessageInterface::DtVrfMessageInterface ( )
private

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 bool DtVrfMessageInterface::deliverMessage ( const DtSimInterfaceMessage msg,
bool  overrideTimestampOrder = true,
bool  sendImmediately = false 
)
virtual

Send a message. If send immediately is true, will not post message but will call sendMessage to send message immediately on the network.

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

Create/set objects based on DtDataInteraction information.

Reimplemented in DtVrfMsgPrinter.

virtual bool DtVrfMessageInterface::getContentFromNet ( unsigned  nBufferSize,
int  nContentType,
const char pContentBuffer,
DtSimInterfaceContent *&  content 
) const
virtual
virtual bool DtVrfMessageInterface::setContentForNet ( makVrfEvents::DtDataEvent 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

References mySessionId.

DtU32 DtVrfMessageInterface::sessionId ( ) const
inlinevirtual

References mySessionId.

virtual void DtVrfMessageInterface::setVrfMessageVersionSupported ( DtU32  num)
virtual

Get/Set the vrf message version.

DtU32 DtVrfMessageInterface::vrfMessageVersionSupported ( ) const
inlinevirtual
virtual bool DtVrfMessageInterface::isMessageVrfVersionSupported ( const makVrfEvents::DtDataEvent ) 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 detrimental 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 version 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.

DtCommunicationManager * DtVrfMessageInterface::communicationManager ( ) const
inline

Get the exercise connection ptr.

References myCommunicationManager.

virtual void DtVrfMessageInterface::setConnectionManager ( DtCommunicationManager cm)
virtual
virtual void DtVrfMessageInterface::addEvent ( const makVrfEvents::DtEvent )
virtual

{@ Adds an event to the event manager

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 bool DtVrfMessageInterface::receiveMessage ( const makVrfEvents::DtDataEvent dataInter)
virtual

Process a received data interaction from the network.

Reimplemented in DtVrfMsgPrinter.

virtual bool DtVrfMessageInterface::sendMessage ( const DtSimInterfaceMessage message,
bool  overrideTimestampOrder,
bool  sendImmediately = false 
)
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 void DtVrfMessageInterface::setCommunicationManager ( DtCommunicationManager )
virtual

Sets the event manager. If an event manager is already created disconnects signals, deletes it (if owned) and assigns new event manager.

virtual void DtVrfMessageInterface::netMessageCallback ( const makVrfEvents::DtEvent )
virtual
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.

static DtVrfMessageInterface* DtVrfMessageInterface::create ( DtCommunicationManager exConn,
bool  useDefaultInterfaceFactory = true 
)
static

Creator that should be used to create an instance of this class. If none defined this class will be created.

static DtVrfMessageInterfaceCreatorFcn DtVrfMessageInterface::setCreator ( DtVrfMessageInterfaceCreatorFcn  )
static

Creator that should be used to create an instance of this class. If none defined this class will be created.

static DtVrfMessageInterfaceCreatorFcn DtVrfMessageInterface::creator ( )
static

Creator that should be used to create an instance of this class. If none defined this class will be created.

virtual void DtVrfMessageInterface::removeConnections ( )
protectedvirtual
virtual void DtVrfMessageInterface::initializeConnections ( )
protectedvirtual
virtual bool DtVrfMessageInterface::sendNormalMessage ( const DtSimInterfaceMessage message,
bool  overrideTimestampOrder,
bool  sendImmediately = false 
)
protectedvirtual

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

Utility 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

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

Member Data Documentation

DtInterfaceContentFactory* DtVrfMessageInterface::myContentFactory
protected
DtInterfaceMessageExecutive* DtVrfMessageInterface::myMessageExecutive
protected
DtCommunicationManager* DtVrfMessageInterface::myCommunicationManager
protected

Referenced by communicationManager().

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

Referenced by sequence().

DtU32 DtVrfMessageInterface::mySessionId
protected

Referenced by sessionId(), and setSessionId().

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 vrfMessageVersionSupported().

DtList DtVrfMessageInterface::myCallbacks
protected
DtVrfMessageInterfaceCreatorFcn DtVrfMessageInterface::theCreatorFcn
staticprotected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)