![]() |
VR-Exchange 2.6 API Documentation
|
Base class for all broker objects. More...

Classes | |
| struct | CallbackPair |
Public Types | |
| typedef bool(* | PluginInitMethod )(DtBroker *) |
| typedef void(* | PluginReloadMethod )(DtBroker *) |
| typedef void(* | PluginPostInitMethod )(DtBroker *) |
| typedef void(* | BrokerReloadCallback )(void *) |
| typedef DtTranslatorFactory < DtInteractionTranslator > | DtInteractionTranslatorFactory |
| typedef DtTranslatorFactory < DtObjectTranslator > | DtObjectTranslatorFactory |
Public Member Functions | |
| virtual | ~DtBroker () |
| Default DTOR. | |
| virtual DtPortalConnection * | portalConnection () const |
| Returns a pointer to the portal connection. | |
| virtual void | initializeUi (DtGenericUserInterface *ui) |
| Function called to start the GUI, this could be Qt, Text, Null, or anything else. | |
| virtual void | startBroker () |
| Tells the broker to start processing messages and translating. | |
| virtual void | launchGui () |
| Function which is called when VR-Exchange wants a display launched for this broker. | |
| virtual void | launchInfoGui () |
| Override of the pure virtual function from DtBroker. | |
| virtual DtInteractionTranslatorFactory * | interactionTranslatorFactory () |
| Returns a pointer to the interactionTranslatorFactory. | |
| virtual DtObjectTranslatorFactory * | objectTranslatorFactory () |
| Returns a pointer to the objectTranslatorFactory. | |
| virtual void | reloadTranslatorDebugging () |
| Function used to make the broker reload translator debugging settings. | |
| virtual void | reloadBrokerSettings () |
| Function used to make the broker reload its broker initialization settings. | |
| virtual const DtString | brokerName () const |
| Returns the brokers name. | |
| virtual DtU16 | brokerId () const |
| Returns the brokers ID. | |
| virtual DtTime | simTime () const |
| Returns the current simulation time. | |
| virtual void | updateSimTime () const |
| Called to advance the simTime. | |
| virtual bool | isRunning () const |
| Returns whether the broker is processing messages or not. | |
| virtual bool | isTimeToQuit () const |
| Indicates this broker needs to shutdown. | |
| virtual bool | isTranslatorDebuggingOn (const DtString &name) const |
| Returns true if debugging is enabled for the given translator. | |
| virtual DtTime | pollingInterval () |
| Returns the amount of time that the broker is asking to be polled. | |
| virtual DtBrokerInitializer * | brokerInitializer () const |
| Returns the brokerInitializer object used to create this broker. | |
| virtual void | tick () |
| Tick is called by processEvents, this will tick all portal translators. | |
| virtual void | processEvents () |
| ProcessEvents should be called every frame. | |
| virtual DtFilterManager & | objectFilters () |
| Accessor for the broker's object filter manager. | |
| virtual const DtFilterManager & | objectFilters () const |
| Accessor for the broker's object filter manager (const). | |
| virtual void | setBrokerId (int id) |
| Set the internal broker ID values of this broker. | |
| virtual void | shutdownWithError (const DtString &error) |
| Sends an error message to the queue manager, then marks us for shutdown. | |
| virtual DtObjectTranslator * | getObjectTranslator (const DtString &name) |
| get an object translator by name | |
| virtual DtInteractionTranslator * | getInteractionTranslator (const DtString &name) |
| get an interaction translator by name | |
| virtual void | loadTranslators () |
| Updates the GUI with the translators being loaded and initializes them. | |
| virtual void | initializeTranslators (DtStringSet &failedTranslators) |
| Loads the translators and populates the list with failures. | |
| virtual void | loadKnownObjectTranslators (DtStringSet &failedTranslators) |
| Creates an interaction translator instance for each translator within myObjectTranslatorFactory. | |
| virtual void | loadKnownInteractionTranslators (DtStringSet &failedTranslators) |
| Creates an interaction translator instance for each translator within myInteractionTranslatorFactory. | |
| virtual bool | loadObjectTranslator (const DtString &translatorName) |
| Creates a translator instance using the translator name passed. | |
| virtual bool | loadInteractionTranslator (const DtString &translatorName) |
| Creates an interaction translator instance using the translator name passed. | |
| virtual void | shutdown () |
| Shut down the broker. | |
| virtual void | addBrokerReloadCallback (BrokerReloadCallback cb, void *usr) |
| Add a callback to be called when the broker restarts. | |
| virtual void | callBrokerReloadCallbacks () |
| Call all registered broker reload callbacks. | |
Protected Types | |
| typedef std::map< const DtString, DtInteractionTranslator * > | NamedInteractionTranslatorMap |
| typedef std::map< const DtString, DtObjectTranslator * > | NamedObjectTranslatorMap |
| typedef std::map< std::string, DtDynamicLibrary * > | BrokerPluginsMap |
| typedef std::list< CallbackPair > | CallbackPairList |
Protected Member Functions | |
| DtBroker () | |
| CTOR. | |
| virtual void | initialize (DtBrokerInitializer *init) |
| Performs one time initialization logic and calls ::initialize(). | |
| virtual void | initialize () |
| Performs broker initialization logic. | |
| virtual void | logBrokerSettings (DtBrokerInitializer *init) |
| Output important broker settings to the log file on initialization. | |
| virtual void | initializeDebuggedAndDisabledFromInit () |
| Sets our disabled / debugged sets from the initializer. | |
| virtual void | initFileLogging (const DtBrokerInitializer &init) |
| Log all output to the filename logFileName. | |
| virtual void | obtainLock () |
| Checks lock file to determine if broker is already running. | |
| virtual void | loadBrokerPlugins () |
| Loads all plugins in the broker's plugin directory. | |
| virtual void | scanForPlugins (const std::string &dir, std::list< std::string > &files) const |
| Scans the given directory for plugin libraries and returns them in a list. | |
| virtual void | postInitializePlugins () |
| Perform post-initialization logic for plugins. | |
| virtual void | reloadBrokerPlugins () |
| Function used to tell broker plugins a reload is occurring. | |
| virtual void | initPortalConnection (const DtBrokerInitializer &init) |
| Initializes the Portal Connection. | |
| virtual void | initStatisticsManager (const DtBrokerInitializer &init) |
| Initialize the statistics manager. | |
| virtual void | stopFileLogging () |
| Cleanup this broker's members. | |
| virtual void | processShutdownRequest (const DtPortalBrokerShutdownRequestMessage &obj) |
| Called by the static method shutdownRequestCb to notify this broker to stop. | |
| virtual void | processRestartRequest (bool shouldEnableOneToOne) |
| Called by the restart request callback to notify this broker to restart. | |
| virtual void | reportLoadTranslatorFailures (const DtStringSet &failedTranslators) const |
| Display errors to end-user. | |
| virtual void | objectDiscovered (const DtBrokerObject *brokerObject) |
| Called through a static callback when a DtBrokerObject is discovered. | |
| virtual void | objectUpdated (const DtBrokerObject *brokerObject) |
| Called through a static callback when a DtBrokerObject is updated. | |
| virtual void | objectRemoved (const DtBrokerObject *brokerObject) |
| Called through a static callback when a DtBrokerObject is removed. | |
| virtual bool | addTranslator (DtInteractionTranslator *intTrans, bool reflectEnabled, bool publishEnabled) |
| Adds an already created interactionTranslator to the brokers list. | |
| virtual bool | addTranslator (DtObjectTranslator *objTrans, bool reflectEnabled, bool publishEnabled) |
| Adds an already created objectTranslator to the brokers list. | |
Static Protected Member Functions | |
| static void | shutdownRequestCb (const DtPortalBrokerShutdownRequestMessage &obj, void *usr) |
| Portal Connection Callback, registered in the CTOR. | |
| static void | processDisableOneToOneCb (const DtPortalBrokerDisableOneToOneMessage &msg, void *usr) |
| Portal broker process disable One to One mapping callback. | |
| static void | processEnableOneToOneCb (const DtPortalBrokerEnableOneToOneMessage &msg, void *usr) |
| Portal broker process enable One to One mapping callback. | |
| static void | startRequestCb (const DtBrokerStartRequest &obj, void *usr) |
| Portal Connection Callback, registered in the CTOR. | |
| static void | launchGuiRequestCb (const DtBrokerLaunchGuiRequest &obj, void *usr) |
| Portal Connection Callback, registered in the CTOR. | |
| static void | objectDiscoveredCallback (const DtBrokerObject *brokerObject, void *usr) |
| static void | objectUpdatedCallback (const DtBrokerObject *brokerObject, void *usr) |
| static void | objectRemovedCallback (const DtBrokerObject *brokerObject, void *usr) |
Static Protected Attributes | |
| static const char * | theVrxPluginInitMethod |
| static const char * | theVrxPluginReloadMethod |
| static const char * | theVrxPluginPostInitMethod |
Private Member Functions | |
| DtBroker (const DtBroker &other) | |
| Class not copyable, not implemented. | |
| DtBroker & | operator= (const DtBroker &other) |
| Class not copyable, not implemented. | |
Filtering methods. | |
| virtual void | filterObjectCallback (const DtFilterObjectMessage &object) |
| Processes DtFilterObjectMessage messages. | |
| static void | filterObjectCallback (const DtFilterObjectMessage &object, void *userData) |
| Callback method for processing DtFilterObjectMessage messages. | |
Base class for all broker objects.
A Broker object is the central component in broker applications. It manages the portal data exchange interface by creating a DtPortalConnection and initializing it in a consistent way using an MTL file and command line arguments. The DtBrokerInstance registers for control messages from the Portal and will report quit events, as well as open the UI upon request. This class is defined in libBroker
|
protected |
| typedef void(* MAKVrExchange::DtBroker::BrokerReloadCallback)(void *) |
|
protected |
| typedef DtTranslatorFactory<DtInteractionTranslator> MAKVrExchange::DtBroker::DtInteractionTranslatorFactory |
|
protected |
|
protected |
| typedef bool(* MAKVrExchange::DtBroker::PluginInitMethod)(DtBroker *) |
| typedef void(* MAKVrExchange::DtBroker::PluginPostInitMethod)(DtBroker *) |
| typedef void(* MAKVrExchange::DtBroker::PluginReloadMethod)(DtBroker *) |
|
protected |
CTOR.
|
virtual |
Default DTOR.
|
private |
Class not copyable, not implemented.
|
virtual |
Add a callback to be called when the broker restarts.
|
protectedvirtual |
Adds an already created interactionTranslator to the brokers list.
|
protectedvirtual |
Adds an already created objectTranslator to the brokers list.
|
virtual |
Returns the brokers ID.
|
inlinevirtual |
Returns the brokerInitializer object used to create this broker.
References myBrokerInitializer.
|
inlinevirtual |
Returns the brokers name.
References MAKVrExchange::DtBrokerInitializer::brokerName(), and myBrokerInitializer.
|
virtual |
Call all registered broker reload callbacks.
|
staticprotected |
Callback method for processing DtFilterObjectMessage messages.
Note: Calls the virtual filterObjectCallback(..) method.
|
protectedvirtual |
Processes DtFilterObjectMessage messages.
Calls filterObjectByName or filterObjectByType depending on the filter type specified in the DtFilterObjectMessage message.
|
virtual |
get an interaction translator by name
|
virtual |
get an object translator by name
|
protectedvirtual |
Log all output to the filename logFileName.
|
protectedvirtual |
Performs one time initialization logic and calls ::initialize().
Initializer should have already parsed its command line and config file.
Reimplemented in DtSimpleBroker.
|
protectedvirtual |
Performs broker initialization logic.
|
protectedvirtual |
Sets our disabled / debugged sets from the initializer.
Should only be done at startup and when user indicates they want to restart the broker.
|
virtual |
Loads the translators and populates the list with failures.
Reimplemented in MAKVrExchange::DtRprBroker::DtRprBroker.
|
virtual |
Function called to start the GUI, this could be Qt, Text, Null, or anything else.
|
protectedvirtual |
Initializes the Portal Connection.
|
protectedvirtual |
Initialize the statistics manager.
|
virtual |
Returns a pointer to the interactionTranslatorFactory.
|
virtual |
Returns whether the broker is processing messages or not.
|
virtual |
Indicates this broker needs to shutdown.
|
virtual |
Returns true if debugging is enabled for the given translator.
|
virtual |
Function which is called when VR-Exchange wants a display launched for this broker.
|
staticprotected |
Portal Connection Callback, registered in the CTOR.
|
virtual |
Override of the pure virtual function from DtBroker.
This function is called when VR-Exchange wants us to launch a Dialog Box but is not connected to the internet
|
protectedvirtual |
Loads all plugins in the broker's plugin directory.
|
virtual |
Creates an interaction translator instance using the translator name passed.
The translator will only be created if the name is not on the broker Initializer's disabledTranslator list.
|
virtual |
Creates an interaction translator instance for each translator within myInteractionTranslatorFactory.
|
virtual |
Creates an interaction translator instance for each translator within myObjectTranslatorFactory.
|
virtual |
Creates a translator instance using the translator name passed.
The Translator will not be created if the name is in the broker initializer's disabledTranslator list.
|
virtual |
Updates the GUI with the translators being loaded and initializes them.
|
protectedvirtual |
Output important broker settings to the log file on initialization.
Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtRprBroker::DtRprBroker, MAKVrExchange::DtDisBroker::DtDisBroker, and MAKVrExchange::DtDdsBroker::DtDdsBroker.
|
protectedvirtual |
Called through a static callback when a DtBrokerObject is discovered.
|
staticprotected |
|
inlinevirtual |
Accessor for the broker's object filter manager.
References myFilterManager.
|
inlinevirtual |
Accessor for the broker's object filter manager (const).
References myFilterManager.
|
protectedvirtual |
Called through a static callback when a DtBrokerObject is removed.
|
staticprotected |
|
virtual |
Returns a pointer to the objectTranslatorFactory.
|
protectedvirtual |
Called through a static callback when a DtBrokerObject is updated.
|
staticprotected |
|
protectedvirtual |
Checks lock file to determine if broker is already running.
Class not copyable, not implemented.
|
inlinevirtual |
Returns the amount of time that the broker is asking to be polled.
References myBrokerInitializer, and MAKVrExchange::DtBrokerInitializer::pollingInterval().
|
virtual |
Returns a pointer to the portal connection.
|
protectedvirtual |
Perform post-initialization logic for plugins.
|
staticprotected |
Portal broker process disable One to One mapping callback.
|
staticprotected |
Portal broker process enable One to One mapping callback.
|
virtual |
ProcessEvents should be called every frame.
|
protectedvirtual |
Called by the restart request callback to notify this broker to restart.
|
protectedvirtual |
Called by the static method shutdownRequestCb to notify this broker to stop.
|
protectedvirtual |
Function used to tell broker plugins a reload is occurring.
|
virtual |
Function used to make the broker reload its broker initialization settings.
|
virtual |
Function used to make the broker reload translator debugging settings.
|
protectedvirtual |
Display errors to end-user.
Displays a dialog box to the end-user listing translators that failed to load along with possible causes.
| [in] | failedTranslators | collection of failed object and interaction translators. If it is empty, no error message is displayed. |
|
protectedvirtual |
Scans the given directory for plugin libraries and returns them in a list.
|
virtual |
Set the internal broker ID values of this broker.
In previous VR-Exchange versions, this was set by the user, now it is set by an internal TCP stream between the Portal and the DIS broker.
|
virtual |
Shut down the broker.
Turns off all translators. Can be overridden by brokers to perform additional shut down logic.
Reimplemented in MAKVrExchange::DtRprBroker::DtRprBroker, MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtDisBroker::DtDisBroker, MAKVrExchange::DtDdsBroker::DtDdsBroker, MAKVrExchange::DtVrlBroker< T_ExConn >, MAKVrExchange::DtVrlBroker< DtDdsDomainConnection >, and MAKVrExchange::DtVrlBroker< DtExerciseConn >.
|
staticprotected |
Portal Connection Callback, registered in the CTOR.
|
virtual |
Sends an error message to the queue manager, then marks us for shutdown.
|
virtual |
Returns the current simulation time.
This is associated with the PConnection clock and is not synchronized beyond this broker.
Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker.
|
virtual |
Tells the broker to start processing messages and translating.
Initializes the translators and sends a broker started message to the Portal.
Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtDisBroker::DtDisBroker, MAKVrExchange::DtRprBroker::DtRprBroker, and MAKVrExchange::DtDdsBroker::DtDdsBroker.
|
staticprotected |
Portal Connection Callback, registered in the CTOR.
|
protectedvirtual |
Cleanup this broker's members.
|
virtual |
Tick is called by processEvents, this will tick all portal translators.
Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtDdsBroker::DtDdsBroker, MAKVrExchange::DtDisBroker::DtDisBroker, MAKVrExchange::DtRprBroker::DtRprBroker, and DtSimpleBroker.
|
virtual |
Called to advance the simTime.
Reimplemented in MAKVrExchange::DtRprBroker::DtRprBroker, and MAKVrExchange::DtDisBroker::DtDisBroker.
|
protected |
|
protected |
Referenced by brokerInitializer(), brokerName(), and pollingInterval().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by objectFilters().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |