VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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.
virtual ~DtAsynchronousAgentManager ()
 DTOR.
virtual void tick ()
 Tick the scene manager.
AsyncAgentManagerInterfaceFunctionQueueasyncFunctionQueue ()
 Get a pointer to the asynchronous function queue.
virtual void addModelDefinition (const DtModelDefinition &)
 Add a new model definition.
virtual DtModelDefinitionlookupModelDefinition (const std::string &str)
 Lookup a model definition.
- Public Member Functions inherited from makVrv::DtAgentManagerInterface
 DtAgentManagerInterface (const DtAgentFactory *factory, unsigned char myNamespaceId)
 CTOR.
virtual ~DtAgentManagerInterface ()
 DTOR.
DtUniqueID createNewUniqueId ()
 Generate a new id.
unsigned char namespaceId () const
bool uniqueIdFromAgentManagerInterface (const DtUniqueID &id) const
 Check to.
unsigned int createNewCallID ()
 Create a new call id.
virtual DtAgentcreateNewObject (const std::string &objectClass, bool bDistribute)
 Create a new object, and return a driver to that object.
virtual void recreateObject (DtAgent *proxy)
 Add the existing proxy to the map of new objects so it gets "recreated" on slaves.
bool encodeUpdate (DtMessage &masterMsg, DtMessage &distributedMsg, double simulationTime)
 Encode an scene update int a message.

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.
- 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.
- Protected Types inherited from makVrv::DtAgentManagerInterface
typedef std::list< IndexedMessageOrderedCallList
typedef std::list< DtAgent * > AgentList
 Type of drivers.
- Protected Member Functions inherited from makVrv::DtAgentManagerInterface
void deleteObject (DtAgent *)
 Internal call to queue an object to be deleted next tick.
void queueObjectForUpdate (DtAgent *object)
 Internal call to queue an object to generate an update in the next tick.

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 Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)