VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
DtVrfObjectCommunicationInterface Class Reference

The central class of a DtVrfObject for all communications to and from the object. More...

List of all members.

Public Member Functions

virtual ~DtVrfObjectCommunicationInterface ()
virtual void createRadiosFromDescriptorList ()
 Creates radios from descriptor list.
virtual void createRadiosFromDescriptorList (const DtRadioDescriptorList &descList)
 Creates radios from descriptor list.
virtual void sendSimInternalMessage (DtVrfObjectMessage *message)
 Sends the specified message though the DtSimInternalCommunicationInterface.
virtual DtVrfRadiolookupRadio (int radioId)
virtual DtVrfRadiolookupRadio (const DtString &radioName)
virtual DtVrfRadiodefaultRadio ()
DtSimInternalCommunicationInterfacesimInternalCommunicationInterface ()
virtual void tick ()
 Called each simulation tick.
virtual bool sendRadioMessage (const DtString &radioName, DtVrfObjectMessage *message)
 Sends the specified message though the radio system.
virtual bool sendRadioMessage (int radioId, DtVrfObjectMessage *message)
 Sends though the radio with the specified ID.
virtual bool sendRadioMessage (DtVrfObjectMessage *message)
 Sends though the default radio.
virtual void addMessageCallback (DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called for every message that is received by this interface.
virtual void removeMessageCallback (DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called for every message that is received by this interface.
virtual void addMessageCallback (int type, DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called when a specific type of object message is processed.
virtual void removeMessageCallback (int type, DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called when a specific type of object message is processed.
virtual void addMessageCallbackByCategory (int category, DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called when a specific category of object message is processed.
virtual void removeMessageCallbackByCategory (int category, DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called when a specific category of object message is processed.

Static Public Member Functions

static
DtVrfObjectCommunicationInterface
create (DtVrfObject *vrfObject)
 Calls constructor and init(), and returns the result.

Protected Types

typedef std::map
< DtSymbolString, DtVrfRadio * > 
DtRadioMap

Protected Member Functions

 DtVrfObjectCommunicationInterface (DtVrfObject *vrfObject)
 Use the create() method instead of calling the constructor.
virtual bool init ()
 Virtual init, called from the create() method.

Protected Attributes

DtVrfObjectmyVrfObject
DtVrfObjectMessageExecutive myMessageExecutive
DtSimInternalCommunicationInterfacemySimInternalInterface
DtRadioMap myRadios
DtVrfRadiomyDefaultRadio

Private Member Functions

 DtVrfObjectCommunicationInterface ()
 Not Implemented.
 DtVrfObjectCommunicationInterface (const DtVrfObjectCommunicationInterface &orig)
 Not Implemented.
DtVrfObjectCommunicationInterfaceoperator= (const DtVrfObjectCommunicationInterface &orig)
 Not Implemented.
virtual void processVrfObjectMessage (const DtVrfObjectMessage *msg)
 Callback processing method for messages received from one of the contained message interfaces.
static void vrfObjectMessageCallback (const DtVrfObjectMessage *msg, void *usr)
 Callback processing method for messages received from one of the contained message interfaces.

Detailed Description

The central class of a DtVrfObject for all communications to and from the object.

This class manages all communications on a specific DtVrfObject, though both simulation internal communication, and communication though the simulated radios of the object. All communication is done though the use of the DtVrfObjectMessage class and its subclasses. Callbacks can be registered on this interface which will be called on receipt of a message by this entity. Messages can be sent from this entity by using the message sending functions. These messages may be sent though the SimInternal message mechanism, or the radio message system. Radios will not exist until createRadiosFromDescriptorList() or createRadiosFromDescriptorList(const DtRadioDescriptorList& descList) is called.


Member Typedef Documentation


Constructor & Destructor Documentation

Not Implemented.

Not Implemented.

Use the create() method instead of calling the constructor.


Member Function Documentation

DtVrfObjectCommunicationInterface& DtVrfObjectCommunicationInterface::operator= ( const DtVrfObjectCommunicationInterface orig) [private]

Not Implemented.

Calls constructor and init(), and returns the result.

Upon return, invoke one of these: createRadiosFromDescriptorList(); or createRadiosFromDescriptorList(const DtRadioDescriptorList& descList); to supply radio creation parameters to the communication interface.

virtual bool DtVrfObjectCommunicationInterface::init ( ) [protected, virtual]

Virtual init, called from the create() method.

Creates radios from descriptor list.

Called from DtVrfObject::createCommunicationsInterface()

Creates radios from descriptor list.

Called from DtVrfObject::createCommunicationsInterface(const DtRadioDescriptorList&)

Sends the specified message though the DtSimInternalCommunicationInterface.

Messages sent this way are intended to be internal simulation types of messages, meaning that they will not be sent over simulated radios, and are guaranteed to get to their addressee.

virtual bool DtVrfObjectCommunicationInterface::sendRadioMessage ( const DtString radioName,
DtVrfObjectMessage message 
) [virtual]

Sends the specified message though the radio system.

Specify the name of the radio to use, or send though the default radio. Message sender information will be set in the message.

Returns:
True if the message was sent. Message sending will fail if there is no radio. Sends though the radio named in the call.
virtual bool DtVrfObjectCommunicationInterface::sendRadioMessage ( int  radioId,
DtVrfObjectMessage message 
) [virtual]

Sends though the radio with the specified ID.

Radio IDs are assigned based on their order in the OPE file, starting with 0 and incrementing by 1.

Sends though the default radio.

The default radio is the first radio listed in the radio list for the entity.

virtual DtVrfRadio* DtVrfObjectCommunicationInterface::lookupRadio ( int  radioId) [virtual]
Returns:
A pointer to the radio with the specified ID. Radio IDs are assigned based on their order in the OPE file, starting with 0 and incrementing by 1.
virtual DtVrfRadio* DtVrfObjectCommunicationInterface::lookupRadio ( const DtString radioName) [virtual]
Returns:
A pointer to the radio with the specified name. Radio names are the string identifiers in the OPE file.
Returns:
A pointer to the default radio. This is the same as the radio with ID 0.
Returns:
A pointer to the DtSimInternalCommunicationInterface instance for this object. Use this to register callbacks for messages received only though this interface. (Not though radios that are also configured on this communication interface)

Callback which is called for every message that is received by this interface.

This includes sim internal messages, and messages from any radio.

Callback which is called for every message that is received by this interface.

This includes sim internal messages, and messages from any radio.

virtual void DtVrfObjectCommunicationInterface::addMessageCallback ( int  type,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
) [virtual]

Callback which is called when a specific type of object message is processed.

The type parameter is the content type of the message. This includes sim internal messages, and messages from any radio.

virtual void DtVrfObjectCommunicationInterface::removeMessageCallback ( int  type,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
) [virtual]

Callback which is called when a specific type of object message is processed.

The type parameter is the content type of the message. This includes sim internal messages, and messages from any radio.

virtual void DtVrfObjectCommunicationInterface::addMessageCallbackByCategory ( int  category,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
) [virtual]

Callback which is called when a specific category of object message is processed.

Categories are general message types such as: DtTaskMessageType, DtReportMessageType, DtSetDataRequestMessageType, and DtAdminMessageType. This includes sim internal messages, and messages from any radio.

virtual void DtVrfObjectCommunicationInterface::removeMessageCallbackByCategory ( int  category,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
) [virtual]

Callback which is called when a specific category of object message is processed.

Categories are general message types such as: DtTaskMessageType, DtReportMessageType, DtSetDataRequestMessageType, and DtAdminMessageType. This includes sim internal messages, and messages from any radio.

virtual void DtVrfObjectCommunicationInterface::tick ( ) [virtual]

Called each simulation tick.

Ticks any radios owned by this communication interface.

static void DtVrfObjectCommunicationInterface::vrfObjectMessageCallback ( const DtVrfObjectMessage msg,
void *  usr 
) [static, protected]

Callback processing method for messages received from one of the contained message interfaces.

virtual void DtVrfObjectCommunicationInterface::processVrfObjectMessage ( const DtVrfObjectMessage msg) [protected, virtual]

Callback processing method for messages received from one of the contained message interfaces.


Member Data Documentation


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)