VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
DtExampleThreadedDriver Class Reference
Inheritance diagram for DtExampleThreadedDriver:
Inheritance graph
[legend]

Public Member Functions

 DtExampleThreadedDriver (makVrv::DtAgentManager &am)
 CTOR.
virtual ~DtExampleThreadedDriver ()
 Virtual DTOR.
virtual const std::string & className () const
 Get this instance's class name.
virtual void queueDriverFunction (const boost::function< void()> &function)
 Put a function in the sim function queue, for threadsafe calling.
virtual void queueConnectionFunction (const boost::function< void()> &function)
 Put a function in the sim function queue, for threadsafe calling.
bool useThreadFlag () const
 See if this driver is running connection methods in a separate thread.
DtExampleSimulationConnectionsimulationConnection ()
 Get the simulation connection.

Public Attributes

boost::signal< void(DtExampleSimulationConnection *)> signal_simulationCreated
 This signal is emitted when the simulation connection is created.
boost::signal< void(DtExampleSimulationConnection *)> signal_simulationAboutToBeDestroyed
 This signal is emitted when the simulation connection is about to be destroyed.

Protected Types

typedef
makVrv::DtLockedBufferedQueue
< boost::function< void()> > 
FunctionCallQueue
typedef std::vector
< boost::function< void()> > 
FunctionCallList

Protected Member Functions

virtual bool onStart ()
 Performs startup logic for the driver.
virtual bool onStop ()
 Performs shutdown logic for the driver.
virtual bool onTick ()
 Performs update logic for the driver.
virtual void attachObserverToEntity (const std::string &entityName)
 Tells the current observer to attach to the named entity.
virtual void slot_displayEngineAdded (const makVrv::DtDeRecord &igRecord)
 Ensures the driver is properly restarted when a de is connected.
virtual
DtExampleSimulationConnection
createSimulationConnection ()
 Abstract create simulation function called onStart.
virtual void run ()
 Function that will be called when the thread is started.
void startThread ()
 Attempt to start the thread.
void stopThread ()
 Attempt to stop the thread, blocking until the thread stops.
void setSimulationConnectionState (bool state)
 Set the connection state of the driver.
virtual void connectToDynamicSignals ()
 Connect to signals.
virtual void disconnectFromDynamicSignals ()
 Disconnect to any signals connected to in connectToDynamicSignals()
virtual void slot_togglePinnedLabel (const makVrv::DtSelectionManager::IdSet &sel)
 Listens for entity labels being pinned / unpinned.
virtual void runFunctionQueue (FunctionCallQueue &queue)
 Execute a function queue.

Protected Attributes

std::string myClassName
DtExampleSimulationConnectionmySimulationConnection
makVrv::DtAsynchronousEventQueue * myAsynchronousEventQueue
bool mySimulationConnectionState
makVrv::DtSignalConnectionManager myDynamicSignals
bool myUseThreadFlag
 Cross thread variables.
DtThreadStart * myStart
 Cross thread variables.
DtThread * myThread
 Cross thread variables.
FunctionCallQueue myConnectionThreadFunctions
 Cross thread variables.
FunctionCallQueue myDriverThreadFunctions
 Cross thread variables.
makVrv::DtAsynchronousAgentManager * myAsynchronousInterface
 Cross thread variables.

Member Typedef Documentation

typedef makVrv::DtLockedBufferedQueue<boost::function<void ()> > DtExampleThreadedDriver::FunctionCallQueue
protected
typedef std::vector<boost::function<void ()> > DtExampleThreadedDriver::FunctionCallList
protected

Constructor & Destructor Documentation

DtExampleThreadedDriver::DtExampleThreadedDriver ( makVrv::DtAgentManager &  am)

CTOR.

virtual DtExampleThreadedDriver::~DtExampleThreadedDriver ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual const std::string& DtExampleThreadedDriver::className ( ) const
virtual

Get this instance's class name.

virtual void DtExampleThreadedDriver::queueDriverFunction ( const boost::function< void()> &  function)
virtual

Put a function in the sim function queue, for threadsafe calling.

virtual void DtExampleThreadedDriver::queueConnectionFunction ( const boost::function< void()> &  function)
virtual

Put a function in the sim function queue, for threadsafe calling.

bool DtExampleThreadedDriver::useThreadFlag ( ) const

See if this driver is running connection methods in a separate thread.

