VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
multiTaskControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
16 
18 
24 {
25 
26 public:
27 
34  DtSimulationServices* simServices,
35  DtComponentDescriptor* compDesc = 0,
36  DtReaderWriterRegistry* parentRegistry = 0);
37 
39  virtual ~DtMultiTaskControllerComponent() override;
40 
41  virtual bool init() override;
42 
47  virtual void postTick() override;
48 
57  virtual bool beginProcessingTask(const DtTaskMessage& task, DtSimTaskStatePtr taskState) override;
58 
64  virtual void taskComplete(int taskId, bool success);
65 
67  virtual void clearTask(int taskId);
68 
71  virtual void suspendTask(int taskId);
72 
74  virtual DtTaskMessage* currentTaskMessage(int taskId);
75 
84  virtual DtSimTaskStatePtr currentTaskState(int taskId) const;
85 
89  virtual int sendSubtask(DtSimTask& task, int taskId);
90 
98  virtual int sendTask(DtSimTask& task, const DtUUID& receiver, int parentTaskId,
99  bool actAsSubtask = true, bool useRadio = false);
100 
105  virtual void clearSubtask(int subtaskId, int parentTaskId);
106 
110  virtual void addPendingSubtaskId(int subtaskId, int taskId);
111 
116  virtual bool findPendingSubtaskId(int subtaskId, int taskId);
117 
119  virtual bool isSubtasked() const;
120 
125  virtual void removePendingSubtaskId(int subtaskId, int taskId);
126 
129  virtual DtSubtaskStatusEntry* subtaskStatus(int subtaskId, int taskId);
130 
135  virtual void removeAllPendingSubtaskIds(int taskId);
136 
138  virtual std::vector<int> currentPendingSubstaskIds(int taskId) const;
139 
142  virtual bool decideToGiveUpTask() const;
143 
147  virtual void giveUpTask();
148 
150  virtual bool taskActive(int taskId) const override;
151 
153  virtual bool clearTopLevelTasks() override;
154 
156  virtual void clearConflictingTopLevelTasks(const DtSimTaskMessageType& conflictType) override;
157 
159  virtual void clearTasksByType(const DtSimTaskMessageType& taskType) override;
160 
162  virtual void clearTaskById(int taskId) override;
163 
164  virtual DtSuspendedTaskInfo* suspendTaskById(int taskId) override;
165 
166  virtual DtSuspendedTaskInfo* suspendSubtaskById(int taskId, int subtaskId) override;
167 
169  virtual std::list<DtTaskMessage*> currentTaskMessages() const override;
170 
172  virtual DtTaskWithTaskStateListPtr topLevelTasks() const override;
173 
176  virtual void setScriptTickPeriod(const DtString& scriptId, double period);
177 
180 
182  virtual makVrf::DtLineTaskVisualizationPtr lineTaskVisualization(int taskId, const DtString& name);
183 
185  virtual makVrf::DtAreaTaskVisualizationPtr areaTaskVisualization(int taskId, const DtString& name);
186 
188  virtual makVrf::DtTextTaskVisualizationPtr textTaskVisualization(int taskId, const DtString& name);
189 
191  virtual void destroyTaskVisualization(int taskId, const DtString& name);
192 
194  virtual void destroyTaskVisualizations(int taskId);
195 
196  virtual void updateImgui() override;
197 
198 protected:
200  virtual void addCurrentTaskMessage(const DtTaskMessage* taskMessage);
203  virtual void clearCurrentTaskMessage(int taskId);
204 
207  virtual void clearPendingSubtasks(int taskId);
208 
212  virtual void clearSubtasksByType(const DtSimTaskMessageType& taskType, int taskId);
213 
216  virtual int taskIdWhichStartedSubtask(int subtaskId);
217 
221  virtual void cleanupInactiveSubtaskStatus(int taskId);
222 };
virtual makVrf::DtAreaTaskVisualizationPtr areaTaskVisualization(const DtString &name)
Finds an existing or creates a new area task visualization with the given name.
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual void destroyTaskVisualizations()
Destroys all task visualizations for this component.
virtual std::list< DtTaskMessage * > currentTaskMessages() const =0
This is a DtReaderWriter subclass which holds the status of a subtask that was issues by another task...
Definition: taskStatusEntry.h:28
virtual bool beginProcessingTask(const DtTaskMessage &task, DtSimTaskStatePtr taskState)
Called by the task manager when this controller should start executing the specified task...
All the information about a single suspended task. This information should be sufficient to resume th...
Definition: suspendedTaskInfo.h:23
virtual void clearTask()
Called when you want to clear out this component&#39;s task state. Base class implementation does nothing...
virtual DtTaskWithTaskStateListPtr topLevelTasks() const =0
virtual void destroyTaskVisualization(const DtString &name)
Destroys an existing task visualization.
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
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: multiTaskControllerComponent.h:23
Definition: readerWriterRegistry.h:39
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
virtual void updateImgui()
For subclasses to implement Currently just prints the current type.
virtual makVrf::DtTextTaskVisualizationPtr textTaskVisualization(const DtString &name)
Finds an existing or creates a new text task visualization with the given name.
virtual bool clearTopLevelTasks()=0
If this controller has any top level tasks (not subtasks), they are cleared.
virtual bool init() override
Calls setRadio()
virtual makVrf::DtPointTaskVisualizationPtr pointTaskVisualization(const DtString &name)
Finds an existing or creates a new point task visualization with the given name.
virtual DtSuspendedTaskInfo * suspendSubtaskById(int taskId, int subtaskId)=0
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
virtual void clearTasksByType(const DtSimTaskMessageType &taskType)=0
Clears any tasks of the specified type running in this controller.
virtual void clearConflictingTopLevelTasks(const DtSimTaskMessageType &conflictType)=0
Clears any top level tasks on this controller that conflict with the conflict task type...
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
virtual DtSuspendedTaskInfo * suspendTaskById(int taskId)=0
virtual makVrf::DtLineTaskVisualizationPtr lineTaskVisualization(const DtString &name)
Finds an existing or creates a new line task visualization with the given name.
virtual bool taskActive(int taskId) const =0
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
virtual void clearTaskById(int taskId)=0
Clears any task of the specified ID running in this controller.
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
std::shared_ptr< DtTaskWithTaskStateList > DtTaskWithTaskStateListPtr
Definition: taskAndTaskStateDefines.h:27
1) Define the interface class that will be used to represent the next and current frames...
Definition: taskVisualizationStateComponent.h:260
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
virtual void postTick()
This function is called immediately after tick() is called. Implementation in this class just ticks t...
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)