1 #ifndef MSG_PROCESS_HPP
\r
2 #define MSG_PROCESS_HPP
\r
4 // Compilation C++ recquise
\r
6 #error Process.hpp requires C++ compilation (use a .cxx suffix)
\r
15 friend ApplicationHandler;
\r
19 // Default constructor.
\r
24 // Construct a process from the name of the host and its name.
\r
25 Process(const char* hostName, const char* name)
\r
26 throw(HostNotFoundException);
\r
28 Process(const Host& rHost, const char* name)
\r
29 throw(HostNotFoundException);
\r
31 Process(const char* hostName, const char* name, int argc, char** argv)
\r
32 throw(HostNotFoundException);
\r
34 Process(const Host& rHost, const char* name, int argc, char** argv)
\r
35 throw(HostNotFoundException);
\r
37 static int killAll(int resetPID);
\r
39 void Process::suspend(void)
\r
40 throw(NativeException);
\r
42 void Process::resume(void)
\r
43 throw(NativeException);
\r
45 bool isSuspended(void);
\r
47 Host& getHost(void)
\r
48 throw(NativeException);
\r
50 static Process& fromPID(int PID);
\r
57 const char* getName(void) const;
\r
59 static Process& currentProcess(void);
\r
61 static int currentProcessPID(void);
\r
63 static int currentProcessPPID(void);
\r
65 void migrate(const Host& rHost)
\r
66 throw(NativeException);
\r
68 static void sleep(double seconds)
\r
69 throw(NativeException);
\r
71 void putTask(const Host& rHost, int channel, const Task& rTask)
\r
72 throw( NativeException);
\r
74 void putTask(const Host& rHost, int channel, const Task& rTask, double timeout)
\r
75 throw(NativeException);
\r
77 Task& getTask(int channel)
\r
78 throw(NativeException);
\r
80 Task& getTask(int channel, double timeout)
\r
81 throw(NativeException);
\r
83 Task& getTask(int channel, const Host& rHost)
\r
84 throw(NativeException);
\r
86 Task& getTask(int channel, double timeout, const Host& rHost)
\r
87 throw(NativeException);
\r
89 void sendTask(const char* alias, const Task& rTask, double timeout)
\r
90 throw(NativeException);
\r
92 void sendTask(const char* alias, const Task& rTask)
\r
93 throw(NativeException);
\r
95 void sendTask(const Task& rTask)
\r
96 throw(NativeException);
\r
98 void sendTask(const Task& rTask, double timeout)
\r
99 throw(NativeException);
\r
101 Task& receiveTask(const char* alias)
\r
102 throw(NativeException);
\r
104 Task& receiveTask(void)
\r
105 throw(NativeException);
\r
107 Task& receiveTask(const char* alias, double timeout)
\r
108 throw(NativeException);
\r
110 Task& receiveTask(double timeout)
\r
111 throw(NativeException);
\r
113 Task& receiveTask(const char* alias, double timeout, const Host& rHost)
\r
114 throw(NativeException);
\r
116 Task& Process::receiveTask(double timeout, const Host& rHost)
\r
117 throw(NativeException);
\r
119 Task& receiveTask(const char* alias, const Host& rHost)
\r
120 throw(NativeException);
\r
122 Task& receiveTask(const Host& rHost)
\r
123 throw(NativeException);
\r
127 void create(const Host& rHost, const char* name, int argc, char** argv)
\r
128 throw(HostNotFoundException);
\r
131 static Process& fromNativeProcess(m_process_t nativeProcess);
\r
136 static int run(int argc, char** argv);
\r
138 virtual int main(int argc, char** argv) = 0;
\r
144 m_process_t nativeProcess; // pointer to the native msg process.
\r