VR-Exchange 2.2 API Documentation
List of all members | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
MAKVrExchange::DtBroker Class Reference

Base class for all broker objects. More...

Inheritance diagram for MAKVrExchange::DtBroker:
Inheritance graph
[legend]

Public Types

typedef bool(* PluginInitMethod )(DtBroker *)

Public Member Functions

virtual ~DtBroker ()
 Default DTOR.
virtual DtPortalConnectionportalConnection () const
 Returns a pointer to the portal connection.
virtual void launchGui ()=0
 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 void reloadBrokerSettings ()
 Function used to make the broker reload its broker initialization settings.
virtual void reloadFilterSettings ()
 Function used to make the broker reload its filter 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 isTimeToQuit () const
 Indicates this broker needs to shutdown.
virtual bool isTranslatorDebuggingOn (const DtString &name) const
 Returns true if the translator name is set for debugging.
virtual bool isTranslatorDisabled (const DtString &name) const
 Returns true if the translator name is disabled.
virtual DtTime pollingInterval ()
 Returns the amount of time that the broker is asking to be polled.
virtual DtBrokerInitializerbrokerInitializer () const
 Returns the brokerInitializer object used to create this broker.
virtual void tick ()=0
 Tick is called by processEvents, brokers should override to do any periodic processing.
virtual void processEvents ()
 ProcessEvents should be called every frame. This should not be overrided.
virtual DtFilterManagerobjectFilters ()
 Accessor for the broker's object filter manager.
virtual const DtFilterManagerobjectFilters () const
 Accessor for the broker's object filter manager (const).
virtual void setBrokerId (int id)
 Set the internal broker ID values of this broker.

Protected Member Functions

 DtBroker ()
 CTOR.
virtual void initialize (DtBrokerInitializer *init)
 Initializes the broker using the given initializer.
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 DtString &logFileName)
 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 getLibrariesInDir (const std::string &dir, std::list< std::string > &files) const
 Scans the given directory for libraries and returns them in a list.
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 shutdownWithError (const DtString &error)
 Sends an error message to the queue manager, then marks us for shutdown.

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 launchGuiRequestCb (const DtBrokerLaunchGuiRequest &obj, void *usr)
 Portal Connection Callback, registered in the CTOR.

Protected Attributes

DtU16 myBrokerId
bool myShutdownRequestedFlag
DtPortalConnectionmyPortalConn
DtBrokerInitializermyBrokerInitializer
std::set< DtStringmyDisabledTranslators
std::set< DtStringmyDebuggedTranslators
DtFilterManager myFilterManager
DtStatisticsManagermyStatisticsManager
DtPrinter * myFilePrinter

Static Protected Attributes

static const char * theVrxPluginInitMethod

Private Member Functions

 DtBroker (const DtBroker &other)
 Class not copyable, not implemented.
