VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
singleTaskControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 
17 
23 {
24 
25 public:
26 
33  DtSimulationServices* simServices,
34  DtComponentDescriptor* compDesc = nullptr,
35  DtReaderWriterRegistry* parentRegistry = nullptr);
36 
38  virtual ~DtSingleTaskControllerComponent() override;
39 
44  virtual void postTick() override;
45 
54  virtual bool beginProcessingTask(const DtTaskMessage& task,
55  DtSimTaskStatePtr taskState) override;
56 
59  virtual void taskNotify(const DtSimTask & task) override;
60 
61 
66  virtual void taskComplete(bool success = true);
67 
71  virtual void clearTask() override;
72 
75  virtual void suspendTask();
76 
80  virtual int sendSubtask(DtSimTask& task);
81 
85  virtual void clearSubtask(int subtaskId);
86 
90  virtual void addPendingSubtaskId(int subtaskId);
91 
96  virtual bool findPendingSubtaskId(int subtaskId);
97 
99  virtual bool isSubtasked() const;
100 
105  virtual void removePendingSubtaskId(int subtaskId);
106 
109  virtual void removeAllPendingSubtaskIds();
110 
112  virtual std::vector<int> currentPendingSubstaskIds() const;
113 
115  virtual DtSubtaskStatusEntry* subtaskStatus(int subtaskId);
116 
119  //virtual DtTaskMessage* pendingSubtask(int subtaskId, DtString& controller) const;
120 
122  virtual void clearCurrentTaskMessage();
123 
125  virtual DtTaskMessage * currentTaskMessage() const;
126 
135  virtual DtSimTaskStatePtr currentTaskState() const;
136 
150 
151 
152  const DtString TaskStatusRunning = "TaskRunning";
153  const DtString TaskStatusNotActive = "TaskNotActive";
154 
162  virtual void initializeTaskInformationStateProperty(const DtSimTaskMessageType& taskType);
163 
169  virtual void updateCurrentTaskInformationStatusProperty(const DtString& status);
170 
173  virtual DtString taskInformationStatusPropertyValue(const DtSimTaskMessageType& taskType) const;
174 
178  virtual DtString currentTaskInformationStatusPropertyValue() const;
179 
183  virtual DtRwPropertiesStructure* taskInformationProperty(const DtSimTaskMessageType& taskType);
184 
188  virtual DtRwPropertiesStructure* currentTaskInformationProperty();
190 
200  virtual bool decideToGiveUpTask() const;
201 
205  virtual void giveUpTask();
206 
208  virtual bool taskActive(int taskId) const override;
209 
211  virtual bool clearTopLevelTasks() override;
212 
214  virtual void clearConflictingTopLevelTasks(const DtSimTaskMessageType& conflictType) override;
215 
217  virtual void clearTasksByType(const DtSimTaskMessageType& taskType) override;
218 
220  virtual void clearTaskById(int taskId) override;
221 
222  virtual DtSuspendedTaskInfo* suspendTaskById(int taskId) override;
223 
224  virtual DtSuspendedTaskInfo* suspendSubtaskById(int taskId, int subtaskId) override;
225 
227  virtual std::list<DtTaskMessage*> currentTaskMessages() const override;
228 
230  virtual DtTaskWithTaskStateListPtr topLevelTasks() const override;
231 
233  virtual void disable() override;
234 
235  virtual void updateImgui() override;
236 
237 protected:
240  virtual void clearPendingSubtasks();
241 
245  virtual void clearSubtasksByType(const DtSimTaskMessageType& taskType);
246 
250  virtual void cleanupInactiveSubtaskStatus();
251 };
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...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
virtual DtTaskWithTaskStateListPtr topLevelTasks() const =0
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
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
virtual void updateImgui()
For subclasses to implement Currently just prints the current type.
virtual bool clearTopLevelTasks()=0
If this controller has any top level tasks (not subtasks), they are cleared.
virtual void taskNotify(const DtSimTask &task) override
This is called to let us know when some other component receives a task In the case of this component...
Definition: taskControllerComponent.h:106
A structure composed of distinct fields, each of which is itself a property. The DtRwPropertiesStruct...
Definition: rwPropertiesStructure.h:21
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 disable() override
Overridden to 1) remove any task message callbacks registered by this controller 2) call clear task...
virtual void clearConflictingTopLevelTasks(const DtSimTaskMessageType &conflictType)=0
Clears any top level tasks on this controller that conflict with the conflict task type...
virtual DtSuspendedTaskInfo * suspendTaskById(int taskId)=0
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
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)