VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
25 {
28  task(orig.task), subtasks(orig.subtasks), status(orig.status), conflictingTaskIds(orig.conflictingTaskIds),
29  controller(orig.controller), taskId(orig.taskId) {};
30 
32  DtSimTask* task;
33  int taskId;
35 
36  std::list<DtCurrentTaskData> subtasks;
37 
42  int status;
43 
45  std::vector<DtSimTaskMessageType> conflictingTaskIds;
46 };
47 
48 #ifdef _MSC_VER
49 namespace DtBufferSerialize
50 {
51 #endif
52 
53 
55 
60  DT_DLL_vrftasks char *encode(const DtCurrentTaskData& val, char *buffer);
61 
65  DT_DLL_vrftasks const char *decode(DtCurrentTaskData& val, const char *buffer);
66 #ifdef _MSC_VER
67 }
68 #endif
69 
77 {
78 public:
79  typedef std::list<DtCurrentTaskData> DtTaskList;
80 
83 
86 
90 
92  virtual ~DtCurrentTasksAdminContent();
93 
95  static DtAdminContent* create();
96 
98  virtual bool init();
99 
101  virtual const DtAdminContentMessageType& type() const;
102 
105  virtual void addTaskToList(const DtSimTask* task, const std::vector<DtSimTaskMessageType>& conflictingTaskTypes, int taskId,
106  int status, const DtString& controller);
107 
109  virtual void addSubtask(const DtSimTask* task, int subtaskId, int spawningTaskId, const DtString& controller,
110  bool addIfNoParent = false);
111 
113  virtual void clearTaskList();
114 
119  virtual const DtTaskList& taskList() const;
120 
124  virtual bool testTaskForConflict(const DtSimTaskMessageType& taskType) const;
125 
128  virtual DtAdminContent * clone() const;
129 
131  virtual DtString stringRep() const;
132 
134  virtual int netRepSize() const;
135 
137  virtual bool setFromNet(const char* contentBuffer,
138  unsigned contentSize);
139 
141  virtual bool setToNet();
142 
144  virtual void resolveUnparentedSubtasks();
145 
147  virtual void clearUnparentedSubtasks();
148 
149 protected:
152  virtual void addUnparentedSubtask(const DtSimTask* task, int subtaskId, int spawningTaskId, const DtString& controller);
153 
156  void clearTaskList(DtTaskList& taskList);
157 
159  virtual void clearAllTasks();
160 
164  void copyTaskList(const DtTaskList& taskList, DtTaskList& into);
165 
167  virtual DtString printTasksToString(const DtTaskList& tasks) const;
168 
170  virtual void addTaskWithStatus(DtTaskList& list, const DtSimTask* task, int status, const std::vector<DtSimTaskMessageType>& conflictingTaskTypes,
171  int taskId, const DtString& controller);
172 
173 protected:
175 
177  typedef std::map<int, DtCurrentTaskData*> InternalTaskMap;
179 
181  {
183  int parentId;
186  };
187 
188  typedef std::vector<UnparentedSubtask> UnparentedSubtasks;
190 };

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)