DtBrokeroperator= (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.

Detailed Description

Base class for all broker objects.

Requirements:
headers: broker.h, and brokerInitializer.h
import library: libBroker.lib

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

Member Typedef Documentation

typedef bool(* MAKVrExchange::DtBroker::PluginInitMethod)(DtBroker *)

Constructor & Destructor Documentation

MAKVrExchange::DtBroker::DtBroker ( )
protected

CTOR.

virtual MAKVrExchange::DtBroker::~DtBroker ( )
virtual

Default DTOR.

MAKVrExchange::DtBroker::DtBroker ( const DtBroker other)
private

Class not copyable, not implemented.

Member Function Documentation

virtual void MAKVrExchange::DtBroker::initialize ( DtBrokerInitializer init)
protectedvirtual

Initializes the broker using the given initializer.

Initializer should have already parsed its command line and config file.

virtual void MAKVrExchange::DtBroker::logBrokerSettings ( DtBrokerInitializer init)
protectedvirtual

Output important broker settings to the log file on initialization.

Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtDisBroker::DtDisBroker, and MAKVrExchange::DtRprBroker::DtRprBroker.

virtual DtPortalConnection* MAKVrExchange::DtBroker::portalConnection ( ) const
virtual

Returns a pointer to the portal connection.

virtual void MAKVrExchange::DtBroker::launchGui ( )
pure virtual

Function which is called when VR-Exchange wants a display launched for this broker.

Implemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtRprBroker::DtRprBroker, MAKVrExchange::DtDisBroker::DtDisBroker, and DtSimpleBroker.

virtual void MAKVrExchange::DtBroker::launchInfoGui ( )
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

Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtRprBroker::DtRprBroker, and MAKVrExchange::DtDisBroker::DtDisBroker.

virtual void MAKVrExchange::DtBroker::reloadBrokerSettings ( )
virtual

Function used to make the broker reload its broker initialization settings.

Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtRprBroker::DtRprBroker, and MAKVrExchange::DtDisBroker::DtDisBroker.

virtual void MAKVrExchange::DtBroker::reloadFilterSettings ( )
virtual

Function used to make the broker reload its filter settings.

const DtString MAKVrExchange::DtBroker::brokerName ( ) const
inlinevirtual

Returns the brokers name.

References MAKVrExchange::DtBrokerInitializer::brokerName(), and myBrokerInitializer.

virtual DtU16 MAKVrExchange::DtBroker::brokerId ( ) const
virtual

Returns the brokers ID.

virtual DtTime MAKVrExchange::DtBroker::simTime ( ) const
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 void MAKVrExchange::DtBroker::updateSimTime ( ) const
virtual

Called to advance the simTime.

Reimplemented in MAKVrExchange::DtDisBroker::DtDisBroker, and MAKVrExchange::DtRprBroker::DtRprBroker.

virtual bool MAKVrExchange::DtBroker::isTimeToQuit ( ) const
virtual

Indicates this broker needs to shutdown.

virtual bool MAKVrExchange::DtBroker::isTranslatorDebuggingOn ( const DtString name) const
virtual

Returns true if the translator name is set for debugging.

Indicates whether name could be found in myDebuggedTranslators which is assembled from DtBrokerInitializer.

Parameters
[in]nameName of a translator.
Returns
true If name is found in myDebuggedTranslators
false Otherwise
virtual bool MAKVrExchange::DtBroker::isTranslatorDisabled ( const DtString name) const
virtual

Returns true if the translator name is disabled.

Indicates whether name could be found in myDisabledTranslators which is assembled from DtBrokerInitializer.

Parameters
[in]nameName of a translator.
Returns
true If name is found in myDisabledTranslators
false Otherwise
DtTime MAKVrExchange::DtBroker::pollingInterval ( )
inlinevirtual

Returns the amount of time that the broker is asking to be polled.

References myBrokerInitializer, and MAKVrExchange::DtBrokerInitializer::pollingInterval().

DtBrokerInitializer * MAKVrExchange::DtBroker::brokerInitializer ( ) const
inlinevirtual

Returns the brokerInitializer object used to create this broker.

References myBrokerInitializer.

virtual void MAKVrExchange::DtBroker::tick ( )
pure virtual

Tick is called by processEvents, brokers should override to do any periodic processing.

Implemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtRprBroker::DtRprBroker, MAKVrExchange::DtDisBroker::DtDisBroker, and DtSimpleBroker.

virtual void MAKVrExchange::DtBroker::processEvents ( )
virtual

ProcessEvents should be called every frame. This should not be overrided.

Reimplemented in MAKVrExchange::DtTenaBroker::DtTenaBroker, MAKVrExchange::DtDisBroker::DtDisBroker, and MAKVrExchange::DtRprBroker::DtRprBroker.

DtFilterManager & MAKVrExchange::DtBroker::objectFilters ( )
inlinevirtual

Accessor for the broker's object filter manager.

References myFilterManager.

const DtFilterManager & MAKVrExchange::DtBroker::objectFilters ( ) const
inlinevirtual

Accessor for the broker's object filter manager (const).

References myFilterManager.

virtual void MAKVrExchange::DtBroker::setBrokerId ( int  id)
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 void MAKVrExchange::DtBroker::initializeDebuggedAndDisabledFromInit ( )
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 void MAKVrExchange::DtBroker::initFileLogging ( const DtString logFileName)
protectedvirtual

Log all output to the filename logFileName.

virtual void MAKVrExchange::DtBroker::obtainLock ( )
protectedvirtual

Checks lock file to determine if broker is already running.

virtual void MAKVrExchange::DtBroker::loadBrokerPlugins ( )
protectedvirtual

Loads all plugins in the broker's plugin directory.

virtual void MAKVrExchange::DtBroker::getLibrariesInDir ( const std::string &  dir,
std::list< std::string > &  files 
) const
protectedvirtual

Scans the given directory for libraries and returns them in a list.

virtual void MAKVrExchange::DtBroker::initPortalConnection ( const DtBrokerInitializer init)
protectedvirtual

Initializes the Portal Connection.

virtual void MAKVrExchange::DtBroker::initStatisticsManager ( const DtBrokerInitializer init)
protectedvirtual

Initialize the statistics manager.

virtual void MAKVrExchange::DtBroker::stopFileLogging ( )
protectedvirtual

Cleanup this broker's members.

virtual void MAKVrExchange::DtBroker::processShutdownRequest ( const DtPortalBrokerShutdownRequestMessage obj)
protectedvirtual

Called by the static method shutdownRequestCb to notify this broker to stop.

virtual void MAKVrExchange::DtBroker::processRestartRequest ( bool  shouldEnableOneToOne)
protectedvirtual

Called by the restart request callback to notify this broker to restart.

virtual void MAKVrExchange::DtBroker::shutdownWithError ( const DtString error)
protectedvirtual

Sends an error message to the queue manager, then marks us for shutdown.

This is not virtual so that it can be called from the CTOR.

static void MAKVrExchange::DtBroker::shutdownRequestCb ( const DtPortalBrokerShutdownRequestMessage obj,
void *  usr 
)
staticprotected

Portal Connection Callback, registered in the CTOR.

static void MAKVrExchange::DtBroker::processDisableOneToOneCb ( const DtPortalBrokerDisableOneToOneMessage msg,
void *  usr 
)
staticprotected

Portal broker process disable One to One mapping callback.

static void MAKVrExchange::DtBroker::processEnableOneToOneCb ( const DtPortalBrokerEnableOneToOneMessage msg,
void *  usr 
)
staticprotected

Portal broker process enable One to One mapping callback.

static void MAKVrExchange::DtBroker::launchGuiRequestCb ( const DtBrokerLaunchGuiRequest obj,
void *  usr 
)
staticprotected

Portal Connection Callback, registered in the CTOR.

static void MAKVrExchange::DtBroker::filterObjectCallback ( const DtFilterObjectMessage object,
void *  userData 
)
staticprotected

Callback method for processing DtFilterObjectMessage messages.

Note: Calls the virtual filterObjectCallback(..) method.

virtual void MAKVrExchange::DtBroker::filterObjectCallback ( const DtFilterObjectMessage object)
protectedvirtual

Processes DtFilterObjectMessage messages.

Calls filterObjectByName or filterObjectByType depending on the filter type specified in the DtFilterObjectMessage message.

DtBroker& MAKVrExchange::DtBroker::operator= ( const DtBroker other)
private

Class not copyable, not implemented.

Member Data Documentation

const char* MAKVrExchange::DtBroker::theVrxPluginInitMethod
staticprotected
DtU16 MAKVrExchange::DtBroker::myBrokerId
protected
bool MAKVrExchange::DtBroker::myShutdownRequestedFlag
protected
DtPortalConnection* MAKVrExchange::DtBroker::myPortalConn
protected
DtBrokerInitializer* MAKVrExchange::DtBroker::myBrokerInitializer
protected
std::set<DtString> MAKVrExchange::DtBroker::myDisabledTranslators
protected
std::set<DtString> MAKVrExchange::DtBroker::myDebuggedTranslators
protected
DtFilterManager MAKVrExchange::DtBroker::myFilterManager
protected

Referenced by objectFilters().

DtStatisticsManager* MAKVrExchange::DtBroker::myStatisticsManager
protected
DtPrinter* MAKVrExchange::DtBroker::myFilePrinter
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Apr 15 17:15:50 EDT 2013 from SVN revision 126154
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)