VR-Forces 4.2 Class Documentation
currentTasksAdminContent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 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 
112  virtual void clearTaskList();
113 
118  virtual const DtTaskList& taskList() const;
119 
123  virtual bool testTaskForConflict(const DtSimTaskMessageType& taskType) const;
124 
127  virtual DtAdminContent * clone() const;
128 
130  virtual DtString stringRep() const;
131 
133  virtual int netRepSize() const;
134 
136  virtual bool setFromNet(const char* contentBuffer,
137  unsigned contentSize);
138 
140  virtual bool setToNet();
141 
142 protected:
145  void clearTaskList(DtTaskList& taskList);
146 
148  virtual void clearAllTasks();
149 
153  void copyTaskList(const DtTaskList& taskList, DtTaskList& into);
154 
156  virtual DtString printTasksToString(const DtTaskList& tasks) const;
157 
159  virtual void addTaskWithStatus(DtTaskList& list, const DtSimTask* task, int status, const std::vector<DtSimTaskMessageType>& conflictingTaskTypes,
160  int taskId, const DtString& controller);
161 
162 protected:
164 
166  typedef std::map<int, DtCurrentTaskData*> InternalTaskMap;
168 };

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)