Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Code refactoring on CPP
[simgrid.git] / src / cxx / Application.hpp
index 81cf005..1ca158f 100644 (file)
@@ -1,3 +1,17 @@
+/*\r
+ * Application.hpp\r
+ *\r
+ * This file contains the declaration of the wrapper class of the native MSG task type.\r
+ *\r
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           \r
+ * All right reserved. \r
+ *\r
+ * This program is free software; you can redistribute \r
+ * it and/or modify it under the terms of the license \r
+ *(GNU LGPL) which comes with this package. \r
+ *\r
+ */  \r
\r
 #ifndef MSG_APPLICATION_HPP\r
 #define MSG_APPLICATION_HPP\r
 \r
 #ifndef MSG_APPLICATION_HPP\r
 #define MSG_APPLICATION_HPP\r
 \r
@@ -5,7 +19,8 @@
        #error Application.hpp requires C++ compilation (use a .cxx suffix)\r
 #endif\r
 \r
        #error Application.hpp requires C++ compilation (use a .cxx suffix)\r
 #endif\r
 \r
-#include <InvalidParameterException.hpp>\r
+#include <NullPointerException.hpp>\r
+#include <FileNotFoundException.hpp>\r
 #include <LogicException.hpp>\r
 #include <MsgException.hpp>\r
 \r
 #include <LogicException.hpp>\r
 #include <MsgException.hpp>\r
 \r
