1 // Kernel.h: interface for the CKernel class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
5 #if !defined(AFX_KERNEL_H__4E822B7D_1078_4F70_BC8F_3BB4F83ED0AF__INCLUDED_)
\r
6 #define AFX_KERNEL_H__4E822B7D_1078_4F70_BC8F_3BB4F83ED0AF__INCLUDED_
\r
10 #endif // _MSC_VER > 1000
\r
12 #include "singleton.h"
\r
20 class CKernel : public Singleton<CKernel>
\r
28 bool AddTask(CMMPointer<ITask> t);
\r
29 void SuspendTask(CMMPointer<ITask> t);
\r
30 void ResumeTask(CMMPointer<ITask> t);
\r
31 void RemoveTask(CMMPointer<ITask> t);
\r
32 void KillAllTasks();
\r
35 std::list< CMMPointer<ITask> > taskList;
\r
36 std::list< CMMPointer<ITask> > pausedTaskList;
\r
39 class ITask : public IMMObject
\r
42 ITask(){canKill=false;priority=5000;}
\r
43 virtual bool Start()=0;
\r
44 virtual void OnSuspend(){};
\r
45 virtual void Update()=0;
\r
46 virtual void OnResume(){};
\r
47 virtual void Stop()=0;
\r
53 #endif // !defined(AFX_KERNEL_H__4E822B7D_1078_4F70_BC8F_3BB4F83ED0AF__INCLUDED_)
\r