![]() |
VR-Forces 4.3.1 Class Documentation
|
The DtAgentManager manages the distributed scene object framework. More...

Classes | |
| struct | AsynchronousInterfaceEntry |
| struct | MessageParcel |
| Helper struct for sending messages via the asynchronous message queue. More... | |
Public Member Functions | |
| DtAgentManager (DtDe &) | |
| CTOR. | |
| virtual | ~DtAgentManager () |
| DTOR. | |
| virtual void | cleanup () |
| Cleans up the agent manager. | |
| virtual void | tick () |
| Tick the scene manager. | |
| virtual void | updateScene (DtMessage &message) |
| Update the scene from an update message. | |
| virtual DtAgentUpdateResolverInterface * | findUpdater (DtUniqueID id) |
| Find the update handler for a particular object id. | |
| DtElementID | findElementId (DtUniqueID id) |
| Attempt to find the element ID for a scene object id. | |
| virtual bool | sceneObjectIsVisible (DtElementID id) const |
| Return true if the given element is visible in the first available model set. | |
| DtDe & | de () |
| Get the scene manager's Ig object. | |
| void | clear () |
| Forcibly clear the scene. | |
| virtual DtAsynchronousAgentManager * | createAsynchronousManager (const std::string &ownerName) |
| Create a new DtAsynchronousAgentManager. | |
| void | checkForIgLock (bool forceLock=false) |
| An internal function the scene manager calls to allow for asynchronous scene managers to use the DtDe& reference. | |
| virtual DtDe & | acquireLockedIg () |
| Get the locked de. | |
| virtual void | releaseLockedIg () |
| Release the locked de, the de reference is now invalid to be used in the thread. | |
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 DtAgent * | createNewObject (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. | |
Public Attributes | |
| boost::signal< void(DtUniqueID id)> | signal_objectCreated |
| Signal for creation of actual objects (represented by their unique id). | |
Protected Types | |
| typedef std::vector < MessageParcel > | MessageParcelVector |
| typedef std::vector< DtMessage * > | MessageList |
| typedef boost::function< void(DtAgentManagerInterface *) > | AgentManagerInterfaceFunction |
| typedef DtLockedBufferedQueue < AgentManagerInterfaceFunction > | AsynchronousAgentManagerInterfaceFunctionQueue |
| typedef boost::unordered_map < DtUniqueID, AsynchronousInterfaceEntry > | NamespaceMap |
| typedef boost::unordered_map < DtUniqueID, DtAgentUpdateResolverInterface * > | UpdaterMap |
| typedef std::vector< DtAgent * > | DriverVector |
Protected Types inherited from makVrv::DtAgentManagerInterface | |
| typedef std::list< IndexedMessage > | OrderedCallList |
| typedef std::list< DtAgent * > | AgentList |
| Type of drivers. | |
Protected Member Functions | |
| virtual unsigned char | acquireNamespaceId (DtAsynchronousAgentManager *sceneManagerInterface, const std::string &ownerName) |
| Acquire a namespace. | |
| virtual void | releaseNamespaceId (unsigned char nsId) |
| Release a namespace id, this should be called by a SceneManagerInterface DTOR. | |
| virtual void | addAsynchronousUpdateMessages (MessageParcelVector &messages) |
| Add asynchronous update messages. | |
| void | distributeAndUpdate (MessageList &masterMessages, MessageList &distributedMessages) |
| Implementation of updating via message and sending it if necessary. | |
| virtual void | localEncodeAndUpdateScene () |
| Special update scene function used to update only the local scene from the internal objects. | |
| virtual void | createObject (const std::string &className, DtUniqueID id) |
| Create an object. | |
| virtual void | updateObject (DtUniqueID id, DtMessage &msg, unsigned int updatesize) |
| Update an object. | |
| virtual void | destroyObject (DtUniqueID id) |
| Destroy an Object by it's ID. | |
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. | |
Protected Attributes | |
| DtDe & | myDe |
| UpdaterMap | myUpdaterMap |
| std::pair< DtUniqueID, DtAgentUpdateResolverInterface * > | myLastObjectCache |
| DtSceneProctor * | mySceneProctor |
| DtLockedBufferedQueue < MessageParcel > | myAsynchronousMessageQueue |
| NamespaceMap | myNamespaceMap |
| unsigned char | myNextValidNamespaceIdGuess |
| boost::detail::atomic_count | myAtomicWaitingCount |
| boost::condition | myRequestIgCondition |
| boost::condition | myReleaseIgCondition |
| boost::mutex | myMonitor |
| bool | myForceCheckAysncMessages |
Protected Attributes inherited from makVrv::DtAgentManagerInterface | |
| DtUniqueID | myNamespaceId |
| DtUniqueID | myFreeID |
| unsigned int | myUpdateCallIndex |
| AgentList | myUpdatedObjects |
| AgentList | myToBeDeletedObjects |
| const DtAgentFactory * | myDriverFactory |
| OrderedCallList | myMasterList |
Friends | |
| class | DtAsynchronousAgentManager |
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. | |
The DtAgentManager manages the distributed scene object framework.
This includes the objects and updates as well as the drivers used to control the objects.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| makVrv::DtAgentManager::DtAgentManager | ( | DtDe & | ) |
CTOR.
|
virtual |
DTOR.
|
virtual |
Cleans up the agent manager.
Should be called prior to deletion. This is not called from the destructor, so call this to clean up any outstanding messages before deleting the manager
|
virtual |
Tick the scene manager.
This will generate a message and deliver that message to the slaves (if the IG is the master) and handle the message.
Implements makVrv::DtAgentManagerInterface.
|
virtual |
Update the scene from an update message.
|
virtual |
Find the update handler for a particular object id.
Referenced by makVrv::Cast< DesiredType >::toFunctionType().
| DtElementID makVrv::DtAgentManager::findElementId | ( | DtUniqueID | id | ) |
Attempt to find the element ID for a scene object id.
|
virtual |
Return true if the given element is visible in the first available model set.
Will not check element data, only the state of the scene object
|
virtual |
Create a new DtAsynchronousAgentManager.
An asynchronous interface is required if a Driver will be executing in a separate thread. The Interface returned should be deallocated by the Sim Driver when it is finished with it.
| void makVrv::DtAgentManager::checkForIgLock | ( | bool | forceLock = false | ) |
An internal function the scene manager calls to allow for asynchronous scene managers to use the DtDe& reference.
|
virtual |
Get the locked de.
The calling thread will get the de instance. which will be thread safe. This will stall the main thread and possibly other threads as well. Use only when necessary and release when possible. This should only be called by a separate thread.
|
virtual |
Release the locked de, the de reference is now invalid to be used in the thread.
This should only be called by a separate thread. This must be called after acquireLockedIg or the entire process will be in deadlock.
|
inline |
Get the scene manager's Ig object.
| void makVrv::DtAgentManager::clear | ( | ) |
Forcibly clear the scene.
This function normally should not be called. It is called in the case when a slave losses it's connection to the master.
|
protectedvirtual |
Acquire a namespace.
Namespace ids are used by additional SceneManagerInterfaces to ensure there are not id collisions. There are a total of 255 namespaces (0 is reserved for the SceneManager). Once a namespace is acquired it must be released due to the possibility of running out. The DtAsynchronousAgentManager automatically releases its id when it is destroyed.
| DtCorruptedState | if all available namspaces are in use. |
|
protectedvirtual |
Release a namespace id, this should be called by a SceneManagerInterface DTOR.
|
protectedvirtual |
Add asynchronous update messages.
This function is thread-safe and reentrant, which allows it to be called by DtAsynchronousSceneManagerInterfaces in separate threads. This function does not need to be called by any other classes. Ownership of the memory is transfered to the main thread.
| DtInvalidInput | if the message pointer is null. |
|
protected |
Implementation of updating via message and sending it if necessary.
|
protectedvirtual |
Special update scene function used to update only the local scene from the internal objects.
This is automatically called by tick if there is only a single master IG.
|
protectedvirtual |
Create an object.
|
protectedvirtual |
Update an object.
|
protectedvirtual |
Destroy an Object by it's ID.
|
friend |
| boost::signal<void (DtUniqueID id)> makVrv::DtAgentManager::signal_objectCreated |
Signal for creation of actual objects (represented by their unique id).
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |