![]() |
VR-Exchange 2.1 API Documentation
|
The DIS Broker API is in the libDisBroker library.
It is built on the Broker API. The DIS Broker Library is the full implementation of the DIS broker. DtDisBroker (disBroker.h) is the central class in libDisBroker. It is a subclass of DtBroker that connects to a DIS execution using a VR-Link DtExerciseConn. The DtDisBroker instance also opens a connection to Qt to process the broker's GUI. This instance is created by DtDisBrokerApp (disBrokerApp.h). The DtDisBroker is responsible for creating object and interaction translators, configuring the DIS connection through a DtDisBrokerInitializer (disBrokerInitializer.h) instance, and giving each translator processor time by calling tick().
The DtDisBroker instance manages DtTranslator. There are two subclasses of DtTranslator: DtInteractionTranslator and DtObjectTranslator. The DtDisBroker creates a translator for each message type. Each translator is responsible for translating its message type to a DIS class and back.
Interaction translators register for updates for their interaction type. They translate the updates and pass them to their local DIS exercise or the Portal, as appropriate.
Object translators register for object discovery, update, and removal messages, then translate and publish them to the Portal or DIS exercise. A DtBrokerObject is maintained for every object the translator knows about. The broker object contains pointers to the reflected object, the publisher, and other data about the object, such as whether it has been discovered or filtered.
You can create translators in the following ways:
When you create a translator class, you must create a static function called translatorName() that returns a c-string. For example, the DtAggregateTranslator class's code is equivalent to the following:
If you want to override this class, you add the same function to your class:
If you want to add a new type of translator, you provide a new name:
The translator name is displayed on the Translators page of a connection's information dialog box.
Brokers that want to replace a translator should register their translator with the factory after creating the DtDisBroker. The broker should then tell the DtDisBroker instance to load all its translators. For example, code to replace the Aggregate translator would look like this:
[<< The HLA Broker API] [Home] [Top of Page] [The TENA Broker API >>]