VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtEmbeddedEntityInfoManager Class Reference

DtEmbeddedEntityInfoManager is the central point for information about embedded entities and their capabilities. It maintains type-keyed data caching in the backend, which is used to look up configured Embedded Entities for a specified object type, as well as tasks and sets that a given embedded entity type is capable of performing.

Public Member Functions

 DtEmbeddedEntityInfoManager (DtSimulationServices *simManager, DtLocalObjectManager *)
 
 ~DtEmbeddedEntityInfoManager ()
 
virtual bool init ()
 
virtual bool hasCachedDataFor (const DtObjectType &objType) const
 
virtual bool typeIsQueuedForUpdate (const DtObjectType &objType) const
 
virtual void performCacheUpdates ()
 
virtual void suspend ()
 
virtual void resume ()
 
virtual void resetCache ()
 
virtual std::string toString ()
 
virtual void tick ()
 
virtual const std::vector
< DtEmbeddedEntity
embeddedEntityListFor (const DtObjectType &objType) const
 
virtual const std::vector
< DtSetMessageType
availableSetsFor (const DtObjectType &objType) const
 
virtual const std::vector
< DtSimTaskMessageType
availableTasksFor (const DtObjectType &objType) const
 

Protected Member Functions

virtual bool isCachableType (const DtObjectType &) const
 
virtual void queueCacheUpdateFor (const std::vector< DtEmbeddedEntity > &entities, const DtVector &position)
 
virtual DtLocalObjectcreatePrototypeObject (const DtObjectType &objType, bool &created)
 
virtual void populateCacheUsing (const DtLocalObject *const obj, bool suppressRecursion)
 
virtual void sendCacheResponseFor (const DtObjectType &requestedType)
 
virtual bool cannotBeEmbedded (const DtLocalObject &) const
 
virtual void cachePrototype (const DtObjectType &objType)
 
virtual std::vector
< DtEmbeddedEntity
retrieveEmbeddedEntityList (const DtLocalObject *const obj)
 
virtual std::vector
< DtSetMessageType
retrieveAvailableSets (const DtLocalObject *const obj)
 
virtual std::vector
< DtSimTaskMessageType
retrieveAvailableTasks (const DtLocalObject *const obj)
 
virtual void processObjectAdded (const DtLocalObject &obj)
 
virtual void addTaskBinding (const DtObjectType &objType, const DtSimTaskMessageType &taskType)
 
virtual void removeTaskBinding (const DtObjectType &objType, const DtSimTaskMessageType &taskType)
 

Protected Attributes

DtSimulationServicesmySimulationServices
 
DtLocalObjectManagermyObjectManager
 
std::vector< DtLocalObject * > myPrototypesToDelete
 
std::map< DtObjectType,
std::vector< DtEmbeddedEntity > > 
myEmbeddedEntityListCache
 
std::map< DtObjectType,
std::vector< DtSetMessageType > > 
myAvailableSetsCache
 
std::map< DtObjectType,
std::vector
< DtSimTaskMessageType > > 
myAvailableTasksCache
 
std::set< DtObjectTypemyTypesToCache
 
DtPrintInfoCacheCommand * myPrintInfoCacheCommand
 
tbb::spin_rw_mutex myMutex
 
bool mySuspended
 

Private Member Functions

 DtEmbeddedEntityInfoManager (const DtEmbeddedEntityInfoManager &orig)
 
DtEmbeddedEntityInfoManageroperator= (const DtEmbeddedEntityInfoManager &orig)
 
virtual void processEeInfoCacheRequest (DtSimMessage *msg)
 
static void eeInfoCacheRequestCallback (DtSimMessage *msg, void *usrData)
 
virtual void processScriptUpdatedCallback (const DtScriptedTaskManagerCallbackInfo &info)
 
static void scriptUpdatedCallback (const DtScriptedTaskManagerCallbackInfo &info, void *usrData)
 

Constructor & Destructor Documentation

