VR-Forces 5.0.1 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 
40 
41  virtual bool init();
42 
47  virtual void postTick();
48 
57  virtual bool beginProcessingTask(const DtTaskMessage& task,
58  DtSimTaskStatePtr taskState);
59 
65  virtual void taskComplete(int taskId, bool success);
66 
68  virtual void clearTask(int taskId);
69 
72  virtual void suspendTask(int taskId);
73 
75  virtual DtTaskMessage* currentTaskMessage(int taskId);
76 
82  virtual DtSimTaskStatePtr currentTaskState(int taskId) const;
83 
87  virtual int sendSubtask(DtSimTask& task, int taskId);
88 
96  virtual int sendTask(DtSimTask& task, const DtUUID& receiver, int taskId,
97  bool actAsSubtask = true, bool useRadio = false);
98 
103  virtual void clearSubtask(int subtaskId, int taskId);
104 
108  virtual void addPendingSubtaskId(int subtaskId, int taskId);
109 
114  virtual bool findPendingSubtaskId(int subtaskId, int taskId);
115 
117  virtual bool isSubtasked() const;
118 
123  virtual void removePendingSubtaskId(int subtaskId, int taskId);
124 
127  virtual DtSubtaskStatusEntry* subtaskStatus(int subtaskId, int taskId);
128 
133  virtual void removeAllPendingSubtaskIds(int taskId);
134 
136  virtual std::vector<int> currentPendingSubstaskIds(int taskId) const;
137 
140  virtual bool decideToGiveUpTask() const;
141 
145  virtual void giveUpTask();
146 
148  virtual bool taskActive(int taskId) const;
149 
151  virtual bool clearTopLevelTasks();
152 
154  virtual void clearConflictingTopLevelTasks(const DtSimTaskMessageType& conflictType);
155 
157  virtual void clearTasksByType(const DtSimTaskMessageType& taskType);
158 
160  virtual void clearTaskById(int taskId);
161 
162  virtual DtSuspendedTaskInfo* suspendTaskById(int taskId);
163 
164  virtual DtSuspendedTaskInfo* suspendSubtaskById(int taskId, int subtaskId);
165 
167  virtual std::list<DtTaskMessage*> currentTaskMessages() const;
168 
171 
174  virtual void setScriptTickPeriod(const DtString& scriptId, double period);
175 
178 
180  virtual makVrf::DtLineTaskVisualizationPtr lineTaskVisualization(int taskId, const DtString& name);
181 
183  virtual makVrf::DtAreaTaskVisualizationPtr areaTaskVisualization(int taskId, const DtString& name);
184 
186  virtual makVrf::DtTextTaskVisualizationPtr textTaskVisualization(int taskId, const DtString& name);
187 
189  virtual void destroyTaskVisualization(int taskId, const DtString& name);
190 
192  virtual void destroyTaskVisualizations(int taskId);
193 
194 protected:
196  virtual void addCurrentTaskMessage(const DtTaskMessage* taskMessage);
199  virtual void clearCurrentTaskMessage(int taskId);
200 
203  virtual void clearPendingSubtasks(int taskId);
204 
208  virtual void clearSubtasksByType(const DtSimTaskMessageType& taskType, int taskId);
209 
212  virtual int taskIdWhichStartedSubtask(int subtaskId);
213 
217  virtual void cleanupInactiveSubtaskStatus(int taskId);
218 };
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: rwUUID.h:226
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:27
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
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()
Calls setRadio()
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
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.
DtBoost::shared_ptr< DtTaskWithTaskStateList > DtTaskWithTaskStateListPtr
Definition: taskAndTaskStateDefines.h:27
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:89
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
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. 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)