![]() |
VR-Forces 4.0.4 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 < DtEntityIdentifier, 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 * | findRadioByObjectName (const DtString &objectName, int radioId) const |
| Finds a radio registered with this comm model by object name 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. | |
| virtual bool | addressMatchesObject (const DtString &addressText, bool addressIsEchelonId, const DtVrfObject *object) |
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) | |
| Not implemented. | |
| DtCommModel & | operator= (const DtCommModel &orig) |
| Not implemented. | |
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.
typedef std::multimap<DtEntityIdentifier, DtVrfRadio*> DtCommModel::DtRadioMap [protected] |
| DtCommModel::DtCommModel | ( | ) | [private] |
Not implemented.
| DtCommModel::DtCommModel | ( | const DtCommModel & | orig | ) | [private] |
Not implemented.
| DtCommModel::DtCommModel | ( | DtCommModelCreationParams & | params | ) | [protected] |
Use the create() method instead of calling the constructor.
| virtual DtCommModel::~DtCommModel | ( | ) | [virtual] |
| DtCommModel& DtCommModel::operator= | ( | const DtCommModel & | orig | ) | [private] |
Not implemented.
| virtual bool DtCommModel::init | ( | ) | [protected, virtual] |
Virtual init() called from the create() method.
Reimplemented in DtSimpleRadioCommModel, DtExternalCommModel, and MyCommModel.
| static DtCommModel* DtCommModel::create | ( | DtCommModelCreationParams & | params | ) | [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, DtExternalCommModel, and MyCommModel.
| virtual DtString DtCommModel::type | ( | ) | const [virtual] |
Reimplemented in DtSimpleRadioCommModel, MyCommModel, and DtExternalCommModel.
| virtual void DtCommModel::registerRadio | ( | DtVrfRadio * | radio | ) | [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 void DtCommModel::unregisterRadio | ( | DtVrfRadio * | radio | ) | [virtual] |
Removes a radio from the comm model.
| virtual void DtCommModel::sendMessage | ( | DtVrfObjectMessage * | message, |
| DtVrfRadio * | sendingRadio | ||
| ) | [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 void DtCommModel::tick | ( | ) | [virtual] |
Method that is called every simulation tick.
Base class implementation does nothing.
Reimplemented in DtExternalCommModel, and DtSimpleRadioCommModel.
| static void DtCommModel::setFactory | ( | DtCommModelFactory * | factory | ) | [static] |
Sets the static factory to the specified radio network factory.
| static DtCommModel* DtCommModel::createCommModel | ( | const DtString & | typeString, |
| DtSimManager * | simManager, | ||
| const DtCommModelDescriptor * | descriptor | ||
| ) | [static] |
Uses the static factory to create a new DtCommModel subclass and returns it.
| virtual bool DtCommModel::publishTransmitters | ( | ) | const [virtual] |
Returns true if radios registered to this comm model should publish transmitters.
| virtual DtVrfRadio* DtCommModel::findRadioByObjectName | ( | const DtString & | objectName, |
| int | radioId | ||
| ) | const [protected, virtual] |
Finds a radio registered with this comm model by object name and radio ID.
| virtual DtVrfRadio* DtCommModel::findRadio | ( | const DtEntityIdentifier & | entityId, |
| int | radioId | ||
| ) | const [protected, virtual] |
Finds a radio registered with this comm model by entity ID and radio ID.
| virtual void DtCommModel::deliverMessageToRecipients | ( | const DtVrfObjectMessage * | message | ) | [protected, virtual] |
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.
| virtual bool DtCommModel::addressMatchesObject | ( | const DtString & | addressText, |
| bool | addressIsEchelonId, | ||
| const DtVrfObject * | object | ||
| ) | [protected, virtual] |
DtCommModelFactory* DtCommModel::theFactory [static, protected] |
DtSimManager* DtCommModel::mySimManager [protected] |
const DtCommModelDescriptor* DtCommModel::myDescriptor [protected] |
DtRadioMap DtCommModel::myRadios [protected] |