VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
DtExampleSimulationConnection Class Reference

DtExampleSimulationConnection. More...

Inheritance diagram for DtExampleSimulationConnection:
Inheritance graph
[legend]

Public Member Functions

 DtExampleSimulationConnection (makVrv::DtAgentManagerInterface &sceneInterface, const makVrv::DtCoordinateSystem &coordSystem, makVrv::DtSharedSettingsManager &settingsManager)
 CTOR param[in] sceneInterface is a reference to either a DtAgentManager or a DtAsynchronousManager, depending on whether or not this connection is going to be used in a separate thread param[in] coordSystem is cloned (not strictly necessary if used in the main thread, but it does it regardless param[in] settingsManager allows the objects using the connection to check for current settings that are maintained in the main thread.
virtual ~DtExampleSimulationConnection ()
 DTOR.
virtual bool connect ()
 Function that creates the sim engine.
virtual bool connected () const
 Terminate the connection.
virtual bool disconnect ()
 Function that destroys the sim engine.
virtual void tick ()
 Function to be called repeatedly by a thread.
const makVrv::DtCoordinateSystemcoordinateSystem () const
 Get the coordinate system.
double simTime () const
 Get the simulation time.
void setSimTime (double simTime)
 Set the simulation time.
- Public Member Functions inherited from makVrv::DtBaseConnection
 DtBaseConnection (DtSharedSettingsManager &, DtAgentManagerInterface &)
 CTOR.
virtual ~DtBaseConnection ()
 DTOR MUST call clearInstances first.
virtual void clearInstances ()
 Clear and delete all instances rooted in the connection MUST be called before the connection is destroyed.
DtSharedSettingsManagersettingsManager ()
 Get the settings manager.
virtual DtAgentManagerInterfacesceneInterface ()
 Get the scene manager interface for creating drivers.
const DtSharedSettingsManagersettingsManager () const
 Get the settings manager.
void reportElementCreated (DtElementID id, DtElementID parentId, unsigned int type)
 Report an element created.
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
void reportElementDestroyed (DtElementID id)
 Report an element destroyed.
const DtElementChangescurrentElementChanges () const
 Look at the current element changes.
DtElementChangestakeElementChanges ()
 Take the current changes and internally start a new set of changes.
DtTemporaryAgentManagertemporaryEffects ()
 Get the temporary effects manager.
DtBlinkingObjectManagerblinkManager ()
 Get the blinking manager.
DtRandomNumberGeneratorrandomNumberGenerator ()
 Get the simulation's random number generator.
virtual const std::string & tag ()
 Get the tag identifying which type of connection this is.
const DtUnicodeemptyString () const
 Allocated empty string.
virtual DtVirtualBaseClassfindInstance (const std::string &instanceName)
 Find an instance with the given name.
bool destroyingInstances () const
 Check to see if the simulation is destroying instances.
virtual void registerInstance (const std::string &instanceName, DtVirtualBaseClass *instance)
 Register an object as an instance of instanceName, and transfer memory ownership of the instance to the DtConnection.

Protected Attributes

DtExampleSimEnginemyExampleSimEngine
 The simulation engine.
makVrv::DtCoordinateSystemmyCoordinateSystem
double mySimTime
 Copy of the simulation time.
- Protected Attributes inherited from makVrv::DtBaseConnection
DtSharedSettingsManagermySettingsManagerCache
DtRandomNumberGenerator myRandomNumberGenerator
DtAgentManagerInterfacemySceneInterface
DtElementChangesmyWorkingElementChanges
DtTemporaryAgentManagermyTemporaryEffects
DtBlinkingObjectManagermyBlinkManager
 Manager for blinking objects.
DtUnicode myEmptyString
InstanceMap myInstances
bool myDestroyingInstanceFlag

Additional Inherited Members

- Protected Types inherited from makVrv::DtBaseConnection
typedef boost::unordered_map
< std::string,
DtVirtualBaseClass * > 
InstanceMap

Detailed Description

DtExampleSimulationConnection.

We use the idea of a connection to provide some basic functionality that any object (potentially) running in a separate thread might need. A reference to the connection is typically passed to all objects that will execute in the thread, much the same way a reference to DtDe is passed to all objects executing in the main thread. It provides access to the scene interface, settings manager, element data reporting, and provides a common place to register singleton instances. This derived example connection clones the current coordinate system object on creation and makes that available as well. It also provides the link that let's us provide simulation time from the driver to the sim engine.

Constructor & Destructor Documentation

DtExampleSimulationConnection::DtExampleSimulationConnection ( makVrv::DtAgentManagerInterface sceneInterface,
const makVrv::DtCoordinateSystem coordSystem,
makVrv::DtSharedSettingsManager settingsManager 
)

CTOR param[in] sceneInterface is a reference to either a DtAgentManager or a DtAsynchronousManager, depending on whether or not this connection is going to be used in a separate thread param[in] coordSystem is cloned (not strictly necessary if used in the main thread, but it does it regardless param[in] settingsManager allows the objects using the connection to check for current settings that are maintained in the main thread.

This includes access to a signaler that will raise signals (in whichever thread the connection is running in) when those settings change

virtual DtExampleSimulationConnection::~DtExampleSimulationConnection ( )
virtual

DTOR.

Member Function Documentation

virtual bool DtExampleSimulationConnection::connect ( )
virtual

Function that creates the sim engine.

Returns
true if connect succeeds; false otherwise
virtual bool DtExampleSimulationConnection::connected ( ) const
virtual

Terminate the connection.

Returns
true if connected; false otherwise
virtual bool DtExampleSimulationConnection::disconnect ( )
virtual

Function that destroys the sim engine.

Returns
true if disconnect succeeds; false otherwise
virtual void DtExampleSimulationConnection::tick ( )
virtual

Function to be called repeatedly by a thread.

const makVrv::DtCoordinateSystem& DtExampleSimulationConnection::coordinateSystem ( ) const

Get the coordinate system.

NOTE WELL: A more complete implementation would listen for the coordinate system changed signal and update this when needed

Returns
a reference to the connection's copy of the coordinate system
double DtExampleSimulationConnection::simTime ( ) const

Get the simulation time.

Returns
the current simulation time
void DtExampleSimulationConnection::setSimTime ( double  simTime)

Set the simulation time.

The driver puts this function on the connection's function queue with the current simulation time param[in] simTime is the current simulation time

Member Data Documentation

DtExampleSimEngine* DtExampleSimulationConnection::myExampleSimEngine
protected

The simulation engine.

makVrv::DtCoordinateSystem* DtExampleSimulationConnection::myCoordinateSystem
protected
double DtExampleSimulationConnection::mySimTime
protected

Copy of the simulation time.


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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)