VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | 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...

Classes

struct  DtInfluenceCbInfo

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 sendInfluence (const DtInfluenceInteraction &influence)
 Send an influence interaction.
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)
template<typename messageType >
void addMessageCallback (const messageType &type, DtVrfObjectMessageCallbackFcn fcn, void *usr)
 Callback which is called when a specific type of object message is processed.
template<typename messageType >
void removeMessageCallback (const messageType &type, DtVrfObjectMessageCallbackFcn fcn, void *usr)
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)
virtual void addInfluenceCallback (DtInfluenceInterCb fcn, void *usr)
 Register a callback to be called when an influence interaction is received for this object.
virtual void removeInfluenceCallback (DtInfluenceInterCb fcn, void *usr)

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
std::set< DtInfluenceCbInfomyInfluenceCbs

Private Member Functions

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

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

DtVrfObjectCommunicationInterface::DtVrfObjectCommunicationInterface ( )
private

Not Implemented.

DtVrfObjectCommunicationInterface::DtVrfObjectCommunicationInterface ( const DtVrfObjectCommunicationInterface orig)
private

Not Implemented.

DtVrfObjectCommunicationInterface::DtVrfObjectCommunicationInterface ( DtVrfObject vrfObject)
protected

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

virtual DtVrfObjectCommunicationInterface::~DtVrfObjectCommunicationInterface ( )
virtual

Member Function Documentation

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

Not Implemented.

static DtVrfObjectCommunicationInterface* DtVrfObjectCommunicationInterface::create ( DtVrfObject vrfObject)
static

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 ( )
protectedvirtual

Virtual init, called from the create() method.

virtual void DtVrfObjectCommunicationInterface::createRadiosFromDescriptorList ( )
virtual

Creates radios from descriptor list.

Called from DtVrfObject::createCommunicationsInterface()

virtual void DtVrfObjectCommunicationInterface::createRadiosFromDescriptorList ( const DtRadioDescriptorList descList)
virtual

Creates radios from descriptor list.

Called from DtVrfObject::createCommunicationsInterface(const DtRadioDescriptorList&)

virtual void DtVrfObjectCommunicationInterface::sendSimInternalMessage ( DtVrfObjectMessage message)
virtual

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.

virtual bool DtVrfObjectCommunicationInterface::sendRadioMessage ( DtVrfObjectMessage message)
virtual

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.
virtual DtVrfRadio* DtVrfObjectCommunicationInterface::defaultRadio ( )
virtual
Returns
A pointer to the default radio. This is the same as the radio with ID 0.
DtSimInternalCommunicationInterface* DtVrfObjectCommunicationInterface::simInternalCommunicationInterface ( )
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)
virtual void DtVrfObjectCommunicationInterface::addMessageCallback ( DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
)
virtual

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::removeMessageCallback ( DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
)
virtual
template<typename messageType >
void DtVrfObjectCommunicationInterface::addMessageCallback ( const messageType &  type,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
)
inline

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.

template<typename messageType >
void DtVrfObjectCommunicationInterface::removeMessageCallback ( const messageType &  type,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
)
inline
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
virtual void DtVrfObjectCommunicationInterface::sendInfluence ( const DtInfluenceInteraction influence)
virtual

Send an influence interaction.

virtual void DtVrfObjectCommunicationInterface::addInfluenceCallback ( DtInfluenceInterCb  fcn,
void *  usr 
)
virtual

Register a callback to be called when an influence interaction is received for this object.

virtual void DtVrfObjectCommunicationInterface::removeInfluenceCallback ( DtInfluenceInterCb  fcn,
void *  usr 
)
virtual
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 
)
staticprotected

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

virtual void DtVrfObjectCommunicationInterface::processVrfObjectMessage ( const DtVrfObjectMessage msg)
protectedvirtual
static void DtVrfObjectCommunicationInterface::influenceCallback ( DtInfluenceInteraction msg,
void *  usr 
)
staticprotected

Callback processing method for received influence interactions.

virtual void DtVrfObjectCommunicationInterface::processInfluence ( DtInfluenceInteraction msg)
protectedvirtual

Member Data Documentation

DtVrfObject* DtVrfObjectCommunicationInterface::myVrfObject
protected
DtVrfObjectMessageExecutive DtVrfObjectCommunicationInterface::myMessageExecutive
protected
DtSimInternalCommunicationInterface* DtVrfObjectCommunicationInterface::mySimInternalInterface
protected
DtRadioMap DtVrfObjectCommunicationInterface::myRadios
protected
DtVrfRadio* DtVrfObjectCommunicationInterface::myDefaultRadio
protected
std::set<DtInfluenceCbInfo> DtVrfObjectCommunicationInterface::myInfluenceCbs
protected

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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)