Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
started of C++ wrappers for Msg
[simgrid.git] / src / cxx / Task.hpp
1 #ifndef MSG_TASK_HPP\r
2 #define MSG_TASK_HPP\r
3 \r
4 // Compilation C++ recquise\r
5 #ifndef __cplusplus\r
6         #error Process.hpp requires C++ compilation (use a .cxx suffix)\r
7 #endif\r
8 \r
9 namespace msg\r
10 {\r
11 class Task\r
12 {\r
13         protected:\r
14                 // Default constructor.\r
15                 Task();\r
16                 \r
17         public:\r
18                 // Copy constructor.\r
19                 Task(const Task& rTask);\r
20                 \r
21                 // Destructor.\r
22                 virtual ~Task()\r
23                 throw(NativeException);\r
24                 \r
25         // Other constructors.\r
26         Task(const char* name, double computeDuration, double messageSize);\r
27         \r
28         Task(const char* name, Host* hosts, double* computeDurations, double* messageSizes);\r
29         \r
30         \r
31         // Getters/setters.\r
32         const char* getName(void) const;\r
33         \r
34         \r
35         Process& getSender(void) const;\r
36         \r
37         Host& getSource(void) const \r
38         throw(NativeException);\r
39         \r
40         double getComputeDuration(void) const;\r
41         \r
42         double getRemainingDuration(void) const;\r
43         \r
44         void setPriority(double priority);\r
45         \r
46         static Task& get(int channel) \r
47         throw(NativeException); \r
48         \r
49         static Task& get(int channel, const Host& rHost) \r
50         throw(NativeException);\r
51         \r
52         static Task& get(int channel, double timeout, const Host& rHost) \r
53         throw(NativeException);  \r
54         \r
55         static bool probe(int channel);\r
56         \r
57         static int probe(int channel, const Host& rHost);\r
58         \r
59         void execute(void) \r
60         throw(NativeException);\r
61         \r
62         void cancel(void) \r
63         throw(NativeException);\r
64         \r
65         \r
66         void send(void) \r
67         throw(NativeException);\r
68         \r
69         private:\r
70                 \r
71                 m_task_t nativeTask;\r
72         \r
73                 \r
74 };\r
75 \r
76 }\r
77 \r
78 #endif // §MSG_TASK_HPP