VR-Exchange 2.1 API Documentation
List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | 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 Member Functions

 DtBroker (DtBrokerInitializer *init)
 Default constructor.
virtual ~DtBroker ()
 Default DTOR.
virtual DtPortalConnectionportalConnection () const
 Returns a pointer to the portalConnection.
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 ()
 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

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 initPortalConnection (const DtBrokerInitializer &init)
 Initializes the Portal Connection, called from the CTOR.
virtual void initFileLogging (const DtString &logFileName)
 Log all output to the filename logFileName, called from the CTOR.
virtual void shutdownWithError (const DtString &error)
 Sends an error message to the queue manager, then marks us for shutdown.
virtual void initializeDebuggedAndDisabledFromInit ()
 Sets our disabled / debugged sets from the initializer.

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
DtPortalConnectionmyPConn
DtBrokerInitializermyBrokerInitializer
std::set< DtStringmyDisabledTranslators
std::set< DtStringmyDebuggedTranslators
DtFilterManager myFilterManager
DtPrinter * myFilePrinter

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

Constructor & Destructor Documentation

MAKVrExchange::DtBroker::DtBroker ( DtBrokerInitializer init)

Default constructor.

Takes a DtBrokerInitializer instance. init should have already parsed its command line and its .mtl file by calling init.parseCmdLine() and init.loadMtlFile().

Parameters
[in]initInitialization information.
Precondition
init is expected to have already called DtBrokerInitializer::parseCmdLine(), and DtBrokerInitializer::loadMtlFile().
virtual MAKVrExchange::DtBroker::~DtBroker ( )
virtual

Default DTOR.

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

Class not copyable, not implemented.

Member Function Documentation

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

Returns a pointer to the portalConnection.

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::DtHlaBroker::DtHlaBroker, 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::DtHlaBroker::DtHlaBroker, 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::DtHlaBroker::DtHlaBroker, 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::DtHlaBroker::DtHlaBroker.

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

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::DtHlaBroker::DtHlaBroker, MAKVrExchange::DtDisBroker::DtDisBroker, and DtSimpleBroker.

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

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

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::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::initPortalConnection ( const DtBrokerInitializer init)
protectedvirtual

Initializes the Portal Connection, called from the CTOR.

virtual void MAKVrExchange::DtBroker::initFileLogging ( const DtString logFileName)
protectedvirtual

Log all output to the filename logFileName, called from the CTOR.

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.

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.

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

DtU16 MAKVrExchange::DtBroker::myBrokerId
protected
bool MAKVrExchange::DtBroker::myShutdownRequestedFlag
protected
DtPortalConnection* MAKVrExchange::DtBroker::myPConn
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().

DtPrinter* MAKVrExchange::DtBroker::myFilePrinter
protected

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

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)