VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
makVrv::DtAsynchronousAgentManager Class Reference

An asynchronous interface to the scene manager. More...

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

Public Types

typedef boost::function< void(DtAgentManagerInterface *) > SceneManagerInterfaceFunction
 
typedef DtLockedBufferedQueue
< SceneManagerInterfaceFunction
AsyncAgentManagerInterfaceFunctionQueue
 

Public Member Functions

 DtAsynchronousAgentManager (DtAgentManager &agentManager, const std::string &ownerName)
 CTOR. More...
 
virtual ~DtAsynchronousAgentManager ()
 DTOR. More...
 
virtual void tick ()
 Tick the scene manager. More...
 
AsyncAgentManagerInterfaceFunctionQueueasyncFunctionQueue ()
 Get a pointer to the asynchronous function queue. More...
 
virtual void addModelDefinition (const DtModelDefinition &)
 Add a new model definition. More...
 
virtual DtModelDefinitionlookupModelDefinition (const std::string &str)
 Lookup a model definition. More...
 
- Public Member Functions inherited from makVrv::DtAgentManagerInterface
 DtAgentManagerInterface (const DtAgentFactory *factory, unsigned char myNamespaceId)
 CTOR. More...
 
virtual ~DtAgentManagerInterface ()
 DTOR. More...
 
DtUniqueID createNewUniqueId ()
 Generate a new id. More...
 
unsigned char namespaceId () const
 
bool uniqueIdFromAgentManagerInterface (const DtUniqueID &id) const
 Check to. More...
 
unsigned int createNewCallID ()
 Create a new call id. More...
 
virtual DtAgentcreateNewObject (const std::string &objectClass, bool bDistribute)
 Create a new object, and return a driver to that object. More...
 
virtual void recreateObject (DtAgent *proxy)
 Add the existing proxy to the map of new objects so it gets "recreated" on slaves. More...
 
bool encodeUpdate (DtMessage &masterMsg, DtMessage &distributedMsg, double simulationTime)
 Encode an scene update int a message. More...
 

Protected Attributes

DtAgentManagermyAgentManager
 
AsyncAgentManagerInterfaceFunctionQueue myAsyncFunctionQueue
 
- Protected Attributes inherited from makVrv::DtAgentManagerInterface
DtUniqueID myNamespaceId
 
DtUniqueID myFreeID
 
unsigned int myUpdateCallIndex
 
AgentList myUpdatedObjects
 
AgentList myToBeDeletedObjects
 
const DtAgentFactorymyDriverFactory
 
OrderedCallList myMasterList
 

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtAgentManagerInterface
static unsigned char namespaceFromUniqueId (DtUniqueID id)
 Get the namespace id from a unique id. More...
 
- Static Public Attributes inherited from makVrv::DtAgentManagerInterface
static const double IgnoreSimulationTime
 Special time value used to encode messages where the sim time provided is ignored. More...
 
- Protected Types inherited from makVrv::DtAgentManagerInterface
typedef std::list
< IndexedMessage,
tbb::tbb_allocator
< IndexedMessage > > 
OrderedCallList
 
typedef std::list< DtAgent * > AgentList
 Type of drivers. More...
 
- Protected Member Functions inherited from makVrv::DtAgentManagerInterface
void deleteObject (DtAgent *)
 Internal call to queue an object to be deleted next tick. More...
 
void queueObjectForUpdate (DtAgent *object)
 Internal call to queue an object to generate an update in the next tick. More...
 

Detailed Description

An asynchronous interface to the scene manager.

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtAsynchronousAgentManager::DtAsynchronousAgentManager ( DtAgentManager agentManager,
const std::string &  ownerName 
)

CTOR.

Warning
The DtAsynchronousAgentManager instance must be created in the main thread. Typically it is valid to create one in the implementation of the start() function of the DtDriver.
virtual makVrv::DtAsynchronousAgentManager::~DtAsynchronousAgentManager ( )
virtual

DTOR.

Warning
The DtAsynchronousAgentManager instance must be deleted in the main thread. Typically it is valid to delete in the implementation of the stop() function of the DtDriver.

Member Function Documentation

virtual void makVrv::DtAsynchronousAgentManager::tick ( )
virtual

Tick the scene manager.

This must be called by the DtDriver implementation to propagate the driver calls to the scene manager. Typically this would be called in thread loop.

* while(!askedToStop())
* {
* doSimulation_and_makeDriverCalls();
* myAsyncInterface->tick();
* }
*

Implements makVrv::DtAgentManagerInterface.

virtual void makVrv::DtAsynchronousAgentManager::addModelDefinition ( const DtModelDefinition )
virtual

Add a new model definition.

virtual DtModelDefinition* makVrv::DtAsynchronousAgentManager::lookupModelDefinition ( const std::string &  str)
virtual

Lookup a model definition.

This will return a new copy of the original model definition (without any local cache) which must be deleted.

Warning
The returned pointer must be deleted by the caller.
AsyncAgentManagerInterfaceFunctionQueue* makVrv::DtAsynchronousAgentManager::asyncFunctionQueue ( )

Get a pointer to the asynchronous function queue.

Member Data Documentation

DtAgentManager& makVrv::DtAsynchronousAgentManager::myAgentManager
protected
AsyncAgentManagerInterfaceFunctionQueue makVrv::DtAsynchronousAgentManager::myAsyncFunctionQueue
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)