VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
taskControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 
13 #pragma once
14 
16 #include "vrftasks/simTaskState.h"
20 
21 
22 class DtSimManager;
23 class DtTaskMessage;
24 class DtSimMessage;
26 
27 typedef void (*DtTaskMessageCallbackFcn)(DtSimMessage * msg, void * usr,
29 
31 {
33  void* myUserData;
35 
49 {
50 
51 public:
52 
59  DtSimulationServices* simServices,
60  DtComponentDescriptor* compDesc = 0,
61  DtReaderWriterRegistry* parentRegistry = 0);
62 
64  virtual ~DtTaskControllerComponent();
65 
67  virtual const char* type() const = 0;
68 
77  virtual bool beginProcessingTask(const DtTaskMessage& task,
78  DtSimTaskStatePtr taskState);
79 
82  virtual void taskNotify(const DtSimTask & task) {};
83 
85  virtual void setTasked(bool tasked);
88  virtual bool tasked() const;
90 
96  virtual bool showCurrentTaskInGui() const;
97 
99  virtual void setRadio(DtSimRadio * radio);
100 
101  virtual void registerTaskMsgCallbacks();
102 
114  virtual void addTaskProcessorCallback(const DtSimTaskMessageType& taskType, DtTaskMessageCallbackFcn fcn, void* usr);
115 
118  virtual void addTaskProcessorCallback(const DtSimTaskMessageType& taskType, DtMessageCallbackFcn fcn, void* usr);
119 
120 
122  virtual void removeTaskProcessorCallback(const DtSimTaskMessageType& taskType, DtMessageCallbackFcn fcn, void* usr);
123 
126  virtual void removeTaskProcessorCallback(const DtSimTaskMessageType& taskType, DtTaskMessageCallbackFcn fcn, void* usr);
127 
131  static void deprecatedTaskProcessorCallbackAdapter(DtSimMessage * msg, void * usr,
132  DtSimTaskStatePtr taskState);
133 
135  virtual bool taskActive(int taskId) const = 0;
136 
139  virtual bool clearTopLevelTasks() = 0;
140 
143  virtual void clearConflictingTopLevelTasks(const DtSimTaskMessageType& conflictType) = 0;
144 
146  virtual void clearTasksByType(const DtSimTaskMessageType& taskType) = 0;
147 
149  virtual void clearTaskById(int taskId) = 0;
150 
151  virtual DtSuspendedTaskInfo* suspendTaskById(int taskId) = 0;
152 
153  virtual DtSuspendedTaskInfo* suspendSubtaskById(int taskId, int subtaskId) = 0;
154 
157  virtual std::list<DtTaskMessage*> currentTaskMessages() const = 0;
158 
161  virtual DtTaskWithTaskStateListPtr topLevelTasks() const = 0;
162 
164  virtual void enable();
165 
169  virtual void disable();
170 
172  virtual void sendTaskCanceled(DtTaskMessage* taskMsg);
173 
177  virtual bool taskVisualizationsActive() const;
178 
179 protected:
180 
183  virtual void suspendSubtasksOfTask(int taskId, DtSuspendedTaskInfo* suspendInfo);
184 
187  virtual void suspendSubtaskOfTask(int taskId, int subtaskId, DtSuspendedTaskInfo* suspendInfo);
188 
190  virtual DtSimTaskMessageType remapScriptId(const DtSimTaskMessageType&) const;
191 
192 protected:
193 
196  typedef std::pair<DtTaskMessageCallbackFcn, void*> DtTaskCallbackMapPair;
197  typedef std::map<DtSimTaskMessageType, DtTaskCallbackMapPair> DtTaskCallbackMap;
199 
202  std::list<DtTaskProcessorCallbackInfo*> myTaskProcessorCallbackInfoList;
203 
205 
206 private:
210 
213 
216  orig);
217 };
218 
void(* DtTaskMessageCallbackFcn)(DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
Definition: taskControllerComponent.h:27
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
virtual bool taskVisualizationsActive() const
Returns true if task visualizations are currently active for this component. Default behavior is to r...
Definition: simRadio.h:30
All the information about a single suspended task. This information should be sufficient to resume th...
Definition: suspendedTaskInfo.h:23
virtual void setRadio(DtSimRadio *radio)
DtMessageCallbackFcn myFunction
Definition: taskControllerComponent.h:32
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
std::map< DtSimTaskMessageType, DtTaskCallbackMapPair > DtTaskCallbackMap
Definition: taskControllerComponent.h:197
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
End User Description: DtTaskControllerComponent is the base class for all controllers that respond to...
Definition: taskControllerComponent.h:48
Definition: readerWriterRegistry.h:39
virtual void disable()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
virtual void taskNotify(const DtSimTask &task)
This is called to let us know when some other component receives a task In the case of this component...
Definition: taskControllerComponent.h:82
virtual DtSimTaskStatePtr taskState()
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
void * myUserData
Definition: taskControllerComponent.h:33
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
virtual void enable()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
File: simMsg.h.
Definition: simMessage.h:35
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
DtBoost::shared_ptr< DtTaskWithTaskStateList > DtTaskWithTaskStateListPtr
Definition: taskAndTaskStateDefines.h:27
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
Definition: taskControllerComponent.h:30
bool myTaskIsRunning
Definition: taskControllerComponent.h:204
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:121
std::list< DtTaskProcessorCallbackInfo * > myTaskProcessorCallbackInfoList
This list stores any DtTaskProcessorCallbackInfo allocated locally so that they can be deleted when t...
Definition: taskControllerComponent.h:202
struct DtTaskProcessorCallbackInfo DtTaskProcessorCallbackInfo
DtTaskCallbackMap myTaskCallbackMap
Definition: taskControllerComponent.h:198
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
std::pair< DtTaskMessageCallbackFcn, void * > DtTaskCallbackMapPair
This map stores callbacks that have been registered to processes various tasks. The map is indexed by...
Definition: taskControllerComponent.h:196
DtCallbackList< DtSimMessage * >::DtCallbackFunctionType DtMessageCallbackFcn
Message callback function signature.
Definition: messageExecutive.h:21
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)