![]() |
VR-Forces 4.3 Class Documentation
|
Messages are received by registering callback functions for the interface message content types of interest.
Objects can register a callback to be fired upon receipt of a given kind of interface message through the DtVrfMessageInterface. Message callback functions are specified as:
The callback receives a pointer to a DtSimMessage (simMsg.h), which is the base class from which DtSimInterfaceMessage is derived. (This is because the radio message callback mechanism use the same kind of callback - but with a different derived type of DtSimMessage, a DtVrfObjectMessage (vrfObjectMessage.h).) The message received can be cast to a DtSimInterfaceMessage so that its contents can be retrieved. A callback must not delete the messages it receives. The specification for the DtVrfMessageInterface member function for adding a callback is:
where:
The following example shows a callback being registered for a DtIfDeleteVrfObject with an instance of a DtSimManager pointed to by mySimManager. It provides its "this" pointer as usrData.
[<< Sending an Interface Message] [Home] [Top of Page] [Creating New Interface Content >>]