![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: currentTasksAdminContent.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00013 00014 #ifndef currentTasksAdminContent_h 00015 #define currentTasksAdminContent_h 00016 00017 #include "vrftasks/adminContent.h" 00018 #include <vlutil/vlString.h> 00019 #include "vrftasks/vrftasksDefines.h" 00020 #include <list> 00021 #include <vector> 00022 00023 class DtSimTask; 00024 00027 struct DtCurrentTaskData 00028 { 00029 DtCurrentTaskData() {task = 0;} 00030 00032 DtSimTask* task; 00034 std::vector<int> conflictingTaskIds; 00035 }; 00036 00043 class DT_DLL_vrftasks DtCurrentTasksAdminContent : public DtAdminContent 00044 { 00045 public: 00046 typedef std::list<DtCurrentTaskData> DtTaskList; 00047 00049 DtCurrentTasksAdminContent(); 00050 00052 DtCurrentTasksAdminContent(const DtCurrentTasksAdminContent & orig); 00053 00055 const DtCurrentTasksAdminContent & operator=(const 00056 DtCurrentTasksAdminContent & orig); 00057 00059 virtual ~DtCurrentTasksAdminContent(); 00060 00062 static DtAdminContent* create(); 00063 00065 virtual bool init(); 00066 00068 virtual int type() const; 00069 00072 virtual void addTaskToList(const DtSimTask* task, const std::vector<int>& conflictingTaskTypes); 00074 virtual void clearTaskList(); 00075 00080 virtual const DtTaskList& taskList() const; 00081 00085 virtual bool testTaskForConflict(int taskId) const; 00086 00089 virtual DtAdminContent * clone() const; 00090 00092 virtual DtString stringRep() const; 00093 00095 virtual int netRepSize() const; 00096 00098 virtual bool setFromNet(const char* contentBuffer, 00099 unsigned contentSize); 00100 00102 virtual bool setToNet(); 00103 00104 protected: 00107 void internalClearTaskList(); 00108 00112 void copyTaskList(const DtTaskList& taskList); 00113 00114 protected: 00115 DtTaskList myTaskList; 00116 }; 00117 00118 namespace DtBufferSerialize 00119 { 00122 DT_DLL_vrftasks int getSize(const DtCurrentTaskData& val); 00123 00128 DT_DLL_vrftasks char *encode(const DtCurrentTaskData& val, char *buffer); 00129 00133 DT_DLL_vrftasks const char *decode(DtCurrentTaskData& val, const char *buffer); 00134 } 00135 00136 #endif