![]() |
VR-Forces 5.0.2 Developer's Guide
|
Base class for all communication models in VR-Forces. A DtCommModel is the central point for modeling communications between VR-Forces entities, such as radio communication. DtCommModels are responsible for moving messages from the sender radio to any appropriate receiver radios, including possibly transporting the messages over the physical network. DtVrfRadio instances register themselves with the DtCommModel when they are initialized, so the comm model always has a list of all the local radios that are connected to it. Radios call sendMessage() when they have a message to be sent though the comm model, and the comm model should call DtVrfRadio::receiveMessage() any time the comm model wishes to deliver a message to a particular radio. This base class implementation will not deliver any messages. A subclass must be used. See Radio Messages for more on simulated radio messages in VR-Forces.

Public Member Functions | |
| virtual | ~DtCommModel () |
| virtual DtString | type () const |
| virtual void | registerRadio (DtVrfRadio *radio) |
| virtual void | unregisterRadio (DtVrfRadio *radio) |
| virtual void | sendMessage (DtVrfObjectMessage *message, DtVrfRadio *sendingRadio) |
| virtual void | tick () |
| virtual bool | publishTransmitters () const |
| virtual bool | sendReceivedCommMessageOnBroadcast () const |
| virtual void | clearPendingRadioMessages () |
Static Public Member Functions | |
| static DtCommModel * | create (DtCommModelCreationParams ¶ms) |
| static void | setFactory (DtCommModelFactory *factory) |
| static DtCommModel * | createCommModel (const DtString &typeString, DtSimulationServices *simManager, const DtCommModelDescriptor *descriptor) |
Protected Types | |
| typedef std::multimap< DtUUID, DtVrfRadio * > | DtRadioMap |
Protected Member Functions | |
| DtCommModel (DtCommModelCreationParams ¶ms) | |
| virtual bool | init () |
| virtual DtVrfRadio * | findRadio (const DtUUID &object, int radioId) const |
| virtual DtVrfRadio * | findRadio (const DtEntityIdentifier &entityId, int radioId) const |
| virtual void | deliverMessageToRecipients (const DtVrfObjectMessage *message) |
Protected Attributes | |
| DtSimulationServices * | mySimulationServices |
| const DtCommModelDescriptor * | myDescriptor |
| DtRadioMap | myRadios |
| tbb::spin_rw_mutex | myMutex |
Static Protected Attributes | |
| static DtCommModelFactory * | theFactory |
Private Member Functions | |
| DtCommModel () | |
| DtCommModel (const DtCommModel &orig) | |
| DtCommModel & | operator= (const DtCommModel &orig) |
|
protected |
|
private |
Not implemented.
|
private |
Not implemented.
|
protected |
Use the create() method instead of calling the constructor.
|
virtual |
|
private |
Not implemented.
|
protectedvirtual |
Virtual init() called from the create() method.
Reimplemented in DtSimpleRadioCommModel, DtExternalCommModel, and MyCommModel.
|
static |
Static creator function that can be registered with factories. Calls the constructor, and init() on the new instance before returning it.
|
virtual |
Reimplemented in DtSimpleRadioCommModel, MyCommModel, and DtExternalCommModel.
|
virtual |
Adds a new radio to the comm model. A radio must be part of the comm model in order to send or receive messages.
Reimplemented in DtSimpleRadioCommModel, MyCommModel, and DtExternalCommModel.
|
virtual |
Removes a radio from the comm model.
|
virtual |
Sends the specified message though the comm model. This is the entry point for a message into the network. This should typically only be called by radios that are part of the network. A pointer to the sending radio is passed in, in case the model needs to use parameters from this radio to transmit the message.
Reimplemented in DtSimpleRadioCommModel, and DtExternalCommModel.
|
virtual |
Method that is called every simulation tick. Base class implementation does nothing.
Reimplemented in DtExternalCommModel, and DtSimpleRadioCommModel.
|
static |
Sets the static factory to the specified radio network factory.
|
static |
Uses the static factory to create a new DtCommModel subclass and returns it.
|
virtual |
Returns true if radios registered to this comm model should publish transmitters.
|
virtual |
Returns true if this model should send a message that the radio message was received on broadcast.
|
virtual |
Called to clear any pending radio messages in the comm model map that are waiting to be sent. This method is called when a scenario is being rolled back/rewound.
Reimplemented in DtSimpleRadioCommModel.
|
protectedvirtual |
Finds a radio registered with this comm model by object UUID and radio ID.
|
protectedvirtual |
Finds a radio registered with this comm model by entity ID and radio ID.
|
protectedvirtual |
Finds all local radios to which this message should be delivered and sends the message to those radios. Radios must be registered with this DtCommModel. Messages that are sent to DtVrfObjectMessageSendToAll are delivered to all local radios except the sender.
Reimplemented in DtSimpleRadioCommModel.
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |