VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
embeddedEntityInfoManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
14 
16 #include "vrfmsgs/messageTypes.h"
17 
18 #include <list>
19 #include <map>
20 
21 #include <tbb/spin_rw_mutex.h>
22 
23 class DtObjectType;
24 class DtPrintInfoCacheCommand;
26 class DtSimMessage;
27 class DtLocalObject;
29 
30 struct DtEmbeddedEntity;
31 
37 {
38 public:
41 
42  virtual bool init();
43 
45  virtual bool hasCachedDataFor(const DtObjectType& objType) const;
46 
49  virtual bool typeIsQueuedForUpdate(const DtObjectType& objType) const;
50 
54  virtual const std::vector<DtEmbeddedEntity> embeddedEntityListFor(const DtObjectType& objType)const;
55  virtual const std::vector<DtSetMessageType> availableSetsFor(const DtObjectType& objType)const;
56  virtual const std::vector<DtSimTaskMessageType> availableTasksFor(const DtObjectType& objType) const;
58 
61  virtual void performCacheUpdates();
62 
64  virtual void suspend();
65 
67  virtual void resume();
68 
71  virtual void resetCache();
72 
76  static void eeInfoCacheRequestCallback(DtSimMessage* msg, void* usrData);
77  virtual void processEeInfoCacheRequest(DtSimMessage* msg);
79 
81  virtual std::string toString();
82 
84  virtual void tick();
85 
86 protected:
87 
89  virtual bool isCachableType(const DtObjectType&) const;
90 
92  virtual void queueCacheUpdateFor(const std::vector<DtEmbeddedEntity>& entities, const DtVector& position);
93 
96  virtual DtLocalObject* createPrototypeObject(const DtObjectType& objType, bool& created);
97 
101  virtual std::vector<DtEmbeddedEntity> retrieveEmbeddedEntityList(const DtLocalObject* const obj);
102  virtual std::vector<DtSetMessageType> retrieveAvailableSets(const DtLocalObject* const obj);
103  virtual std::vector<DtSimTaskMessageType> retrieveAvailableTasks(const DtLocalObject* const obj);
105 
107  virtual void populateCacheUsing(const DtLocalObject* const obj, bool suppressRecursion);
108 
111  virtual void processObjectAdded(const DtLocalObject& obj);
113 
116  static void scriptUpdatedCallback(const DtScriptedTaskManagerCallbackInfo& info, void* usrData);
117  virtual void processScriptUpdatedCallback(const DtScriptedTaskManagerCallbackInfo& info);
119 
122  virtual void sendCacheResponseFor(const DtObjectType& requestedType);
123 
126  virtual void addTaskBinding(const DtObjectType& objType, const DtSimTaskMessageType& taskType);
127  virtual void removeTaskBinding(const DtObjectType& objType, const DtSimTaskMessageType& taskType);
129 
130  virtual bool cannotBeEmbedded(const DtLocalObject&) const;
131 
132  virtual void cachePrototype(const DtObjectType& objType);
133 
134 private:
137 
140 
141 protected:
142 
145 
146  std::vector<DtLocalObject*> myPrototypesToDelete;
147  std::map<DtObjectType, std::vector<DtEmbeddedEntity> > myEmbeddedEntityListCache;
148  std::map<DtObjectType, std::vector<DtSetMessageType> > myAvailableSetsCache;
149  std::map<DtObjectType, std::vector<DtSimTaskMessageType> > myAvailableTasksCache;
150 
151  std::set<DtObjectType> myTypesToCache;
152 
153  DtPrintInfoCacheCommand* myPrintInfoCacheCommand;
154 
155  mutable tbb::spin_rw_mutex myMutex;
156 
158 };
class DtLocalObjectManager:
Definition: localObjectManager.h:151
Name &lt;-&gt; type pair representing the API-exposed portion of an Embedded Entity configuration.
Definition: ifEmbeddedEntityInfoCacheResponse.h:22
DtLocalObjectManager * myObjectManager
Definition: embeddedEntityInfoManager.h:144
std::map< DtObjectType, std::vector< DtSetMessageType > > myAvailableSetsCache
Definition: embeddedEntityInfoManager.h:148
std::set< DtObjectType > myTypesToCache
Definition: embeddedEntityInfoManager.h:151
Definition: objectType.h:27
bool mySuspended
Definition: embeddedEntityInfoManager.h:157
DtEmbeddedEntityInfoManager is the central point for information about embedded entities and their ca...
Definition: embeddedEntityInfoManager.h:36
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
File: simMsg.h.
Definition: simMessage.h:35
tbb::spin_rw_mutex myMutex
Definition: embeddedEntityInfoManager.h:155
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
std::vector< DtLocalObject * > myPrototypesToDelete
Definition: embeddedEntityInfoManager.h:146
Definition: scriptedTaskManager.h:45
std::map< DtObjectType, std::vector< DtEmbeddedEntity > > myEmbeddedEntityListCache
Definition: embeddedEntityInfoManager.h:147
std::map< DtObjectType, std::vector< DtSimTaskMessageType > > myAvailableTasksCache
Definition: embeddedEntityInfoManager.h:149
DtSimulationServices * mySimulationServices
Definition: embeddedEntityInfoManager.h:143
DtPrintInfoCacheCommand * myPrintInfoCacheCommand
Definition: embeddedEntityInfoManager.h:153
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

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)