DtEmbeddedEntityInfoManager::DtEmbeddedEntityInfoManager ( DtSimulationServices simManager,
DtLocalObjectManager  
)
DtEmbeddedEntityInfoManager::~DtEmbeddedEntityInfoManager ( )
DtEmbeddedEntityInfoManager::DtEmbeddedEntityInfoManager ( const DtEmbeddedEntityInfoManager orig)
private

copy constructor - not implemented

Member Function Documentation

virtual bool DtEmbeddedEntityInfoManager::init ( )
virtual
virtual bool DtEmbeddedEntityInfoManager::hasCachedDataFor ( const DtObjectType objType) const
virtual

Returns true if the info manager has data keyed to the given type.

virtual bool DtEmbeddedEntityInfoManager::typeIsQueuedForUpdate ( const DtObjectType objType) const
virtual

Returns true if an info update has been queued for the given type. The updates are performed near the end of the current tick, thus this is used to keep duplicated discoveries from occurring.

virtual const std::vector<DtEmbeddedEntity> DtEmbeddedEntityInfoManager::embeddedEntityListFor ( const DtObjectType objType) const
virtual

Returns copies of the cache vectors containing configured Embedded Entities, available sets, and available tasks for the given type.

virtual const std::vector<DtSetMessageType> DtEmbeddedEntityInfoManager::availableSetsFor ( const DtObjectType objType) const
virtual

Returns copies of the cache vectors containing configured Embedded Entities, available sets, and available tasks for the given type.

virtual const std::vector<DtSimTaskMessageType> DtEmbeddedEntityInfoManager::availableTasksFor ( const DtObjectType objType) const
virtual

Returns copies of the cache vectors containing configured Embedded Entities, available sets, and available tasks for the given type.

virtual void DtEmbeddedEntityInfoManager::performCacheUpdates ( )
virtual

Performs updates for all types in myTypesToCache. Should be called just before the object manager performs queued deletions.

virtual void DtEmbeddedEntityInfoManager::suspend ( )
virtual

Suspends the usage of this manager. Can be called when a scenario is closed.

virtual void DtEmbeddedEntityInfoManager::resume ( )
virtual

Resumes the usage of this manager. Call after scenario is loaded to update scripts and send out updated information.

virtual void DtEmbeddedEntityInfoManager::resetCache ( )
virtual

Resets the cache and cache request queue to initial emptiness. Should only be called by DtCgf/StSimManager on scenario load/close.

static void DtEmbeddedEntityInfoManager::eeInfoCacheRequestCallback ( DtSimMessage msg,
void *  usrData 
)
static

Handles responding to embedded entity list requests with list of embedded entity names and available tasks/sets associated with a given object type.

virtual void DtEmbeddedEntityInfoManager::processEeInfoCacheRequest ( DtSimMessage msg)
virtual

Handles responding to embedded entity list requests with list of embedded entity names and available tasks/sets associated with a given object type.

virtual std::string DtEmbeddedEntityInfoManager::toString ( )
virtual

Human-readable string form of the Info Manager's cache state, used for debugging.

virtual void DtEmbeddedEntityInfoManager::tick ( )
virtual

Deletes prototypes.

virtual bool DtEmbeddedEntityInfoManager::isCachableType ( const DtObjectType ) const
protectedvirtual

Returns true if this type should be checked for tasks/sets.

virtual void DtEmbeddedEntityInfoManager::queueCacheUpdateFor ( const std::vector< DtEmbeddedEntity > &  entities,
const DtVector position 
)
protectedvirtual

Called internally by the info manager by performCacheUpdates() and processObjectAdded()

virtual DtLocalObject* DtEmbeddedEntityInfoManager::createPrototypeObject ( const DtObjectType objType,
bool created 
)
protectedvirtual

Called by performCacheUpdates() to create a short-lived object which is ticked once to prepare the object for populateCacheUsing() then deleted.

virtual std::vector<DtEmbeddedEntity> DtEmbeddedEntityInfoManager::retrieveEmbeddedEntityList ( const DtLocalObject *const  obj)
protectedvirtual

