Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some new files of the cxx version of the MSG API
[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         void send(const char* alias) \r
70         throw(NativeException);\r
71         \r
72         void send(double timeout) \r
73         throw(NativeException);\r
74         \r
75         void send(const char* alias, double timeout) \r
76         throw(NativeException);\r
77         \r
78         void sendBounded(double maxRate) \r
79         throw(NativeException);\r
80         \r
81         void sendBounded(const char* alias, double maxRate) \r
82         throw(NativeException);\r
83         \r
84         static Task& receive(void) \r
85         throw(NativeException);\r
86         \r
87         static Task& receive(const char* alias) \r
88         throw(NativeException);\r
89         \r
90         static Task& receive(const char* alias, double timeout) \r
91         throw(NativeException);\r
92         \r
93         static Task& receive(const char* alias, const Host& rHost) \r
94         throw(NativeException);\r
95         \r
96         static Task& receive(const char* alias, double timeout, const Host& rHost) \r
97         throw(NativeException);\r
98         \r
99         static bool listen(void) \r
100         throw(NativeException);\r
101         \r
102         static bool listen(const char* alias) \r
103         throw(NativeException);\r
104         \r
105         static bool listenFrom(void) \r
106         throw(NativeException);\r
107         \r
108         static bool listenFrom(const char* alias) \r
109         throw(NativeException);\r
110         \r
111         \r
112         static bool listenFromHost(const Host& rHost) \r
113         throw(NativeException);\r
114         \r
115         static bool listenFromHost(const char* alias, const Host& rHost) \r
116         throw(NativeException);\r
117         \r
118         \r
119         \r
120         private:\r
121                 \r
122                 m_task_t nativeTask;\r
123         \r
124                 \r
125 };\r
126 \r
127 }\r
128 \r
129 #endif // §MSG_TASK_HPP