VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 type-keyed data caching in the backend, such as configured Embedded Entities for a type, as well as tasks and sets that a given type is capable of performing. More...

Public Member Functions

 DtEmbeddedEntityInfoManager (DtSimManager *simManager)
 ~DtEmbeddedEntityInfoManager ()
virtual bool init ()
virtual bool hasCachedDataFor (const DtObjectType &objType) const
 Returns true if the info manager has data keyed to the given type.
virtual bool typeIsQueuedForUpdate (const DtObjectType &objType) const
 Returns true if an info update has been queued for the given type.
virtual const DtSimManagersimManager () const
 Get a const pointer to the simulation manager.
virtual DtSimManagersimManager ()
 Get a pointer to the simulation manager.
virtual void performCacheUpdates ()
 Performs updates for all types in myTypesToCache.
virtual void resetCache ()
 Resets the cache and cache request queue to initial emptiness.
virtual std::string toString ()
 Human-readable string form of the Info Manager's cache state, used for debugging.
virtual const std::vector
< DtEmbeddedEntity
embeddedEntityListFor (const DtObjectType &objType) const
 Returns copies of the cache vectors containing configured Embedded Entities, available sets, and available tasks for the given type.
virtual const std::vector
< DtSetMessageType
availableSetsFor (const DtObjectType &objType) const
 Returns copies of the cache vectors containing configured Embedded Entities, available sets, and available tasks for the given type.
virtual const std::vector
< DtSimTaskMessageType
availableTasksFor (const DtObjectType &objType) const
 Returns copies of the cache vectors containing configured Embedded Entities, available sets, and available tasks for the given type.

Protected Member Functions

virtual bool isCachableType (const DtObjectType &) const
 Returns true if this type should be checked for tasks/sets.
virtual void queueCacheUpdateFor (const std::vector< DtEmbeddedEntity > &entities, const DtVector &position)
 Called internally by the info manager by performCacheUpdates() and processObjectAdded()
virtual DtVrfObjectcreatePrototypeObject (const DtObjectType &objType, const DtVector &position)
 Called by performCacheUpdates() to create a short-lived object which is ticked once to prepare the object for populateCacheUsing() then deleted.
virtual void populateCacheUsing (const DtVrfObject *const obj, bool suppressRecursion)
 Calls the various retrieve* methods, populates the caches, and optionally queues recursive lookups.
virtual void sendCacheResponseFor (const DtObjectType &requestedType)
 Constructs and sends out the actual Cache Response.
virtual std::vector
< DtEmbeddedEntity
retrieveEmbeddedEntityList (const DtVrfObject *const obj)
 Methods that retrieve the applicable data from live(prototyped) objects.
virtual std::vector
< DtSetMessageType
retrieveAvailableSets (const DtVrfObject *const obj)
 Methods that retrieve the applicable data from live(prototyped) objects.
virtual std::vector
< DtSimTaskMessageType
retrieveAvailableTasks (const DtVrfObject *const obj)
 Methods that retrieve the applicable data from live(prototyped) objects.
virtual void addTaskBinding (const DtObjectType &objType, const DtSimTaskMessageType &taskType)
 Helper methods for the processScriptUpdatedCallback.
virtual void removeTaskBinding (const DtObjectType &objType, const DtSimTaskMessageType &taskType)
 Helper methods for the processScriptUpdatedCallback.

Protected Attributes

DtSimManagermySimManager
std::map< DtObjectType,
std::vector< DtEmbeddedEntity > > 
myEmbeddedEntityListCache
std::map< DtObjectType,
std::vector< DtSetMessageType > > 
myAvailableSetsCache
std::map< DtObjectType,
std::vector
< DtSimTaskMessageType > > 
myAvailableTasksCache
std::map< DtObjectType, DtVectormyTypesToCache
DtPrintInfoCacheCommand * myPrintInfoCacheCommand

Private Member Functions

 DtEmbeddedEntityInfoManager (const DtEmbeddedEntityInfoManager &orig)
 copy constructor - not implemented
DtEmbeddedEntityInfoManageroperator= (const DtEmbeddedEntityInfoManager &orig)
 assignment operator - not implemented
virtual void processEeInfoCacheRequest (DtSimMessage *msg)
 Handles responding to embedded entity list requests with list of embedded entity names and available tasks/sets associated with a given object type.
static void eeInfoCacheRequestCallback (DtSimMessage *msg, void *usrData)
 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 processObjectAdded (const DtVrfObject &obj)
 Processes added objects by calling populateCacheUsing()
static void objectAddedCallback (DtVrfObject *obj, void *usrData)
 Processes added objects by calling populateCacheUsing()
virtual void processScriptUpdatedCallback (const DtScriptedTaskManagerCallbackInfo &info)
 Handles keeping the info cache in sync with scripted tasks.
static void scriptUpdatedCallback (const DtScriptedTaskManagerCallbackInfo &info, void *usrData)
 Handles keeping the info cache in sync with scripted tasks.

Detailed Description

DtEmbeddedEntityInfoManager is the central point for type-keyed data caching in the backend, such as configured Embedded Entities for a type, as well as tasks and sets that a given type is capable of performing.

Constructor & Destructor Documentation

DtEmbeddedEntityInfoManager::DtEmbeddedEntityInfoManager ( DtSimManager simManager)
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 occuring.

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 const DtSimManager* DtEmbeddedEntityInfoManager::simManager ( ) const
virtual

Get a const pointer to the simulation manager.

virtual DtSimManager* DtEmbeddedEntityInfoManager::simManager ( )
virtual

Get a pointer to the simulation manager.

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::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 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 DtVrfObject* DtEmbeddedEntityInfoManager::createPrototypeObject ( const DtObjectType &  objType,
const DtVector position 
)
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 DtVrfObject *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 DtVrfObject *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 DtVrfObject *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 DtVrfObject *const  obj,
bool  suppressRecursion 
)
protectedvirtual

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

static void DtEmbeddedEntityInfoManager::objectAddedCallback ( DtVrfObject obj,
void *  usrData 
)
staticprotected

Processes added objects by calling populateCacheUsing()

virtual void DtEmbeddedEntityInfoManager::processObjectAdded ( const DtVrfObject 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.

DtEmbeddedEntityInfoManager& DtEmbeddedEntityInfoManager::operator= ( const DtEmbeddedEntityInfoManager orig)
private

assignment operator - not implemented

Member Data Documentation

DtSimManager* DtEmbeddedEntityInfoManager::mySimManager
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::map<DtObjectType, DtVector> DtEmbeddedEntityInfoManager::myTypesToCache
protected
DtPrintInfoCacheCommand* DtEmbeddedEntityInfoManager::myPrintInfoCacheCommand
protected

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

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)