@@ -13,11 +28,13 @@ namespace SimGrid
 {\r
        namespace Msg\r
        {\r
 {\r
        namespace Msg\r
        {\r
+               // Application wrapper class declaration.\r
                class Application\r
                {\r
                public:\r
                        \r
                class Application\r
                {\r
                public:\r
                        \r
-               // Default constructor.\r
+                       /*! \brief Default constructor.\r
+                        */\r
                        Application();\r
                        \r
                        /*! \brief Copy constructor.\r
                        Application();\r
                        \r
                        /*! \brief Copy constructor.\r
@@ -26,11 +43,15 @@ namespace SimGrid
                        \r
                        /* \brief A constructor which takes as parameter the xml file of the application.\r
                         *\r
                        \r
                        /* \brief A constructor which takes as parameter the xml file of the application.\r
                         *\r
-                        * \exception           [InvalidParameterException]     if the parameter file is invalid\r
-                        *                                      (NULL or if the file does not exist).\r
+                        * \exception           If this constructor fails, it throws on of the exceptions described\r
+                        *                                      below:\r
+                        *              \r
+                        *                                      [NullPointerException]  if the parameter file is NULL.\r
+                        *\r
+                        *                                      [FileNotFoundException] if the file is not found.\r
                         */\r
                        Application(const char* file)\r
                         */\r
                        Application(const char* file)\r
-                       throw(InvalidParameterException);\r
+                       throw(NullPointerException, FileNotFoundException);\r
                        \r
                        /*! \brief Destructor.\r
                         */\r
                        \r
                        /*! \brief Destructor.\r
                         */\r
@@ -40,8 +61,7 @@ namespace SimGrid
                        \r
                        /*! \brief Application::deploy() - deploy the appliction.\r
                         *\r
                        \r
                        /*! \brief Application::deploy() - deploy the appliction.\r
                         *\r
-                        * \return                      If successfuly the application is deployed. Otherwise\r
-                        *                                      the method throws an exception listed below.\r
+                        * \exception           If this method fails, it throws an exception listed below:\r
                         *\r
                         * \exception           [LogicException]                        if the xml file which describes the application\r
                         *                                                                                              is not yet specified or if the application is already\r
                         *\r
                         * \exception           [LogicException]                        if the xml file which describes the application\r
                         *                                                                                              is not yet specified or if the application is already\r
@@ -57,22 +77,25 @@ namespace SimGrid
                        void deploy(void)\r
                        throw(LogicExeption, MsgException);\r
                        \r
                        void deploy(void)\r
                        throw(LogicExeption, MsgException);\r
                        \r
-                       /*! \brief Application::deploy() - deploy the appliction.\r
+                       /*! \brief Application::deploy() - Deploy the appliction.\r
                         *\r
                         * \return                      If successfuly the application is deployed. Otherwise\r
                         *                                      the method throws an exception listed below.\r
                         *\r
                         *\r
                         * \return                      If successfuly the application is deployed. Otherwise\r
                         *                                      the method throws an exception listed below.\r
                         *\r
-                        * \exception           [InvalidParameterException]     if the parameter file is invalid\r
-                        *                                      (NULL or not a xml deployment file name).\r
+                        * \exception           [NullPointerException]          if the parameter file is NULL.\r
+                        *                                      \r
+                        *                                      [FileNotFoundException]         if the file is not found.\r
+                        *\r
                         *                                      [MsgException]                          if a internal exception occurs.\r
                         *                                      [MsgException]                          if a internal exception occurs.\r
+                        *\r
                         *                                      [LogicException]                        if the application is already deployed.\r
                         *\r
                         * \\r
                         */\r
                        void deploy(const char* file)\r
                         *                                      [LogicException]                        if the application is already deployed.\r
                         *\r
                         * \\r
                         */\r
                        void deploy(const char* file)\r
-                       throw(InvalidParameterException, LogicException, MsgException);\r
+                       throw(NullPointerException, FileNotFoundException, LogicException, MsgException);\r
                        \r
                        \r
-                       /*! \brief Application::isDeployed() - tests if the application is deployed.\r
+                       /*! \brief Application::isDeployed() - Tests if the application is deployed.\r
                         *\r
                         * \return                      This method returns true is the application is deployed.\r
                         *                                      Otherwise the method returns false.\r
                         *\r
                         * \return                      This method returns true is the application is deployed.\r
                         *                                      Otherwise the method returns false.\r
@@ -84,18 +107,20 @@ namespace SimGrid
                        \r
                        /*! \brief Application::setFile() - this setter sets the value of the file of the application.\r
                         *\r
                        \r
                        /*! \brief Application::setFile() - this setter sets the value of the file of the application.\r
                         *\r
-                        * \return                      If successful, the value of the file of the application is setted.\r
-                        *                                      Otherwise the method throws on of the exceptions listed below.\r
+                        * \exception           If this method fails, it throws on of the exceptions listed below:\r
+                        *\r
+                        *                                      [NullPointerException]          if the parameter file is NULL.\r
                         *\r
                         *\r
-                        * \exception           [InvalidParameterException]     if the parameter file is invalid\r
-                        *                                                                                              (NULL or does no exist).\r
+                        *                                      [FileNotFoundException]         if the file is not found.\r
+                        \r
                         *                                      [LogicException]                        if you try to set the value of the file of an\r
                         *                                                                                              application which is already deployed.\r
                         */\r
                        void setFile(const char* file)\r
                         *                                      [LogicException]                        if you try to set the value of the file of an\r
                         *                                                                                              application which is already deployed.\r
                         */\r
                        void setFile(const char* file)\r
-                       throw (InvalidParameterException, LogicException);\r
+                       throw (NullPointerException, FileNotFoundException, LogicException);\r
                        \r
                        \r
-                       /*! \brief Application::getFile() - this getter returns the file of an application object.\r
+                       /*! \brief Application::getFile() - This getter returns the name of the xml file which describes the \r
+                        * application of the simulation.\r
                         */\r
                        const char* getFile(void) const;\r
                        \r
                         */\r
                        const char* getFile(void) const;\r
                        \r
@@ -113,9 +138,9 @@ namespace SimGrid
                        \r
                        // flag : if true the application was deployed.\r
                        bool deployed;\r
                        \r
                        // flag : if true the application was deployed.\r
                        bool deployed;\r
-                       // the xml file which describe the application.\r
-                       const char* file;\r
                        \r
                        \r
+                       // the xml file which describes the application of the simulation.\r
+                       const char* file;\r
                };\r
                \r
        } // namespace Msg\r
                };\r
                \r
        } // namespace Msg\r