diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/Exceptions.h | 11 | ||||
| -rw-r--r-- | include/Handle.h | 4 | ||||
| -rw-r--r-- | include/Input.h | 2 | ||||
| -rw-r--r-- | include/Makefile.am | 2 | ||||
| -rw-r--r-- | include/Output.h | 2 | ||||
| -rw-r--r-- | include/Task.h | 7 | ||||
| -rw-r--r-- | include/TaskMan.h | 22 | 
7 files changed, 37 insertions, 13 deletions
| diff --git a/include/Exceptions.h b/include/Exceptions.h index 8c37342..56460a6 100644 --- a/include/Exceptions.h +++ b/include/Exceptions.h @@ -34,10 +34,10 @@  class MemoryException; -char * xstrdup(const char *) throw (MemoryException); -void * xmalloc(ssize_t) throw (MemoryException); +char * xstrdup(const char *) throw (GeneralException); +void * xmalloc(ssize_t) throw (GeneralException);  void xfree(void *&); -void * xrealloc(void *, size_t) throw (MemoryException); +void * xrealloc(void *, size_t) throw (GeneralException);  // On prédéfinit la classe String, pour éviter  // les deadlocks de compilation... @@ -110,6 +110,11 @@ class IOAgain : public IOGeneral {        IOAgain();  }; +class TaskSwitch : public GeneralException { +  public: +      TaskSwitch(); +}; +  #else  #error This only works with a C++ compiler  #endif diff --git a/include/Handle.h b/include/Handle.h index 2554892..6d44a48 100644 --- a/include/Handle.h +++ b/include/Handle.h @@ -28,8 +28,8 @@ class Handle : public Base {    public:        Handle(const Handle &);        virtual ~Handle(); -    virtual ssize_t read(void *buf, size_t count) throw (IOGeneral); -    virtual ssize_t write(const void *buf, size_t count) throw (IOGeneral); +    virtual ssize_t read(void *buf, size_t count) throw (GeneralException); +    virtual ssize_t write(const void *buf, size_t count) throw (GeneralException);      bool IsClosed(void);      bool IsNonBlock(void);      void SetNonBlock(void); diff --git a/include/Input.h b/include/Input.h index 81a48d8..1beb1b5 100644 --- a/include/Input.h +++ b/include/Input.h @@ -11,7 +11,7 @@  class Input : public Handle {    public: -      Input(String = "") throw (IOGeneral); +      Input(String = "") throw (GeneralException);        virtual ~Input() {}      virtual bool CanWrite();      virtual bool CanRead(); diff --git a/include/Makefile.am b/include/Makefile.am index 156307a..9546421 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,4 +1,4 @@  include_HEADERS = \  Exceptions.h Handle.h String.h Output.h Socket.h HttpServ.h Variables.h Menu.h \  Action.h Message.h Form.h Confirm.h Table.h IRC.h Task.h Buffer.h General.h \ -CopyJob.h ReadJob.h Regex.h +CopyJob.h ReadJob.h Regex.h TaskMan.h diff --git a/include/Output.h b/include/Output.h index 6c944ab..98af0ac 100644 --- a/include/Output.h +++ b/include/Output.h @@ -11,7 +11,7 @@  class Output : public Handle {    public: -      Output(String = "", int trunc = 1) throw (IOGeneral); +      Output(String = "", int trunc = 1) throw (GeneralException);        virtual ~Output() {}      virtual bool CanWrite();      virtual bool CanRead(); diff --git a/include/Task.h b/include/Task.h index c67a59c..f2fe722 100644 --- a/include/Task.h +++ b/include/Task.h @@ -4,11 +4,8 @@  #include "Exceptions.h" -#define TASK_ON_HOLD 	1 -#define TASK_DONE 	2 -#define TASK_WAITING_HANDLE	4 -#define TASK_WAITING_TIMEOUT	8 -#define TASK_WAITING_TASK	16 +#define TASK_ON_HOLD 	0 +#define TASK_DONE 	1  class Task : public Base {    public: diff --git a/include/TaskMan.h b/include/TaskMan.h new file mode 100644 index 0000000..fe0d565 --- /dev/null +++ b/include/TaskMan.h @@ -0,0 +1,22 @@ +#ifndef __TASKMAN_H__ +#define __TASKMAN_H__ +#ifdef __cplusplus + +#include <Task,h> +#include <vector.h> + +catch TaskMan : public Base { +  public: +      TaskMan(); +      ~TaskMan(); +    int AddTask(const Task &); +    void MainLoop(void); +  private: +    vector<Task> TaskList; +    static int Inited; +}; + +#else +#error This only works with a C++ compiler +#endif +#endif | 
