Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Last Changes of CPP version of Msg
[simgrid.git] / src / cxx / Process.hpp
index 10816ec..bd45c70 100644 (file)
        #error Process.hpp requires C++ compilation (use a .cxx suffix)\r
 #endif\r
 \r
        #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
 \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
                // SimGrid::Msg::Process class declaration.\r
-               class Process\r
+               class SIMGRIDX_EXPORT Process : public Object\r
                {\r
                {\r
-                       friend ApplicationHandler;\r
                        \r
                        \r
-                       private;\r
+                       friend ApplicationHandler::ProcessFactory;\r
                        \r
                        \r
+                       MSG_DECLARE_DYNAMIC(Process);\r
+\r
+                       public:\r
                                // Disable the default constructor.\r
                                Process();\r
                        \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  Constructs a process from the name of the host and its name.\r
                                 *\r
@@ -143,10 +160,10 @@ namespace SimGrid
                        \r
                                /*! \brief Process::isSuspend() - Tests if a process is suspended.\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
                                 */\r
-                               bool isSuspended(void);\r
+                               int isSuspended(void);\r
                        \r
                                /*! \brief Process::getHost() - Retrieves the host of a process object.\r
                                 *\r
                        \r
                                /*! \brief Process::getHost() - Retrieves the host of a process object.\r
                                 *\r
@@ -333,7 +350,7 @@ namespace SimGrid
                                 * \remark                              Set the timeout with -1.0 to disable it.\r
                                 */\r
                                Task& getTask(int channel, double timeout, const Host& rHost)\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
                                /*! \brief Process::sendTask() - Sends the given task in the mailbox identified by the specified alias\r
                                 * (waiting at most given time).\r
@@ -498,7 +515,7 @@ namespace SimGrid
                                 *\r
                                 *                                                      [MsgException]                          if an internal exception occurs.\r
                                 */\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
                                throw(BadAllocException, InvalidArgumentException, MsgException);\r
                        \r
                                /*! \brief Process::receiveTask() - Retrieves a task from the mailbox identified by the alias\r
@@ -555,7 +572,7 @@ namespace SimGrid
                                 *\r
                                 * \return                              The wrapper associated with the native process specified as parameter.\r
                                 */\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
                        \r
                        public:\r
@@ -572,7 +589,7 @@ namespace SimGrid
                                 *\r
                                 * \return                              The exit code of the main function.\r
                                 */\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
                        private:\r
                                \r
@@ -584,4 +601,6 @@ namespace SimGrid
        \r
        } //namepace Msg\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