00001 #pragma once 00002 00003 enum ProcMode{ 00004 PROC_MODE_NONE, 00005 PROC_MODE_INIT, 00006 PROC_MODE_MAIN_LOOP, 00007 }; 00008 00016 class TaskBase{ 00017 protected: 00018 static char* taskBuffer; 00019 static size_t taskMaxSize; 00020 static int taskMaxCount; 00022 ProcMode procMode; 00023 int index; 00024 int taskType; 00025 void resetProcMode(); 00026 void setProcMode(); 00027 00028 public: 00029 friend class TaskController; 00030 00031 void* operator new(size_t t); 00032 void operator delete(void *p); 00033 00034 ProcMode getProcMode(); 00035 00036 int getIndex(); 00037 00038 void setTaskType(int taskType); 00039 int getTaskType(); 00040 00041 TaskBase(); 00042 virtual ‾TaskBase(); 00043 00049 virtual void run(TaskController *taskController)=0; 00050 }; 00051