Returns
true if using a separate thread, false otherwise
DtExampleSimulationConnection* DtExampleThreadedDriver::simulationConnection ( )

Get the simulation connection.

Returns
the simulation connection, if it exists. May return 0.
virtual bool DtExampleThreadedDriver::onStart ( )
protectedvirtual

Performs startup logic for the driver.

See Also
makVrv::DtDriver::start()
virtual bool DtExampleThreadedDriver::onStop ( )
protectedvirtual

Performs shutdown logic for the driver.

See Also
makVrv::DtDriver::stop()
virtual bool DtExampleThreadedDriver::onTick ( )
protectedvirtual

Performs update logic for the driver.

See Also
makVrv::DtDriver::tick()
virtual void DtExampleThreadedDriver::attachObserverToEntity ( const std::string &  entityName)
protectedvirtual

Tells the current observer to attach to the named entity.

This method uses an observer state record, and calls DtObserver::setFromRecord. When setFromRecord is used, the observer will listen for the existence of the named entity and actually do the attachment when the entity is created

virtual void DtExampleThreadedDriver::slot_displayEngineAdded ( const makVrv::DtDeRecord &  igRecord)
protectedvirtual

Ensures the driver is properly restarted when a de is connected.

See Also
makVrv::DtDriver::slot_displayEngineAdded( const makVrv::DtDeRecord& )
virtual DtExampleSimulationConnection* DtExampleThreadedDriver::createSimulationConnection ( )
protectedvirtual

Abstract create simulation function called onStart.

virtual void DtExampleThreadedDriver::run ( )
protectedvirtual

Function that will be called when the thread is started.

void DtExampleThreadedDriver::startThread ( )
protected

Attempt to start the thread.

Exceptions
DtCorruptedStateif the thread does not start.
void DtExampleThreadedDriver::stopThread ( )
protected

Attempt to stop the thread, blocking until the thread stops.

void DtExampleThreadedDriver::setSimulationConnectionState ( bool  state)
protected

Set the connection state of the driver.

virtual void DtExampleThreadedDriver::connectToDynamicSignals ( )
protectedvirtual

Connect to signals.

virtual void DtExampleThreadedDriver::disconnectFromDynamicSignals ( )
protectedvirtual

Disconnect to any signals connected to in connectToDynamicSignals()

virtual void DtExampleThreadedDriver::slot_togglePinnedLabel ( const makVrv::DtSelectionManager::IdSet &  sel)
protectedvirtual

Listens for entity labels being pinned / unpinned.

virtual void DtExampleThreadedDriver::runFunctionQueue ( FunctionCallQueue queue)
protectedvirtual

Execute a function queue.

Member Data Documentation

boost::signal<void (DtExampleSimulationConnection*)> DtExampleThreadedDriver::signal_simulationCreated

This signal is emitted when the simulation connection is created.

boost::signal<void (DtExampleSimulationConnection*)> DtExampleThreadedDriver::signal_simulationAboutToBeDestroyed

This signal is emitted when the simulation connection is about to be destroyed.

std::string DtExampleThreadedDriver::myClassName
protected
bool DtExampleThreadedDriver::myUseThreadFlag
protected

Cross thread variables.

They are used between the two threads for communication.

DtThreadStart* DtExampleThreadedDriver::myStart
protected

Cross thread variables.

They are used between the two threads for communication.

DtThread* DtExampleThreadedDriver::myThread
protected

Cross thread variables.

They are used between the two threads for communication.

FunctionCallQueue DtExampleThreadedDriver::myConnectionThreadFunctions
protected

Cross thread variables.

They are used between the two threads for communication.

FunctionCallQueue DtExampleThreadedDriver::myDriverThreadFunctions
protected

Cross thread variables.

They are used between the two threads for communication.

makVrv::DtAsynchronousAgentManager* DtExampleThreadedDriver::myAsynchronousInterface
protected

Cross thread variables.

They are used between the two threads for communication.

DtExampleSimulationConnection* DtExampleThreadedDriver::mySimulationConnection
protected
makVrv::DtAsynchronousEventQueue* DtExampleThreadedDriver::myAsynchronousEventQueue
protected
bool DtExampleThreadedDriver::mySimulationConnectionState
protected
makVrv::DtSignalConnectionManager DtExampleThreadedDriver::myDynamicSignals
protected

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

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)