VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Types | Protected Attributes
makVrv::DtBaseConnection Class Reference

The DtBaseConnection is an abstract class. More...

Inheritance diagram for makVrv::DtBaseConnection:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 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 Types

typedef boost::unordered_map
< std::string,
DtVirtualBaseClass * > 
InstanceMap

Protected Attributes

DtSharedSettingsManagermySettingsManagerCache
DtRandomNumberGenerator myRandomNumberGenerator
DtAgentManagerInterfacemySceneInterface
DtElementChangesmyWorkingElementChanges
DtTemporaryAgentManagermyTemporaryEffects
DtBlinkingObjectManagermyBlinkManager
 Manager for blinking objects.
DtUnicode myEmptyString
InstanceMap myInstances
bool myDestroyingInstanceFlag

Detailed Description

The DtBaseConnection is an abstract class.


Member Typedef Documentation

typedef boost::unordered_map<std::string,DtVirtualBaseClass*> makVrv::DtBaseConnection::InstanceMap [protected]

Reimplemented in makVrv::DtCigiConnection.


Constructor & Destructor Documentation

CTOR.

DTOR MUST call clearInstances first.


Member Function Documentation

virtual void makVrv::DtBaseConnection::clearInstances ( ) [virtual]

Clear and delete all instances rooted in the connection MUST be called before the connection is destroyed.

Get the settings manager.

Get the scene manager interface for creating drivers.

Get the settings manager.

void makVrv::DtBaseConnection::reportElementCreated ( DtElementID  id,
DtElementID  parentId,
unsigned int  type 
)

Report an element created.

Report an element destroyed.

Look at the current element changes.

Take the current changes and internally start a new set of changes.

Get the temporary effects manager.

Get the blinking manager.

Get the simulation's random number generator.

virtual const std::string& makVrv::DtBaseConnection::tag ( ) [inline, virtual]

Get the tag identifying which type of connection this is.

Reimplemented in makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection.

Allocated empty string.

virtual DtVirtualBaseClass* makVrv::DtBaseConnection::findInstance ( const std::string &  instanceName) [virtual]

Find an instance with the given name.

If no instance is found than a null pointer is returned

Warning:
This function will always return 0 when the simulation is in the process of destroying all instances, this allows some what save access to findInstance in object destructors.

Reimplemented in makVrv::DtIntervisibilityDriver::DtIntervisibilityConnection, and makVrv::DtCigiConnection.

Referenced by makVrv::DT_PROTOCOL_NAMESPACE::DtInteractionListener< InteractionClass >::instance(), and makVrf::VRF_PROTOCOL_NAMESPACE::DtVrfEntityStateInterceptorCreator::instance().

Check to see if the simulation is destroying instances.

This function is used in the destructor of objects which access instances via reference which may throw an exception.

 TestClass::~TestClass()
 {
    if(!mySimulation.destroyingInstances())
    {
        //Safe to get instance now.
        Singleton& anInstance = Singleton::instance(mySimulation);
        ...
    }

Reimplemented in makVrv::DtCigiConnection.

virtual void makVrv::DtBaseConnection::registerInstance ( const std::string &  instanceName,
DtVirtualBaseClass instance 
) [virtual]

Member Data Documentation

Manager for blinking objects.

Reimplemented in makVrv::DtCigiConnection.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)