VR-Vantage 2.8 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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::stringclassName () 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 Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 CTOR.
virtual ~DtDriver ()
 DTOR.
virtual void realizeConfiguration (const DtConfiguration &configuration)
 Realize the driver using the configuration.
virtual DtConfiguration createConfiguration () const
 Create a configuration for the driver.
DtAgentManageragentManager ()
 Get the master scene for this host.
virtual DtAgentManagerInterfacesceneInterface ()
 Get the scene manager interface for creating agents.
bool started () const
 Get this driver's active state.
virtual const std::stringinstanceName () const
 Get this driver's instance name.
virtual bool autoStart () const
 Get whether this driver is set to automatically start if it is persistent.
virtual void setAutoStart (bool autoStart)
 Set whether this driver automatically starts if it is persistent.
virtual bool isWindowDependent () const
 Get whether this driver is set to automatically start when the first window is created and stop when the last window is destroyed.
virtual void setIsWindowDependent (bool dep)
 Set whether this driver is set to automatically start when the first window is created and stop when the last window is destroyed.
virtual void setIsUserControllable (bool)
 Set whether this driver can be started and stopped by the user.
virtual bool isUserControllable () const
 Get whether this driver can be started and stopped by the user.
virtual void setIsPersistent (bool per)
 Set if the driver is persistent and should be saved between runs.
virtual bool isPersistent () const
 Get if the driver is persistent and should be saved between runs.
virtual bool isOnDriverSelectionList () const
 Returns whether or not this driver is to be automatically started/stopped from the driver selection list.
virtual void setOnDriverSelectionList (bool)
 Sets whether or not this item is on the driver selection list.
bool objectFromAgentManager (const DtUniqueID &id) const
 check to see if the object was created using this driver's agent manager.

Public Attributes

boost::signalslib::signal
< void(DtExampleSimulationConnection *)> 
signal_simulationCreated
 This signal is emitted when the simulation connection is created.
boost::signalslib::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 Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 Function for apply changes from a changes object and deleting it.
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 Report an element created.
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 Report an element attribute changed.
void reportElementDestroyed (DtElementID id)
 Report an element destroyed.
void start ()
 Start the driver.
void stop ()
 Stop the driver.
bool tick ()
 Tick the host driver.
virtual void setInstanceName (const std::string &name)
 set the Instance name.
virtual void installAccessories ()
 Installs accessories on this driver.
virtual void uninstallAccessories ()
 Removes accessories from this driver.

Protected Attributes

std::string myClassName
DtExampleSimulationConnectionmySimulationConnection
makVrv::DtAsynchronousEventQueuemyAsynchronousEventQueue
bool mySimulationConnectionState
makVrv::DtSignalConnectionManager myDynamicSignals
bool myUseThreadFlag
 Cross thread variables.
DtThreadStartSP myStart
 Cross thread variables.
DtThread * myThread
 Cross thread variables.
FunctionCallQueue myConnectionThreadFunctions
 Cross thread variables.
FunctionCallQueue myDriverThreadFunctions
 Cross thread variables.
makVrv::DtAsynchronousAgentManagermyAsynchronousInterface
 Cross thread variables.
- Protected Attributes inherited from makVrv::DtDriver
DtAgentManagermyAgentManager
bool myStartedFlag
std::string myName
DtConfiguration myConfiguration
bool myPersistentFlag
bool myUserControllableFlag
bool myRequestStateDiffPendingFlag
DtElementChanges myChanges

Member Typedef Documentation

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.

Implements makVrv::DtDriver.

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()

Implements makVrv::DtDriver.

virtual bool DtExampleThreadedDriver::onStop ( )
protectedvirtual

Performs shutdown logic for the driver.

See Also
makVrv::DtDriver::stop()

Implements makVrv::DtDriver.

virtual bool DtExampleThreadedDriver::onTick ( )
protectedvirtual

Performs update logic for the driver.

See Also
makVrv::DtDriver::tick()

Implements makVrv::DtDriver.

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& )

Reimplemented from makVrv::DtDriver.

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::signalslib::signal<void (DtExampleSimulationConnection*)> DtExampleThreadedDriver::signal_simulationCreated

This signal is emitted when the simulation connection is created.

boost::signalslib::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.

DtThreadStartSP 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:


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)