#error Process.hpp requires C++ compilation (use a .cxx suffix)\r
#endif\r
\r
+#include <msg/datatypes.h>\r
+\r
+#include <ApplicationHandler.hpp>\r
+#include <Object.hpp>\r
\r
namespace SimGrid\r
{\r
namespace Msg\r
{\r
+ class NullPointerException;\r
+ class HostNotFoundException;\r
+ class ProcessNotFoundException;\r
+ class InvalidArgumentException;\r
+ class BadAllocException;\r
+ class LogicException;\r
+ class MsgException;\r
+\r
+ class ApplicationHandler;\r
+ class Host;\r
+ class Task;\r
+\r
// SimGrid::Msg::Process class declaration.\r
- class Process\r
+ class SIMGRIDX_EXPORT Process : public Object\r
{\r
- friend ApplicationHandler;\r
\r
- private;\r
+ friend ApplicationHandler::ProcessFactory;\r
\r
+ MSG_DECLARE_DYNAMIC(Process);\r
+\r
+ public:\r
// Disable the default constructor.\r
Process();\r
\r
- public:\r
\r
/*! \brief Constructs a process from the name of the host and its name.\r
*\r
\r
/*! \brief Process::isSuspend() - Tests if a process is suspended.\r
*\r
- * \return This method returns true is the process is suspended.\r
- * Otherwise the method returns false.\r
+ * \return This method returns 1 is the process is suspended.\r
+ * Otherwise the method returns 0.\r
*/\r
- bool isSuspended(void);\r
+ int isSuspended(void);\r
\r
/*! \brief Process::getHost() - Retrieves the host of a process object.\r
*\r
* \remark Set the timeout with -1.0 to disable it.\r
*/\r
Task& getTask(int channel, double timeout, const Host& rHost)\r
- throw(InvalidArgumentException MsgException);\r
+ throw(InvalidArgumentException, MsgException);\r
\r
/*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the specified alias\r
* (waiting at most given time).\r
*\r
* [MsgException] if an internal exception occurs.\r
*/\r
- Task& Process::receiveTask(double timeout, const Host& rHost) \r
+ Task& receiveTask(double timeout, const Host& rHost) \r
throw(BadAllocException, InvalidArgumentException, MsgException);\r
\r
/*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias\r
*\r
* \return The wrapper associated with the native process specified as parameter.\r
*/\r
- static Process& fromNativeProcess(m_process_t nativeProcess);\r
+ static Process* fromNativeProcess(m_process_t nativeProcess);\r
\r
\r
public:\r
*\r
* \return The exit code of the main function.\r
*/\r
- virtual int main(int argc, char** argv) = 0;\r
+ virtual int main(int argc, char** argv);\r
\r
private:\r
\r
\r
} //namepace Msg\r
\r
-} namespace SimGrid
\ No newline at end of file
+} // namespace SimGrid\r
+\r
+#endif // !MSG_PROCESS_HPP
\ No newline at end of file