VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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 DtLocalObject for all communications to and from the object. This class manages all communications on a specific DtLocalObject, 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.

Public Member Functions

virtual DtSimulationServicessimulationServices ()
 
virtual ~DtVrfObjectCommunicationInterface ()
 
virtual void createRadiosFromDescriptorList ()
 
virtual void createRadiosFromDescriptorList (const DtRadioDescriptorList &descList)
 
virtual void sendSimInternalMessage (DtVrfObjectMessage *message)
 
virtual DtVrfRadiolookupRadio (int radioId)
 
virtual const DtVrfRadiolookupRadio (int radioId) const
 
virtual DtVrfRadiolookupRadio (const DtString &radioName)
 
virtual const DtVrfRadiolookupRadio (const DtString &radioName) const
 
virtual DtVrfRadiodefaultRadio ()
 
virtual const DtVrfRadiodefaultRadio () const
 
DtSimInternalCommunicationInterfacesimInternalCommunicationInterface ()
 
virtual void tick ()
 
virtual bool sendRadioMessage (const DtString &radioName, DtVrfObjectMessage *message)
 
virtual bool sendRadioMessage (int radioId, DtVrfObjectMessage *message)
 
virtual bool sendRadioMessage (DtVrfObjectMessage *message)
 
virtual void addMessageCallback (DtVrfObjectMessageCallbackFcn fcn, void *usr) const
 
virtual void removeMessageCallback (DtVrfObjectMessageCallbackFcn fcn, void *usr) const
 
template<typename messageType >
void addMessageCallback (const messageType &type, DtVrfObjectMessageCallbackFcn fcn, void *usr) const
 
template<typename messageType >
void removeMessageCallback (const messageType &type, DtVrfObjectMessageCallbackFcn fcn, void *usr) const
 
virtual void addMessageCallbackByCategory (int category, DtVrfObjectMessageCallbackFcn fcn, void *usr) const
 
virtual void removeMessageCallbackByCategory (int category, DtVrfObjectMessageCallbackFcn fcn, void *usr) const
 

Static Public Member Functions

static
DtVrfObjectCommunicationInterface
create (DtLocalObject *vrfObject)
 

Protected Types

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

Protected Member Functions

 DtVrfObjectCommunicationInterface (DtLocalObject *vrfObject)
 
virtual bool init ()
 

Protected Attributes

DtLocalObjectmyLocalObject
 
DtVrfObjectMessageExecutive myMessageExecutive
 
DtSimInternalCommunicationInterfacemySimInternalInterface
 
DtRadioMap myRadios
 
DtVrfRadiomyDefaultRadio
 

Private Member Functions

 DtVrfObjectCommunicationInterface ()
 
 DtVrfObjectCommunicationInterface (const DtVrfObjectCommunicationInterface &orig)
 
DtVrfObjectCommunicationInterfaceoperator= (const DtVrfObjectCommunicationInterface &orig)
 
virtual void processVrfObjectMessage (const DtVrfObjectMessage *msg)
 
static void vrfObjectMessageCallback (const DtVrfObjectMessage *msg, void *usr)
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtVrfObjectCommunicationInterface::DtVrfObjectCommunicationInterface ( )
private

Not Implemented.

DtVrfObjectCommunicationInterface::DtVrfObjectCommunicationInterface ( const DtVrfObjectCommunicationInterface orig)
private

Not Implemented.

DtVrfObjectCommunicationInterface::DtVrfObjectCommunicationInterface ( DtLocalObject 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 ( DtLocalObject 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 DtSimulationServices* DtVrfObjectCommunicationInterface::simulationServices ( )
virtual
virtual void DtVrfObjectCommunicationInterface::createRadiosFromDescriptorList ( )
virtual

Creates radios from descriptor list. Called from DtLocalObject::createCommunicationsInterface()

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

Creates radios from descriptor list. Called from DtLocalObject::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 const DtVrfRadio* DtVrfObjectCommunicationInterface::lookupRadio ( int  radioId) const
virtual
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 const DtVrfRadio* DtVrfObjectCommunicationInterface::lookupRadio ( const DtString radioName) const
virtual
virtual DtVrfRadio* DtVrfObjectCommunicationInterface::defaultRadio ( )
virtual
Returns
A pointer to the default radio. This is the same as the radio with ID 0.
virtual const DtVrfRadio* DtVrfObjectCommunicationInterface::defaultRadio ( ) const
virtual
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 
) const
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 
) const
virtual

Callback which is called for every message that is received by this interface. This includes sim internal messages, and messages from any radio.

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

virtual void DtVrfObjectCommunicationInterface::addMessageCallbackByCategory ( int  category,
DtVrfObjectMessageCallbackFcn  fcn,
void *  usr 
) const
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 
) const
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 
)
staticprotected

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

virtual void DtVrfObjectCommunicationInterface::processVrfObjectMessage ( const DtVrfObjectMessage msg)
protectedvirtual

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

Member Data Documentation

DtLocalObject* DtVrfObjectCommunicationInterface::myLocalObject
protected
DtVrfObjectMessageExecutive DtVrfObjectCommunicationInterface::myMessageExecutive
mutableprotected
DtSimInternalCommunicationInterface* DtVrfObjectCommunicationInterface::mySimInternalInterface
protected
DtRadioMap DtVrfObjectCommunicationInterface::myRadios
protected
DtVrfRadio* DtVrfObjectCommunicationInterface::myDefaultRadio
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)