VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
currentTasksAdminContent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 #pragma once
11 
12 #include "vrftasks/adminContent.h"
13 #include <vlutil/vlString.h>
15 #include <list>
16 #include <vector>
19 
20 class DtSimTask;
21 class DtSetDataRequest;
22 
26 {
29  task(orig.task), subtasks(orig.subtasks), status(orig.status), conflictingTaskIds(orig.conflictingTaskIds),
30  controller(orig.controller), taskId(orig.taskId) {};
31 
33  DtSimTask* task;
34  int taskId;
36 
37  std::list<DtCurrentTaskData> subtasks;
38 
43  int status;
44 
46  std::vector<DtSimTaskMessageType> conflictingTaskIds;
47 };
48 
52 {
55  set(orig.set), controller(orig.controller), setId(orig.setId) {};
56 
58  DtSetDataRequest* set;
59  int setId;
61 };
62 
63 #ifdef _MSC_VER
64 namespace DtBufferSerialize
65 {
66 #endif
67 
68 
70 
75  DT_DLL_vrftasks char *encode(const DtCurrentTaskData& val, char *buffer);
76 
80  DT_DLL_vrftasks const char *decode(DtCurrentTaskData& val, const char *buffer);
81 #ifdef _MSC_VER
82 }
83 #endif
84 
85 #ifdef _MSC_VER
86 namespace DtBufferSerialize
87 {
88 #endif
89 
90 
92 
97  DT_DLL_vrftasks char *encode(const DtCurrentScriptedSetData& val, char *buffer);
98 
102  DT_DLL_vrftasks const char *decode(DtCurrentScriptedSetData& val, const char *buffer);
103 #ifdef _MSC_VER
104 }
105 #endif
106 
114 {
115 public:
116  typedef std::list<DtCurrentTaskData> DtTaskList;
117  typedef std::list<DtCurrentScriptedSetData> DtScriptedSetList;
118 
121 
124 
128 
130  virtual ~DtCurrentTasksAdminContent();
131 
133  static DtAdminContent* create();
134 
136  virtual bool init();
137 
139  virtual const DtAdminContentMessageType& type() const;
140 
143  virtual void addTaskToList(const DtSimTask* task, const std::vector<DtSimTaskMessageType>& conflictingTaskTypes, int taskId,
144  int status, const DtString& controller);
145 
147  virtual void addScriptedSetToList(const DtSetDataRequest* set, int taskId,
148  const DtString& controller);
149 
151  virtual void addSubtask(const DtSimTask* task, int subtaskId, int spawningTaskId, const DtString& controller,
152  bool addIfNoParent = false);
153 
155  virtual void clearTaskList();
156 
158  virtual void clearScriptedSetsList();
159 
164  virtual const DtTaskList& taskList() const;
165 
170  virtual const DtScriptedSetList& scriptedSetList() const;
171 
175  virtual bool testTaskForConflict(const DtSimTaskMessageType& taskType) const;
176 
179  virtual DtAdminContent * clone() const;
180 
182  virtual DtString stringRep() const;
183 
185  virtual int netRepSize() const;
186 
188  virtual bool setFromNet(const char* contentBuffer,
189  unsigned contentSize);
190 
192  virtual bool setToNet();
193 
195  virtual void resolveUnparentedSubtasks();
196 
198  virtual void clearUnparentedSubtasks();
199 
200 protected:
203  virtual void addUnparentedSubtask(const DtSimTask* task, int subtaskId, int spawningTaskId, const DtString& controller);
204 
207  void clearTaskList(DtTaskList& taskList);
208 
210  virtual void clearAllTasks();
211 
215  void copyTaskList(const DtTaskList& taskList, DtTaskList& into);
216 
220  void copyScriptedSetList(const DtScriptedSetList& taskList, DtScriptedSetList& into);
221 
223  virtual DtString printTasksToString(const DtTaskList& tasks) const;
224  virtual DtString printSetsToString(const DtScriptedSetList& tasks) const;
225 
227  virtual void addTaskWithStatus(DtTaskList& list, const DtSimTask* task, int status, const std::vector<DtSimTaskMessageType>& conflictingTaskTypes,
228  int taskId, const DtString& controller);
229 
230 protected:
233 
235  typedef std::map<int, DtCurrentTaskData*> InternalTaskMap;
237 
239  {
241  int parentId;
244  };
245 
246  typedef std::vector<UnparentedSubtask> UnparentedSubtasks;
248 };

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)