Methods that retrieve the applicable data from live(prototyped) objects. Note that these methods do not themselves interact with the caches in any way.

virtual std::vector<DtSetMessageType> DtEmbeddedEntityInfoManager::retrieveAvailableSets ( const DtLocalObject *const  obj)
protectedvirtual

Methods that retrieve the applicable data from live(prototyped) objects. Note that these methods do not themselves interact with the caches in any way.

virtual std::vector<DtSimTaskMessageType> DtEmbeddedEntityInfoManager::retrieveAvailableTasks ( const DtLocalObject *const  obj)
protectedvirtual

Methods that retrieve the applicable data from live(prototyped) objects. Note that these methods do not themselves interact with the caches in any way.

virtual void DtEmbeddedEntityInfoManager::populateCacheUsing ( const DtLocalObject *const  obj,
bool  suppressRecursion 
)
protectedvirtual

Calls the various retrieve* methods, populates the caches, and optionally queues recursive lookups.

virtual void DtEmbeddedEntityInfoManager::processObjectAdded ( const DtLocalObject obj)
protectedvirtual

Processes added objects by calling populateCacheUsing()

static void DtEmbeddedEntityInfoManager::scriptUpdatedCallback ( const DtScriptedTaskManagerCallbackInfo info,
void *  usrData 
)
staticprotected

Handles keeping the info cache in sync with scripted tasks.

virtual void DtEmbeddedEntityInfoManager::processScriptUpdatedCallback ( const DtScriptedTaskManagerCallbackInfo info)
protectedvirtual

Handles keeping the info cache in sync with scripted tasks.

virtual void DtEmbeddedEntityInfoManager::sendCacheResponseFor ( const DtObjectType requestedType)
protectedvirtual

Constructs and sends out the actual Cache Response. Used by processEeInfoCacheRequest, and processScriptUpdatedCallback if necessary.

virtual void DtEmbeddedEntityInfoManager::addTaskBinding ( const DtObjectType objType,
const DtSimTaskMessageType taskType 
)
protectedvirtual

Helper methods for the processScriptUpdatedCallback.

virtual void DtEmbeddedEntityInfoManager::removeTaskBinding ( const DtObjectType objType,
const DtSimTaskMessageType taskType 
)
protectedvirtual

Helper methods for the processScriptUpdatedCallback.

virtual bool DtEmbeddedEntityInfoManager::cannotBeEmbedded ( const DtLocalObject ) const
protectedvirtual
virtual void DtEmbeddedEntityInfoManager::cachePrototype ( const DtObjectType objType)
protectedvirtual
DtEmbeddedEntityInfoManager& DtEmbeddedEntityInfoManager::operator= ( const DtEmbeddedEntityInfoManager orig)
private

assignment operator - not implemented

Member Data Documentation

DtSimulationServices* DtEmbeddedEntityInfoManager::mySimulationServices
protected
DtLocalObjectManager* DtEmbeddedEntityInfoManager::myObjectManager
protected
std::vector<DtLocalObject*> DtEmbeddedEntityInfoManager::myPrototypesToDelete
protected
std::map<DtObjectType, std::vector<DtEmbeddedEntity> > DtEmbeddedEntityInfoManager::myEmbeddedEntityListCache
protected
std::map<DtObjectType, std::vector<DtSetMessageType> > DtEmbeddedEntityInfoManager::myAvailableSetsCache
protected
std::map<DtObjectType, std::vector<DtSimTaskMessageType> > DtEmbeddedEntityInfoManager::myAvailableTasksCache
protected
std::set<DtObjectType> DtEmbeddedEntityInfoManager::myTypesToCache
protected
DtPrintInfoCacheCommand* DtEmbeddedEntityInfoManager::myPrintInfoCacheCommand
protected
tbb::spin_rw_mutex DtEmbeddedEntityInfoManager::myMutex
mutableprotected
bool DtEmbeddedEntityInfoManager::mySuspended
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)