diff options
Diffstat (limited to 'include/TaskMan.h')
-rw-r--r-- | include/TaskMan.h | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/include/TaskMan.h b/include/TaskMan.h index 128339f..dec46a3 100644 --- a/include/TaskMan.h +++ b/include/TaskMan.h @@ -1,74 +1,74 @@ -#ifndef __TASKMAN_H__ -#define __TASKMAN_H__ - -#include <signal.h> -#include <Task.h> -#include <vector> - -#define E_BURST 0 -#define E_HANDLE 1 -#define E_PROCESS 2 -#define E_TIMEOUT 3 -#define E_TASK 4 - -class TaskMan : public Base { - public: - static void AddTask(Task *); - static std::vector<Task *>::iterator FindTask(Task *) throw (GeneralException); - static void RemoveFromWatches(Task *); - static void Init() throw (GeneralException); - static void MainLoop() throw (GeneralException); - static void WaitFor(Handle *, Task *, int = 0); - static void WaitFor(pid_t, Task *, int = 0); - static void WaitFor(timeval, Task *, int = 0); - static int GotChild(pid_t, int); - static void Stop(); - static int Event(); - static Task * Etask(); - static Handle * Ehandle(); - static int Eprocess(); - static int Estatus(); - - class w4ha_t { - public: - w4ha_t(Handle * aha, int aflags, Task * aT) : ha(aha), flags(aflags), dirthy(true), T(aT) { } - Handle * ha; - int flags; - bool dirthy; - Task * T; - }; - - class w4pr_t { - public: - w4pr_t(pid_t apr, Task * aT) : pr(apr), flag(0), status(0), T(aT) { } - pid_t pr; - int flag, status; - Task * T; - }; - - class w4to_t { - public: - w4to_t(timeval ato, int aflags, Task * aT) : to(ato), flags(aflags), T(aT) { } - timeval to; - int flags; - Task * T; - }; - typedef std::vector<Task *> TaskList_t; - - private: - static TaskList_t TaskList; - static TaskList_t Zombies; - static int number; - static bool inited; - static std::vector<w4ha_t> w4ha; - static std::vector<w4pr_t> w4pr; - static std::vector<w4to_t> w4to; - static bool stopped; - static int event; - static Task * etask; - static Handle * ehandle; - static int eprocess, estatus; - static sigset_t sigchildset; -}; - -#endif +#ifndef __TASKMAN_H__
+#define __TASKMAN_H__
+
+#include <signal.h>
+#include <Task.h>
+#include <vector>
+
+#define E_BURST 0
+#define E_HANDLE 1
+#define E_PROCESS 2
+#define E_TIMEOUT 3
+#define E_TASK 4
+
+class TaskMan : public Base {
+ public:
+ static void AddTask(Task *);
+ static std::vector<Task *>::iterator FindTask(Task *) throw (GeneralException);
+ static void RemoveFromWatches(Task *);
+ static void Init() throw (GeneralException);
+ static void MainLoop() throw (GeneralException);
+ static void WaitFor(Handle *, Task *, int = 0);
+ static void WaitFor(pid_t, Task *, int = 0);
+ static void WaitFor(timeval, Task *, int = 0);
+ static int GotChild(pid_t, int);
+ static void Stop();
+ static int Event();
+ static Task * Etask();
+ static Handle * Ehandle();
+ static int Eprocess();
+ static int Estatus();
+
+ class w4ha_t {
+ public:
+ w4ha_t(Handle * aha, int aflags, Task * aT) : ha(aha), flags(aflags), dirthy(true), T(aT) { }
+ Handle * ha;
+ int flags;
+ bool dirthy;
+ Task * T;
+ };
+
+ class w4pr_t {
+ public:
+ w4pr_t(pid_t apr, Task * aT) : pr(apr), flag(0), status(0), T(aT) { }
+ pid_t pr;
+ int flag, status;
+ Task * T;
+ };
+
+ class w4to_t {
+ public:
+ w4to_t(timeval ato, int aflags, Task * aT) : to(ato), flags(aflags), T(aT) { }
+ timeval to;
+ int flags;
+ Task * T;
+ };
+ typedef std::vector<Task *> TaskList_t;
+
+ private:
+ static TaskList_t TaskList;
+ static TaskList_t Zombies;
+ static int number;
+ static bool inited;
+ static std::vector<w4ha_t> w4ha;
+ static std::vector<w4pr_t> w4pr;
+ static std::vector<w4to_t> w4to;
+ static bool stopped;
+ static int event;
+ static Task * etask;
+ static Handle * ehandle;
+ static int eprocess, estatus;
+ static sigset_t sigchildset;
+};
+
+#endif
|