![]() |
VR-Forces 4.5 Class Documentation
|
Base class for all communication models in VR-Forces. More...

Public Member Functions | |
| virtual | ~DtCommModel () |
| virtual DtString | type () const |
| virtual void | registerRadio (DtVrfRadio *radio) |
| Adds a new radio to the comm model. | |
| virtual void | unregisterRadio (DtVrfRadio *radio) |
| Removes a radio from the comm model. | |
| virtual void | sendMessage (DtVrfObjectMessage *message, DtVrfRadio *sendingRadio) |
| Sends the specified message though the comm model. | |
| virtual void | tick () |
| Method that is called every simulation tick. | |
| virtual bool | publishTransmitters () const |
| Returns true if radios registered to this comm model should publish transmitters. | |
Static Public Member Functions | |
| static DtCommModel * | create (DtCommModelCreationParams ¶ms) |
| Static creator function that can be registered with factories. | |
| static void | setFactory (DtCommModelFactory *factory) |
| Sets the static factory to the specified radio network factory. | |
| static DtCommModel * | createCommModel (const DtString &typeString, DtSimManager *simManager, const DtCommModelDescriptor *descriptor) |
| Uses the static factory to create a new DtCommModel subclass and returns it. | |
Protected Types | |
| typedef std::multimap< DtUUID, DtVrfRadio * > | DtRadioMap |
Protected Member Functions | |
| DtCommModel (DtCommModelCreationParams ¶ms) | |
| Use the create() method instead of calling the constructor. | |
| virtual bool | init () |
| Virtual init() called from the create() method. | |
| virtual DtVrfRadio * | findRadio (const DtUUID &object, int radioId) const |
| Finds a radio registered with this comm model by object UUID and radio ID. | |
| virtual DtVrfRadio * | findRadio (const DtEntityIdentifier &entityId, int radioId) const |
| Finds a radio registered with this comm model by entity ID and radio ID. | |
| virtual void | deliverMessageToRecipients (const DtVrfObjectMessage *message) |
| Finds all local radios to which this message should be delivered and sends the message to those radios. | |
Protected Attributes | |
| DtSimManager * | mySimManager |
| const DtCommModelDescriptor * | myDescriptor |
| DtRadioMap | myRadios |
Static Protected Attributes | |
| static DtCommModelFactory * | theFactory |
Private Member Functions | |
| DtCommModel () | |
| Not implemented. | |
| DtCommModel (const DtCommModel &orig) | |
| DtCommModel & | operator= (const DtCommModel &orig) |
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.
|
protected |
|
private |
Not implemented.
|
private |
|
protected |
Use the create() method instead of calling the constructor.
|
virtual |
|
private |
|
protectedvirtual |
Virtual init() called from the create() method.
Reimplemented in DtSimpleRadioCommModel, MyCommModel, and DtExternalCommModel.
|
static |
Static creator function that can be registered with factories.
Calls the constructor, and init() on the new instance before returning it.
Reimplemented in DtSimpleRadioCommModel, MyCommModel, and DtExternalCommModel.
|
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.
|
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 |