Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
03b92327246e55f9eb7b7df4ea0fbdbe5a15b7c8
[simgrid.git] / src / cxx / Host.hpp
1 #ifndef MSG_HOST_HPP\r
2 #define MSG_HOST_HPP\r
3 \r
4 \r
5 // Compilation C++ recquise\r
6 #ifndef __cplusplus\r
7         #error Host.hpp requires C++ compilation (use a .cxx suffix)\r
8 #endif\r
9 \r
10 namespace msg\r
11 {\r
12 class Host\r
13 {\r
14         private :\r
15                 // Default constructor.\r
16                 Host();\r
17                 \r
18                 // Copy constructor.\r
19                 Host(const Host& rHost);\r
20                 \r
21                 // Destructor.\r
22                 virtual ~Host();\r
23         \r
24         public: \r
25                 \r
26         // Operations\r
27         \r
28         static Host& getByName(const char* hostName)\r
29         throw(HostNotFoundException);\r
30         \r
31         static int getNumber(void);\r
32         \r
33         static Host& currentHost(void);\r
34         \r
35         static int all(Host** hosts);\r
36         \r
37         \r
38         const char* getName(void) const;\r
39         \r
40         void setData(void* data);\r
41         \r
42         // Getters/setters\r
43         \r
44         void* getData(void) const;\r
45         \r
46         int Host::getRunningTaskNumber(void) const;\r
47                 \r
48         double getSpeed(void) const;\r
49         \r
50         bool hasData(void) const;\r
51         \r
52         bool isAvailble(void) const;\r
53         \r
54         void put(int channel, const Task& rTask)\r
55         throw(NativeException);\r
56         \r
57         void put(int channel, Task task, double timeout) \r
58         throw(NativeException);\r
59         \r
60         void Host::putBounded(int channel, const Task& rTask, double maxRate) \r
61         throw(NativeException);\r
62 \r
63         \r
64         void send(const Task& rTask) \r
65         throw(NativeException);\r
66         \r
67         void send(const char* alias, const Task& rTask) \r
68         throw(NativeException);\r
69         \r
70         void send(const Task& rTask, double timeout) \r
71         throw(NativeException);\r
72         \r
73         void send(const char* alias, const Task& rTask, double timeout) \r
74         throw(NativeException);\r
75         \r
76         void sendBounded(const Task& rTask, double maxRate) \r
77         throw(NativeException);\r
78         \r
79         void sendBounded(const char* alias, const Task& rTask, double maxRate) \r
80         throw(NativeException);   \r
81         \r
82         \r
83         private:\r
84                 // Attributes.\r
85                 \r
86                 m_host_t nativeHost;\r
87                 \r
88                 void* data;\r
89         };\r
90 }\r
91 \r
92 #endif // !MSG_HOST_HPP