VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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)
 
virtual ~DtExampleThreadedDriver ()
 
virtual const std::string & className () const
 
virtual void queueDriverFunction (const boost::function< void()> &function)
 
virtual void queueConnectionFunction (const boost::function< void()> &function)
 
bool useThreadFlag () const
 
DtExampleSimulationConnectionsimulationConnection ()
 
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 
virtual ~DtDriver ()
 
virtual void realizeConfiguration (const DtConfiguration &configuration)
 
virtual DtConfiguration createConfiguration () const
 
DtAgentManageragentManager ()
 
virtual DtAgentManagerInterfacesceneInterface ()
 
bool started () const
 
virtual const std::string & instanceName () const
 
virtual bool autoStart () const
 
virtual void setAutoStart (bool autoStart)
 
virtual bool isWindowDependent () const
 
virtual void setIsWindowDependent (bool dep)
 
virtual void setIsUserControllable (bool)
 
virtual bool isUserControllable () const
 
virtual void setIsPersistent (bool per)
 
virtual bool isPersistent () const
 
virtual bool isOnDriverSelectionList () const
 
virtual void setOnDriverSelectionList (bool)
 
bool objectFromAgentManager (const DtUniqueID &id) const
 

Public Attributes

makVrv::vrvSignalsLib::signal
< void(DtExampleSimulationConnection *)> 
signal_connectionCreated
 
makVrv::vrvSignalsLib::signal
< void(DtExampleSimulationConnection *)> 
signal_connectionAboutToBeDestroyed
 

Protected Types

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

Protected Member Functions

virtual bool onStart ()
 
virtual bool onStop ()
 
virtual bool onTick ()
 
virtual void attachObserverToEntity (const std::string &entityName)
 
virtual void slot_displayEngineAdded (const makVrv::DtDeRecord &igRecord)
 
virtual
DtExampleSimulationConnection
createSimulationConnection ()
 
virtual void run ()
 
void startThread ()
 
void stopThread ()
 
void setSimulationConnectionState (bool state)
 
virtual void connectToDynamicSignals ()
 
virtual void disconnectFromDynamicSignals ()
 
virtual void slot_togglePinnedLabel (const makVrv::DtSelectionManager::IdSet &sel, bool pinAllLabels)
 
virtual void runFunctionQueue (FunctionCallQueue &queue)
 
virtual void slot_coordinateSystemChanged ()
 
- Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 
void reportElementDestroyed (DtElementID id)
 
void start ()
 
void stop ()
 
bool tick ()
 
virtual void setInstanceName (const std::string &name)
 
virtual void installAccessories ()
 
virtual void uninstallAccessories ()
 

Protected Attributes

std::string myClassName
 
DtExampleSimulationConnectionmySimulationConnection
 
makVrv::DtAsynchronousEventQueuemyAsynchronousEventQueue
 
bool mySimulationConnectionState
 
makVrv::DtSignalConnectionManager myDynamicSignals
 
bool myUseThreadFlag
 
DtThreadStartSP myStart
 
DtThread * myThread
 
FunctionCallQueue myConnectionThreadFunctions
 
FunctionCallQueue myDriverThreadFunctions
 
makVrv::DtAsynchronousAgentManagermyAsynchronousInterface
 
- 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 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.

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,
bool  pinAllLabels 
)
protectedvirtual

Listens for entity labels being pinned / unpinned.

virtual void DtExampleThreadedDriver::runFunctionQueue ( FunctionCallQueue queue)
protectedvirtual

Execute a function queue.

virtual void DtExampleThreadedDriver::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

Member Data Documentation

makVrv::vrvSignalsLib::signal<void (DtExampleSimulationConnection*)> DtExampleThreadedDriver::signal_connectionCreated

This signal is emitted when the simulation connection is created.

makVrv::vrvSignalsLib::signal<void (DtExampleSimulationConnection*)> DtExampleThreadedDriver::signal_connectionAboutToBeDestroyed

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:

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)