VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
embeddedEntitiesController.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
13 
15 
17 
18 #include <boost/signals2.hpp>
19 #include <tbb/mutex.h>
20 
21 struct DtEmbeddedEntity;
22 
27 {
28 public:
30  DtLocalObject* owner,
31  DtSimulationServices* simManager,
32  DtComponentDescriptor* desc = 0,
33  DtReaderWriterRegistry* parentRegistry = 0);
34  virtual ~DtEmbeddedEntitiesController() override;
35 
36  static DtSimComponent* creator(const DtString& name,
37  DtLocalObject* owner,
38  DtSimulationServices* simManager,
39  DtComponentDescriptor* desc = 0,
40  DtReaderWriterRegistry* parentRegistry = 0);
41  virtual const char* type() const override;
42 
44  virtual bool init() override;
48  virtual void preFirstTickInit() override;
49 
50  virtual void registerTaskMsgCallbacks() override;
51  virtual DtEmbeddedEntitiesPSR* createPSR();
52 
55  virtual void clearTask(int tskId) override;
56 
58  virtual void tick() override;
59 
64  virtual void processEmbeddedEntityCurrentlyInContext(double deltaTime);
68  virtual bool checkWithinRecoveryRange();
71  virtual bool performDeployment();
73  virtual bool performRecovery();
75  virtual bool performSetForward();
77  virtual bool performTaskForward();
79  virtual DtVector calculateSpawnPosOfTarget();
82  virtual bool commandEeToReturn(const DtString& entityName);
84 
87  virtual DtUUID getObjectNameOfEmbeddedEntity(std::string eeName, bool& found);
88 
92  getStatusOfEmbeddedEntity(std::string eeName, bool& found);
93 
95  static void setForwardTaskCallback(DtSimMessage * msg, void * usrData);
97  static void taskForwardTaskCallback(DtSimMessage * msg, void * usrData);
99  virtual void processForwardTask(DtSimMessage * msg);
100 
102  static void deployTaskCallback(DtSimMessage * msg, void * usrData);
104  static void recoverTaskCallback(DtSimMessage * msg, void * usrData);
106  virtual void processTask(DtSimMessage * msg);
107 
109  virtual std::list<DtEmbeddedEntity> availableEmbeddedEntities();
110 
112 
113  virtual void processDeletion(const DtSimObject* spawnedObject);
115 
117 
118  static void hostRestoreCallback(DtSimMessage* message, void* usrData);
121  virtual void processHostRestore(DtSimMessage* message);
123 
124 protected:
126  virtual void restoreEmbedded(DtRwEmbeddedEntityStatus* const eeStatus);
127 
128 protected:
131 
135 
138  std::map<std::string, DtRwEmbeddedEntity*> myNamedEntityMap;
139 
142  std::list<int> myFaultedTasks;
143 
144  typedef std::map<DtUUID, boost::signals2::connection> RemovalSignalsMap;
146  tbb::mutex myRemovalMutex;
147 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual bool init() override
Calls setRadio()
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Name &lt;-&gt; type pair representing the API-exposed portion of an Embedded Entity configuration.
Definition: ifEmbeddedEntityInfoCacheResponse.h:22
Contains the DtEmbeddedEntitiesDescriptor class.
std::map< std::string, DtRwEmbeddedEntity * > myNamedEntityMap
A representation of myComponentDescriptor-&gt;embeddedEntities() where DtRwEmbeddedEntity::entityName() ...
Definition: embeddedEntitiesController.h:138
DtEmbeddedEntitiesController. Handles all tasking and name resolution of Embedded Entities...
Definition: embeddedEntitiesController.h:25
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtRwEmbeddedEntityTaskState * myEeCurrentlyProcessing
The task state of the Embedded Entity currently being processed All perform* methods, etc. are based off this value.
Definition: embeddedEntitiesController.h:134
virtual void clearTask()
Called when you want to clear out this component&#39;s task state. Base class implementation does nothing...
const DtEmbeddedEntitiesDescriptor * myComponentDescriptor
Definition: embeddedEntitiesController.h:130
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: multiTaskControllerComponent.h:23
Definition: readerWriterRegistry.h:39
tbb::mutex myRemovalMutex
Definition: embeddedEntitiesController.h:146
Holds data and provides accessors pertinent to the task state of a single Embedded Entity...
Definition: embeddedEntitiesPSR.h:24
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtEmbeddedEntitiesPSR * myProcessState
Definition: embeddedEntitiesController.h:129
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:80
DtEmbeddedEntityDeploymentState
The deployment state of an Embedded Entity. Note that entities with a status of DtDeployedAndExtant m...
Definition: rwEmbeddedEntity.h:117
PSR for use by DtEmbeddedEntitiesController Primarily concerned with managing lists of DtRwEmbeddedEn...
Definition: embeddedEntitiesPSR.h:103
Descriptor for Embedded Entity systems. Primarily contains accessors and storage mechanics for a list...
Definition: embeddedEntitiesDescriptor.h:23
std::map< DtUUID, boost::signals2::connection > RemovalSignalsMap
Definition: embeddedEntitiesController.h:144
Contains data concerning one Embedded Entity&#39;s deployment state. For use by DtEmbeddedEntitiesControl...
Definition: rwEmbeddedEntity.h:112
Contains the DtEmbeddedEntitiesPSR and DtRwEmbeddedEntityTaskState classes.
std::list< int > myFaultedTasks
Holds a list of any task ids that are uncompletable and can&#39;t be bound to any given task state such t...
Definition: embeddedEntitiesController.h:142
RemovalSignalsMap myRemovalSignalsMap
Definition: embeddedEntitiesController.h:145
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)