Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last change of cpp wrappers for msg
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 19 Aug 2008 15:48:47 +0000 (15:48 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 19 Aug 2008 15:48:47 +0000 (15:48 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5894 48e7efb5-ca39-0410-a469-dd3cf9ba447f

43 files changed:
src/cxx/Application.cxx
src/cxx/Application.hpp
src/cxx/ApplicationHandler.cxx
src/cxx/ApplicationHandler.hpp
src/cxx/BadAllocException.cxx
src/cxx/BadAllocException.hpp
src/cxx/ClassNotFoundException.cxx
src/cxx/ClassNotFoundException.hpp
src/cxx/Config.hpp
src/cxx/Environment.cxx
src/cxx/Environment.hpp
src/cxx/Exception.cxx
src/cxx/Exception.hpp
src/cxx/FileNotFoundException.cxx
src/cxx/FileNotFoundException.hpp
src/cxx/Host.cxx
src/cxx/Host.hpp
src/cxx/HostNotFoundException.cxx
src/cxx/HostNotFoundException.hpp
src/cxx/InvalidArgumentException.cxx
src/cxx/InvalidArgumentException.hpp
src/cxx/LogicException.cxx
src/cxx/LogicException.hpp
src/cxx/Msg.cxx
src/cxx/Msg.hpp
src/cxx/MsgException.cxx
src/cxx/MsgException.hpp
src/cxx/NullPointerException.cxx
src/cxx/NullPointerException.hpp
src/cxx/Object.cxx
src/cxx/Object.hpp
src/cxx/OutOfBoundsException.cxx
src/cxx/OutOfBoundsException.hpp
src/cxx/Process.cxx
src/cxx/Process.hpp
src/cxx/ProcessNotFoundException.cxx
src/cxx/ProcessNotFoundException.hpp
src/cxx/Simulation.cxx
src/cxx/Simulation.hpp
src/cxx/StringHelper.cxx
src/cxx/StringHelper.hpp
src/cxx/Task.cxx
src/cxx/Task.hpp

index c188ffb..ca37d24 100644 (file)
-/*\r
- * Application.cxx\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
- /* Application member functions implementation.\r
-  */  \r
-\r
-#include <ApplicationHandler.hpp>\r
-\r
-#include <Application.hpp>\r
-\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-#include <stdlib.h>\r
-\r
-#include <surf/surfxml_parse.h>\r
-\r
-#ifndef S_ISREG\r
-       #define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG)\r
-#endif\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-       \r
-               Application::Application()\r
-               {\r
-                       this->file = NULL;\r
-                       this->deployed = false;\r
-               }\r
-                               \r
-               Application::Application(const Application& rApplication)\r
-               {\r
-                               \r
-                       this->file = rApplication.getFile();\r
-                       this->deployed = rApplication.isDeployed();\r
-               }\r
-       \r
-               Application::Application(const char* file)\r
-               throw(NullPointerException, FileNotFoundException)\r
-               {\r
-                       // check parameters\r
-                       \r
-                       if(!file)\r
-                               throw NullPointerException("file");\r
-                       \r
-                       struct stat statBuf = {0};\r
-                               \r
-                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
-                               throw FileNotFoundException(file);\r
-                               \r
-                       this->file = file;\r
-                       this->deployed = false;\r
-               }\r
-               \r
-               Application::~Application()\r
-               {\r
-                       // NOTHING TODO\r
-               }\r
-                       \r
-               void Application::deploy(const char* file)\r
-               throw(NullPointerException, FileNotFoundException, LogicException, MsgException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->deployed)\r
-                               throw LogicException("application already deployed");\r
-                       \r
-                       // check the parameters\r
-                               \r
-                       if(!file)\r
-                               throw NullPointerException("file");\r
-                       \r
-                       struct stat statBuf = {0};\r
-                               \r
-                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
-                               throw FileNotFoundException(file);\r
-                                       \r
-                       surf_parse_reset_parser();\r
-                       \r
-                       // set the begin of the xml process element handler\r
-                       surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess);\r
-                               \r
-                       // set the process arg handler\r
-                       surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);\r
-                               \r
-                       // set the properties handler\r
-                       surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);\r
-                               \r
-                       // set the end of the xml process element handler\r
-                       surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);\r
-\r
-                       surf_parse_open(file);\r
-                       \r
-                       // initialize the process factory used by the process handler to build the processes.\r
-                       ApplicationHandler::onStartDocument();\r
-                               \r
-                       if(surf_parse())\r
-                               throw MsgException("surf_parse() failed");\r
-                       \r
-                       surf_parse_close();\r
-                       \r
-                       // release the process factory\r
-                       ApplicationHandler::onEndDocument();    \r
-                       \r
-                       this->file = file;\r
-                       this->deployed = true;\r
-               }\r
-               \r
-               void Application::deploy(void)\r
-               throw(LogicException, MsgException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->deployed)\r
-                               throw LogicException("application already deployed");\r
-                       \r
-                       // check the parameters\r
-                       if(!this->file)\r
-                               throw LogicException("you must specify the xml file which describe the application\nuse Application::setFile()"); \r
-                       \r
-                       surf_parse_reset_parser();\r
-                       surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess);\r
-                       surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);\r
-                       surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);\r
-                       surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);\r
-                       \r
-                       // initialize the process factory used by the process handler to build the processes.\r
-                       ApplicationHandler::onStartDocument();\r
-\r
-                       surf_parse_open(file);\r
-                       \r
-                       if(surf_parse())\r
-                               throw MsgException("surf_parse() failed");\r
-                       \r
-                       surf_parse_close();\r
-                       \r
-                       this->deployed = true;  \r
-               }\r
-               \r
-               bool Application::isDeployed(void) const\r
-               {\r
-                       return this->deployed;\r
-               }\r
-               \r
-               void Application::setFile(const char* file)\r
-               throw (NullPointerException, FileNotFoundException, LogicException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->deployed)\r
-                               throw LogicException("your are trying to change the file of an already deployed application");\r
-                               \r
-                       // check parameters\r
-                       \r
-                       if(!file)\r
-                               throw NullPointerException("file");\r
-                       \r
-                       struct stat statBuf = {0};\r
-                               \r
-                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
-                               throw FileNotFoundException("file (file not found)");\r
-                               \r
-                       this->file = file;\r
-                       \r
-               }\r
-               \r
-               const char* Application::getFile(void) const\r
-               {\r
-                       return this->file;\r
-               }\r
-               \r
-               const Application& Application::operator = (const Application& rApplication)\r
-               throw(LogicException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->deployed)\r
-                               throw LogicException("application already deployed");\r
-                       \r
-                       this->file = rApplication.getFile();\r
-                       this->deployed = rApplication.isDeployed();\r
-                       \r
-                       return *this;\r
-               }\r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
-\r
-\r
+/*
+ * Application.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* Application member functions implementation.
+  */  
+
+#include <ApplicationHandler.hpp>
+
+#include <Application.hpp>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+
+#include <surf/surfxml_parse.h>
+
+#ifndef S_ISREG
+       #define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG)
+#endif
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+       
+               Application::Application()
+               {
+                       this->file = NULL;
+                       this->deployed = false;
+               }
+                               
+               Application::Application(const Application& rApplication)
+               {
+                               
+                       this->file = rApplication.getFile();
+                       this->deployed = rApplication.isDeployed();
+               }
+       
+               Application::Application(const char* file)
+               throw(NullPointerException, FileNotFoundException)
+               {
+                       // check parameters
+                       
+                       if(!file)
+                               throw NullPointerException("file");
+                       
+                       struct stat statBuf = {0};
+                               
+                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))
+                               throw FileNotFoundException(file);
+                               
+                       this->file = file;
+                       this->deployed = false;
+               }
+               
+               Application::~Application()
+               {
+                       // NOTHING TODO
+               }
+                       
+               void Application::deploy(const char* file)
+               throw(NullPointerException, FileNotFoundException, LogicException, MsgException)
+               {
+                       // check logic
+                       
+                       if(this->deployed)
+                               throw LogicException("application already deployed");
+                       
+                       // check the parameters
+                               
+                       if(!file)
+                               throw NullPointerException("file");
+                       
+                       struct stat statBuf = {0};
+                               
+                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))
+                               throw FileNotFoundException(file);
+                                       
+                       surf_parse_reset_parser();
+                       
+                       // set the begin of the xml process element handler
+                       surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess);
+                               
+                       // set the process arg handler
+                       surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);
+                               
+                       // set the properties handler
+                       surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);
+                               
+                       // set the end of the xml process element handler
+                       surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);
+
+                       surf_parse_open(file);
+                       
+                       // initialize the process factory used by the process handler to build the processes.
+                       ApplicationHandler::onStartDocument();
+                               
+                       if(surf_parse())
+                               throw MsgException("surf_parse() failed");
+                       
+                       surf_parse_close();
+                       
+                       // release the process factory
+                       ApplicationHandler::onEndDocument();    
+                       
+                       this->file = file;
+                       this->deployed = true;
+               }
+               
+               void Application::deploy(void)
+               throw(LogicException, MsgException)
+               {
+                       // check logic
+                       
+                       if(this->deployed)
+                               throw LogicException("application already deployed");
+                       
+                       // check the parameters
+                       if(!this->file)
+                               throw LogicException("you must specify the xml file which describe the application\nuse Application::setFile()"); 
+                       
+                       surf_parse_reset_parser();
+                       surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess);
+                       surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);
+                       surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);
+                       surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);
+                       
+                       // initialize the process factory used by the process handler to build the processes.
+                       ApplicationHandler::onStartDocument();
+
+                       surf_parse_open(file);
+                       
+                       if(surf_parse())
+                               throw MsgException("surf_parse() failed");
+                       
+                       surf_parse_close();
+                       
+                       this->deployed = true;  
+               }
+               
+               bool Application::isDeployed(void) const
+               {
+                       return this->deployed;
+               }
+               
+               void Application::setFile(const char* file)
+               throw (NullPointerException, FileNotFoundException, LogicException)
+               {
+                       // check logic
+                       
+                       if(this->deployed)
+                               throw LogicException("your are trying to change the file of an already deployed application");
+                               
+                       // check parameters
+                       
+                       if(!file)
+                               throw NullPointerException("file");
+                       
+                       struct stat statBuf = {0};
+                               
+                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))
+                               throw FileNotFoundException("file (file not found)");
+                               
+                       this->file = file;
+                       
+               }
+               
+               const char* Application::getFile(void) const
+               {
+                       return this->file;
+               }
+               
+               const Application& Application::operator = (const Application& rApplication)
+               throw(LogicException)
+               {
+                       // check logic
+                       
+                       if(this->deployed)
+                               throw LogicException("application already deployed");
+                       
+                       this->file = rApplication.getFile();
+                       this->deployed = rApplication.isDeployed();
+                       
+                       return *this;
+               }
+       } // namespace Msg
+} // namespace SimGrid
+
+
+
index c281870..925c1ef 100644 (file)
-/*\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 __cplusplus\r
-       #error Application.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <NullPointerException.hpp>\r
-#include <FileNotFoundException.hpp>\r
-#include <LogicException.hpp>\r
-#include <MsgException.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               // Application wrapper class declaration.\r
-               class SIMGRIDX_EXPORT Application\r
-               {\r
-               public:\r
-                       \r
-                       /*! \brief Default constructor.\r
-                        */\r
-                       Application();\r
-                       \r
-                       /*! \brief Copy constructor.\r
-                        */\r
-                       Application(const Application& rApplication);\r
-                       \r
-                       /* \brief A constructor which takes as parameter the xml file of the application.\r
-                        *\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
-                       throw(NullPointerException, FileNotFoundException);\r
-                       \r
-                       /*! \brief Destructor.\r
-                        */\r
-                       virtual ~Application();\r
-                       \r
-               // Operations.\r
-                       \r
-                       /*! \brief Application::deploy() - deploy the appliction.\r
-                        *\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
-                        *                                                                                              deployed.\r
-                        *                                      [MsgException]                          if a internal exception occurs.\r
-                        *\r
-                        * \remark                      Before use this method, you must specify the xml file of the application to\r
-                        *                                      deploy.\r
-                        *\r
-                        * \see                         Application::setFile()\r
-                        */\r
-                        \r
-                       void deploy(void)\r
-                       throw(LogicException, MsgException);\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
-                        *\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
-                        *\r
-                        *                                      [LogicException]                        if the application is already deployed.\r
-                        *\r
-                        * \\r
-                        */\r
-                       void deploy(const char* file)\r
-                       throw(NullPointerException, FileNotFoundException, LogicException, MsgException);\r
-                       \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
-                       bool isDeployed(void) const;\r
-                       \r
-                       \r
-               // Getters/setters\r
-                       \r
-                       /*! \brief Application::setFile() - this setter sets the value of the file of the application.\r
-                        *\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
-                        *                                      [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
-                       throw (NullPointerException, FileNotFoundException, LogicException);\r
-                       \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
-               // Operators.\r
-                       \r
-                       /*! \brief Assignement operator.\r
-                        *\r
-                        * \exception           [LogicException]                        if you try to assign an application already deployed.\r
-                        */\r
-                       const Application& operator = (const Application& rApplication)\r
-                       throw(LogicException);\r
-                       \r
-               private:\r
-               // Attributes.\r
-                       \r
-                       // flag : if true the application was deployed.\r
-                       bool deployed;\r
-                       \r
-                       // the xml file which describes the application of the simulation.\r
-                       const char* file;\r
-\r
-               };\r
-               \r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
-#endif // !MSG_APPLICATION_HPP\r
-\r
+/*
+ * Application.hpp
+ *
+ * This file contains the declaration of the wrapper class of the native MSG task type.
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_APPLICATION_HPP
+#define MSG_APPLICATION_HPP
+
+#ifndef __cplusplus
+       #error Application.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <NullPointerException.hpp>
+#include <FileNotFoundException.hpp>
+#include <LogicException.hpp>
+#include <MsgException.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               // Application wrapper class declaration.
+               class SIMGRIDX_EXPORT Application
+               {
+               public:
+                       
+                       /*! \brief Default constructor.
+                        */
+                       Application();
+                       
+                       /*! \brief Copy constructor.
+                        */
+                       Application(const Application& rApplication);
+                       
+                       /* \brief A constructor which takes as parameter the xml file of the application.
+                        *
+                        * \exception           If this constructor fails, it throws on of the exceptions described
+                        *                                      below:
+                        *              
+                        *                                      [NullPointerException]  if the parameter file is NULL.
+                        *
+                        *                                      [FileNotFoundException] if the file is not found.
+                        */
+                       Application(const char* file)
+                       throw(NullPointerException, FileNotFoundException);
+                       
+                       /*! \brief Destructor.
+                        */
+                       virtual ~Application();
+                       
+               // Operations.
+                       
+                       /*! \brief Application::deploy() - deploy the appliction.
+                        *
+                        * \exception           If this method fails, it throws an exception listed below:
+                        *
+                        * \exception           [LogicException]                        if the xml file which describes the application
+                        *                                                                                              is not yet specified or if the application is already
+                        *                                                                                              deployed.
+                        *                                      [MsgException]                          if a internal exception occurs.
+                        *
+                        * \remark                      Before use this method, you must specify the xml file of the application to
+                        *                                      deploy.
+                        *
+                        * \see                         Application::setFile()
+                        */
+                        
+                       void deploy(void)
+                       throw(LogicException, MsgException);
+                       
+                       /*! \brief Application::deploy() - Deploy the appliction.
+                        *
+                        * \return                      If successfuly the application is deployed. Otherwise
+                        *                                      the method throws an exception listed below.
+                        *
+                        * \exception           [NullPointerException]          if the parameter file is NULL.
+                        *                                      
+                        *                                      [FileNotFoundException]         if the file is not found.
+                        *
+                        *                                      [MsgException]                          if a internal exception occurs.
+                        *
+                        *                                      [LogicException]                        if the application is already deployed.
+                        *
+                        * \
+                        */
+                       void deploy(const char* file)
+                       throw(NullPointerException, FileNotFoundException, LogicException, MsgException);
+                       
+                       /*! \brief Application::isDeployed() - Tests if the application is deployed.
+                        *
+                        * \return                      This method returns true is the application is deployed.
+                        *                                      Otherwise the method returns false.
+                        */
+                       bool isDeployed(void) const;
+                       
+                       
+               // Getters/setters
+                       
+                       /*! \brief Application::setFile() - this setter sets the value of the file of the application.
+                        *
+                        * \exception           If this method fails, it throws on of the exceptions listed below:
+                        *
+                        *                                      [NullPointerException]          if the parameter file is NULL.
+                        *
+                        *                                      [FileNotFoundException]         if the file is not found.
+                        
+                        *                                      [LogicException]                        if you try to set the value of the file of an
+                        *                                                                                              application which is already deployed.
+                        */
+                       void setFile(const char* file)
+                       throw (NullPointerException, FileNotFoundException, LogicException);
+                       
+                       /*! \brief Application::getFile() - This getter returns the name of the xml file which describes the 
+                        * application of the simulation.
+                        */
+                       const char* getFile(void) const;
+                       
+               // Operators.
+                       
+                       /*! \brief Assignement operator.
+                        *
+                        * \exception           [LogicException]                        if you try to assign an application already deployed.
+                        */
+                       const Application& operator = (const Application& rApplication)
+                       throw(LogicException);
+                       
+               private:
+               // Attributes.
+                       
+                       // flag : if true the application was deployed.
+                       bool deployed;
+                       
+                       // the xml file which describes the application of the simulation.
+                       const char* file;
+
+               };
+               
+       } // namespace Msg
+} // namespace SimGrid
+
+#endif // !MSG_APPLICATION_HPP
+
index 3b48213..2673dbb 100644 (file)
-/*\r
- * ApplicationHandler.cxx\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
- /* ApplicationHandler member functions implementation.\r
-  */  \r
-\r
-\r
-#include <Object.hpp>\r
-#include <ApplicationHandler.hpp>\r
-\r
-#include <Process.hpp>\r
-#include <Host.hpp>\r
-\r
-\r
-\r
-\r
-\r
-#include <stdlib.h>\r
-\r
-#include <surf/surfxml_parse.h>\r
-#include <xbt/sysdep.h>\r
-\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-\r
-               ApplicationHandler::ProcessFactory* ApplicationHandler::processFactory = NULL;\r
-                       \r
-               // Desable the default constructor, the copy constructor , the assignement operator\r
-               // and the destructor of this class. Assume that this class is static.\r
-               \r
-               // Default constructor.\r
-               ApplicationHandler::ApplicationHandler()\r
-               {\r
-                       // NOTHING TODO\r
-               }\r
-               \r
-               // Copy constructor.\r
-               ApplicationHandler::ApplicationHandler(const ApplicationHandler& rApplicationHandler)\r
-               {\r
-                       // NOTHING TODO\r
-               }\r
-               \r
-               // Destructor\r
-               ApplicationHandler::~ApplicationHandler()\r
-               {\r
-                       // NOTHING TODO\r
-               }\r
-               \r
-               // Assignement operator.\r
-               const ApplicationHandler& ApplicationHandler::operator = (const ApplicationHandler& rApplicationHandler)\r
-               {\r
-                       return *this;\r
-               }\r
-               \r
-               void ApplicationHandler::onStartDocument(void)\r
-               {\r
-                       // instanciate the factory at the begining of the parsing\r
-                       processFactory = new ProcessFactory();  \r
-               }\r
-               \r
-               void ApplicationHandler::onEndDocument(void)\r
-               {\r
-                       // release the handler at the end of the parsing.\r
-                       if(processFactory)\r
-                               delete processFactory;\r
-               }\r
-                       \r
-               void ApplicationHandler::onBeginProcess(void)\r
-               {\r
-                       // set the process identity at the begin of the xml process element.\r
-                       processFactory->setProcessIdentity(A_surfxml_process_host, A_surfxml_process_function);\r
-               }               \r
-               \r
-               void ApplicationHandler::onProcessArg(void)\r
-               {\r
-                       // register the argument of the current xml process element.\r
-                       processFactory->registerProcessArg(A_surfxml_argument_value);\r
-               }\r
-               \r
-               void ApplicationHandler::OnProperty(void)\r
-               {\r
-                       // set the property of the current xml process element.\r
-                        processFactory->setProperty(A_surfxml_prop_id, A_surfxml_prop_value);\r
-               }\r
-               \r
-               void ApplicationHandler::onEndProcess(void)\r
-               {\r
-                       // at the end of the xml process element create the wrapper process (of the native Msg process)\r
-                       processFactory->createProcess();\r
-               }\r
-               \r
-               /////////////////////////////////////////////////////////////////////////////////////////////////\r
-               // Process factory connected member functions\r
-               \r
-               ApplicationHandler::ProcessFactory::ProcessFactory() \r
-               {\r
-                       this->args = xbt_dynar_new(sizeof(char*),ApplicationHandler::ProcessFactory::freeCstr);\r
-                       this->properties = NULL; // TODO instanciate the dictionary\r
-                       this->hostName = NULL;\r
-                       this->function = NULL;\r
-               } \r
-\r
-               ApplicationHandler::ProcessFactory::~ProcessFactory()\r
-               {\r
-                       xbt_dynar_free(&(this->args));\r
-               }\r
-               \r
-               // create the cxx process wrapper.\r
-               void ApplicationHandler::ProcessFactory::createProcess() \r
-               throw (ClassNotFoundException, HostNotFoundException)\r
-               {\r
-                       Host host;\r
-                       Class* c;\r
-                       Process* process;\r
-                       \r
-                       // try to dynamicaly create an instance fo the process from its name (which is specified by the element function\r
-                       // in the xml application file.\r
-                       // if this static method fails, it throws an exception of the class ClassNotFoundException\r
-                       c = Class::fromName(this->function);\r
-                       process = reinterpret_cast<Process*>(c->createObject());\r
-                       \r
-                       // try to retrieve the host of the process from its name\r
-                       // if this method fails, it throws an exception of the class HostNotFoundException\r
-                       host = Host::getByName(this->hostName); \r
-                       \r
-                       // build the list of the arguments of the newly created process.\r
-                       int argc = xbt_dynar_length(this->args);\r
-                       \r
-                       char** argv = (char**)calloc(argc, sizeof(char*));\r
-                       \r
-                       for(int i = argc -1; i >= 0; i--)\r
-                               xbt_dynar_pop(this->args, &(argv[i]));\r
-                       \r
-                       // finaly create the process (for more detail on the process creation see Process::create()\r
-                       process->create(host, this->function , argc, argv);\r
-                       \r
-                       // TODO add the properties of the process\r
-                       /*process->properties = this->properties;\r
-                       this->properties = new Properties();*/\r
-               }\r
-                       \r
-               void ApplicationHandler::ProcessFactory::setProcessIdentity(const char* hostName, const char* function) \r
-               {\r
-                       this->hostName = hostName;\r
-                       this->function = function;\r
-               \r
-                       /*if (!this->args->empty())\r
-                               this->args->clear();\r
-               \r
-                       if(!this->properties->empty())\r
-                               this->properties->clear();*/\r
-               }\r
-               \r
-               // callback function used by the dynamic array to cleanup all of its elements.\r
-               void ApplicationHandler::ProcessFactory::freeCstr(void* cstr)\r
-               {\r
-                       free(*(void**)cstr);\r
-               }\r
-               \r
-               void ApplicationHandler::ProcessFactory::registerProcessArg(const char* arg) \r
-               {\r
-                       char* cstr = _strdup(arg);\r
-                       xbt_dynar_push(this->args, &cstr);\r
-               }\r
-               \r
-               void ApplicationHandler::ProcessFactory::setProperty(const char* id, const char* value)\r
-               {\r
-                       // TODO implement this function;        \r
-               }\r
-               \r
-               const char* ApplicationHandler::ProcessFactory::getHostName(void)\r
-               {\r
-                       return this->hostName;\r
-               }\r
-\r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
+/*
+ * ApplicationHandler.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* ApplicationHandler member functions implementation.
+  */  
+
+
+#include <Object.hpp>
+#include <ApplicationHandler.hpp>
+
+#include <Process.hpp>
+#include <Host.hpp>
+
+
+
+
+
+#include <stdlib.h>
+
+#include <surf/surfxml_parse.h>
+#include <xbt/sysdep.h>
+
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+
+               ApplicationHandler::ProcessFactory* ApplicationHandler::processFactory = NULL;
+                       
+               // Desable the default constructor, the copy constructor , the assignement operator
+               // and the destructor of this class. Assume that this class is static.
+               
+               // Default constructor.
+               ApplicationHandler::ApplicationHandler()
+               {
+                       // NOTHING TODO
+               }
+               
+               // Copy constructor.
+               ApplicationHandler::ApplicationHandler(const ApplicationHandler& rApplicationHandler)
+               {
+                       // NOTHING TODO
+               }
+               
+               // Destructor
+               ApplicationHandler::~ApplicationHandler()
+               {
+                       // NOTHING TODO
+               }
+               
+               // Assignement operator.
+               const ApplicationHandler& ApplicationHandler::operator = (const ApplicationHandler& rApplicationHandler)
+               {
+                       return *this;
+               }
+               
+               void ApplicationHandler::onStartDocument(void)
+               {
+                       // instanciate the factory at the begining of the parsing
+                       processFactory = new ProcessFactory();  
+               }
+               
+               void ApplicationHandler::onEndDocument(void)
+               {
+                       // release the handler at the end of the parsing.
+                       if(processFactory)
+                               delete processFactory;
+               }
+                       
+               void ApplicationHandler::onBeginProcess(void)
+               {
+                       // set the process identity at the begin of the xml process element.
+                       processFactory->setProcessIdentity(A_surfxml_process_host, A_surfxml_process_function);
+               }               
+               
+               void ApplicationHandler::onProcessArg(void)
+               {
+                       // register the argument of the current xml process element.
+                       processFactory->registerProcessArg(A_surfxml_argument_value);
+               }
+               
+               void ApplicationHandler::OnProperty(void)
+               {
+                       // set the property of the current xml process element.
+                        processFactory->setProperty(A_surfxml_prop_id, A_surfxml_prop_value);
+               }
+               
+               void ApplicationHandler::onEndProcess(void)
+               {
+                       // at the end of the xml process element create the wrapper process (of the native Msg process)
+                       processFactory->createProcess();
+               }
+               
+               /////////////////////////////////////////////////////////////////////////////////////////////////
+               // Process factory connected member functions
+               
+               ApplicationHandler::ProcessFactory::ProcessFactory() 
+               {
+                       this->args = xbt_dynar_new(sizeof(char*),ApplicationHandler::ProcessFactory::freeCstr);
+                       this->properties = NULL; // TODO instanciate the dictionary
+                       this->hostName = NULL;
+                       this->function = NULL;
+               } 
+
+               ApplicationHandler::ProcessFactory::~ProcessFactory()
+               {
+                       xbt_dynar_free(&(this->args));
+               }
+               
+               // create the cxx process wrapper.
+               void ApplicationHandler::ProcessFactory::createProcess() 
+               throw (ClassNotFoundException, HostNotFoundException)
+               {
+                       Host host;
+                       Class* c;
+                       Process* process;
+                       
+                       // try to dynamicaly create an instance of the process from its name (which is specified by the element function
+                       // in the xml application file.
+                       // if this static method fails, it throws an exception of the class ClassNotFoundException
+                       c = Class::fromName(this->function);
+                       process = reinterpret_cast<Process*>(c->createObject());
+                       
+                       // try to retrieve the host of the process from its name
+                       // if this method fails, it throws an exception of the class HostNotFoundException
+                       host = Host::getByName(this->hostName); 
+                       
+                       // build the list of the arguments of the newly created process.
+                       int argc = xbt_dynar_length(this->args);
+                       
+                       char** argv = (char**)calloc(argc, sizeof(char*));
+                       
+                       for(int i = argc -1; i >= 0; i--)
+                               xbt_dynar_pop(this->args, &(argv[i]));
+                       
+                       // finaly create the process (for more detail on the process creation see Process::create()
+                       process->create(host, this->function , argc, argv);
+                       
+                       // TODO add the properties of the process
+                       /*process->properties = this->properties;
+                       this->properties = new Properties();*/
+               }
+                       
+               void ApplicationHandler::ProcessFactory::setProcessIdentity(const char* hostName, const char* function) 
+               {
+                       this->hostName = hostName;
+                       this->function = function;
+               
+                       /*if (!this->args->empty())
+                               this->args->clear();
+               
+                       if(!this->properties->empty())
+                               this->properties->clear();*/
+               }
+               
+               // callback function used by the dynamic array to cleanup all of its elements.
+               void ApplicationHandler::ProcessFactory::freeCstr(void* cstr)
+               {
+                       free(*(void**)cstr);
+               }
+               
+               void ApplicationHandler::ProcessFactory::registerProcessArg(const char* arg) 
+               {
+                       char* cstr = _strdup(arg);
+                       xbt_dynar_push(this->args, &cstr);
+               }
+               
+               void ApplicationHandler::ProcessFactory::setProperty(const char* id, const char* value)
+               {
+                       // TODO implement this function;        
+               }
+               
+               const char* ApplicationHandler::ProcessFactory::getHostName(void)
+               {
+                       return this->hostName;
+               }
+
+       } // namespace Msg
+} // namespace SimGrid
+
index df91691..46c7c8a 100644 (file)
-/*\r
- * ApplicationHandler.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_HANDLER_HPP\r
-#define MSG_APPLICATION_HANDLER_HPP\r
-\r
-// Compilation C++ recquise\r
-#ifndef __cplusplus\r
-       #error ApplicationHandler.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <xbt/dict.h>\r
-#include <xbt/dynar.h>\r
-\r
-#include <ClassNotFoundException.hpp>\r
-#include <HostNotFoundException.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               class Process;\r
-\r
-               // Declaration of the class ApplicationHandler (Singleton).\r
-               class SIMGRIDX_EXPORT ApplicationHandler\r
-               {\r
-                       //friend Process;\r
-\r
-               public:\r
-\r
-                       class ProcessFactory \r
-                       {\r
-                               public:\r
-                                       \r
-                                       // the list of the argument of the process to create.\r
-                                       xbt_dynar_t args;\r
-                                       // the properties of the process to create\r
-                                       xbt_dict_t properties;\r
-                     \r
-                               private:\r
-                                       \r
-                                       // the current host name parsed\r
-                                       const char* hostName;\r
-                                       // the name of the class of the process\r
-                                       const char* function;\r
-                       \r
-                               public :\r
-                       \r
-                                       // Default constructor.\r
-                                       ProcessFactory(); \r
-                                       \r
-                                       // Copy constructor.\r
-                                       ProcessFactory(const ProcessFactory& rProcessFactory);\r
-                                       \r
-                                       // Destructor.\r
-                                       virtual ~ProcessFactory();\r
-                                       \r
-                                       // Set the identity of the current process.\r
-                                       void setProcessIdentity(const char* hostName, const char* function);\r
-                               \r
-                               // Register an argument of the current process.\r
-                               void registerProcessArg(const char* arg); \r
-                                       \r
-                                       // Set the property of the current process.\r
-                                       void setProperty(const char* id, const char* value);\r
-                                       \r
-                                       // Return the host name of the current process.\r
-                                       const char* getHostName(void);\r
-                                       \r
-                                       // Create the current process.\r
-                               void createProcess(void)\r
-                               throw (ClassNotFoundException, HostNotFoundException); \r
-\r
-                                       static void freeCstr(void* cstr);\r
-                       \r
-                       };\r
-\r
-               private :\r
-                       \r
-                       // Desable the default constructor, the copy constructor , the assignement operator\r
-                       // and the destructor of this class. Assume that this class is static.\r
-                       \r
-                       // Default constructor.\r
-                       ApplicationHandler();\r
-                       \r
-                       // Copy constructor.\r
-                       ApplicationHandler(const ApplicationHandler& rApplicationHandler);\r
-                       \r
-                       // Destructor\r
-                       virtual ~ApplicationHandler();\r
-                       \r
-                       // Assignement operator.\r
-                       const ApplicationHandler& operator = (const ApplicationHandler& rApplicationHandler);\r
-                       \r
-                       // the process factory used by the application handler.\r
-                       static ProcessFactory* processFactory;\r
-                       \r
-                       \r
-                       public:\r
-                       \r
-                       // Handle the begining of the parsing of the xml file describing the application.\r
-                       static void onStartDocument(void);\r
-                       \r
-                       // Handle at the end of the parsing.\r
-                       static void onEndDocument(void);\r
-                       \r
-                       // Handle the begining of the parsing of a xml process element.\r
-                       static void onBeginProcess(void);\r
-                       \r
-                       // Handle the parsing of an argument of the current xml process element.\r
-                       static void onProcessArg(void);\r
-                       \r
-                       // Handle the parsing of a property of the currnet xml process element.\r
-                       static void OnProperty(void);\r
-                       \r
-                       // Handle the end of the parsing of a xml process element\r
-                       static void onEndProcess(void);\r
-               };\r
-\r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
-#endif // !MSG_APPLICATION_HANDLER_HPP\r
-\r
+/*
+ * ApplicationHandler.hpp
+ *
+ * This file contains the declaration of the wrapper class of the native MSG task type.
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_APPLICATION_HANDLER_HPP
+#define MSG_APPLICATION_HANDLER_HPP
+
+// Compilation C++ recquise
+#ifndef __cplusplus
+       #error ApplicationHandler.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <xbt/dict.h>
+#include <xbt/dynar.h>
+
+#include <ClassNotFoundException.hpp>
+#include <HostNotFoundException.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               class Process;
+
+               // Declaration of the class ApplicationHandler (Singleton).
+               class SIMGRIDX_EXPORT ApplicationHandler
+               {
+                       //friend Process;
+
+               public:
+
+                       class ProcessFactory 
+                       {
+                               public:
+                                       
+                                       // the list of the argument of the process to create.
+                                       xbt_dynar_t args;
+                                       // the properties of the process to create
+                                       xbt_dict_t properties;
+                     
+                               private:
+                                       
+                                       // the current host name parsed
+                                       const char* hostName;
+                                       // the name of the class of the process
+                                       const char* function;
+                       
+                               public :
+                       
+                                       // Default constructor.
+                                       ProcessFactory(); 
+                                       
+                                       // Copy constructor.
+                                       ProcessFactory(const ProcessFactory& rProcessFactory);
+                                       
+                                       // Destructor.
+                                       virtual ~ProcessFactory();
+                                       
+                                       // Set the identity of the current process.
+                                       void setProcessIdentity(const char* hostName, const char* function);
+                               
+                               // Register an argument of the current process.
+                               void registerProcessArg(const char* arg); 
+                                       
+                                       // Set the property of the current process.
+                                       void setProperty(const char* id, const char* value);
+                                       
+                                       // Return the host name of the current process.
+                                       const char* getHostName(void);
+                                       
+                                       // Create the current process.
+                               void createProcess(void)
+                               throw (ClassNotFoundException, HostNotFoundException); 
+
+                                       static void freeCstr(void* cstr);
+                       
+                       };
+
+               private :
+                       
+                       // Desable the default constructor, the copy constructor , the assignement operator
+                       // and the destructor of this class. Assume that this class is static.
+                       
+                       // Default constructor.
+                       ApplicationHandler();
+                       
+                       // Copy constructor.
+                       ApplicationHandler(const ApplicationHandler& rApplicationHandler);
+                       
+                       // Destructor
+                       virtual ~ApplicationHandler();
+                       
+                       // Assignement operator.
+                       const ApplicationHandler& operator = (const ApplicationHandler& rApplicationHandler);
+                       
+                       // the process factory used by the application handler.
+                       static ProcessFactory* processFactory;
+                       
+                       
+                       public:
+                       
+                       // Handle the begining of the parsing of the xml file describing the application.
+                       static void onStartDocument(void);
+                       
+                       // Handle at the end of the parsing.
+                       static void onEndDocument(void);
+                       
+                       // Handle the begining of the parsing of a xml process element.
+                       static void onBeginProcess(void);
+                       
+                       // Handle the parsing of an argument of the current xml process element.
+                       static void onProcessArg(void);
+                       
+                       // Handle the parsing of a property of the currnet xml process element.
+                       static void OnProperty(void);
+                       
+                       // Handle the end of the parsing of a xml process element
+                       static void onEndProcess(void);
+               };
+
+       } // namespace Msg
+} // namespace SimGrid
+
+#endif // !MSG_APPLICATION_HANDLER_HPP
+
index 265f5de..24d0279 100644 (file)
@@ -1,74 +1,74 @@
-/*\r
- * BadAllocationException.cxx\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
- /* BadAllocationException member functions implementation.\r
-  */  \r
-\r
-#include <BadAllocException.hpp>\r
-\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-                       BadAllocException::BadAllocException()\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Not enough memory") + 1, sizeof(char));\r
-                               strcpy(this->reason, "Not enough memory");\r
-                       }\r
-               \r
-               \r
-                       BadAllocException::BadAllocException(const BadAllocException& rBadAllocException)\r
-                       {\r
-                               const char* reason = rBadAllocException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               strcpy(this->reason, reason);\r
-                               \r
-                       }\r
-               \r
-                       BadAllocException::BadAllocException(const char* objectName)\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Not enough memory to allocate ") + strlen(objectName) + 1, sizeof(char));\r
-                               sprintf(this->reason, "Not enough memory to allocate %s", objectName);\r
-                       }\r
-               \r
-               \r
-                       BadAllocException::~BadAllocException()\r
-                       {\r
-                               if(this->reason)\r
-                                       free(this->reason);\r
-                       }\r
-                               \r
-                       const char* BadAllocException::toString(void) const\r
-                       {\r
-                               return (const char*)(this->reason);     \r
-                       }\r
-               \r
-               \r
-                       const BadAllocException& BadAllocException::operator = (const BadAllocException& rBadAllocException)\r
-                       {\r
-                               const char* reason = rBadAllocException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               \r
-                               return *this;\r
-                       }\r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-\r
+/*
+ * BadAllocationException.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* BadAllocationException member functions implementation.
+  */  
+
+#include <BadAllocException.hpp>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+                       BadAllocException::BadAllocException()
+                       {
+                               this->reason = (char*) calloc(strlen("Not enough memory") + 1, sizeof(char));
+                               strcpy(this->reason, "Not enough memory");
+                       }
+               
+               
+                       BadAllocException::BadAllocException(const BadAllocException& rBadAllocException)
+                       {
+                               const char* reason = rBadAllocException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               strcpy(this->reason, reason);
+                               
+                       }
+               
+                       BadAllocException::BadAllocException(const char* objectName)
+                       {
+                               this->reason = (char*) calloc(strlen("Not enough memory to allocate ") + strlen(objectName) + 1, sizeof(char));
+                               sprintf(this->reason, "Not enough memory to allocate %s", objectName);
+                       }
+               
+               
+                       BadAllocException::~BadAllocException()
+                       {
+                               if(this->reason)
+                                       free(this->reason);
+                       }
+                               
+                       const char* BadAllocException::toString(void) const
+                       {
+                               return (const char*)(this->reason);     
+                       }
+               
+               
+                       const BadAllocException& BadAllocException::operator = (const BadAllocException& rBadAllocException)
+                       {
+                               const char* reason = rBadAllocException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               
+                               return *this;
+                       }
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+
index b5726ee..69221ce 100644 (file)
@@ -1,69 +1,69 @@
-/*\r
- * BadAllocException.hpp\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_BADALLOCEXCEPTION_HPP\r
-#define MSG_BADALLOCEXCEPTION_HPP\r
-\r
-#ifndef __cplusplus\r
-       #error BadAllocException.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <Exception.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-               class SIMGRIDX_EXPORT BadAllocException : public Exception\r
-               {\r
-                       public:\r
-                       \r
-                       // Default constructor.\r
-                               BadAllocException();\r
-                       \r
-                       // Copy constructor.\r
-                               BadAllocException(const BadAllocException& rBadAllocException);\r
-                       \r
-                       // This constructor takes the name of the object of the allocation failure.\r
-                               BadAllocException(const char* objectName);\r
-                       \r
-                       // Destructor.\r
-                               virtual ~BadAllocException();\r
-                               \r
-                       // Operations.\r
-                                       \r
-                                       // Returns the reason of the exception :\r
-                                       // the message "Not enough memory to allocate : `object name'"\r
-                                       const char* toString(void) const;\r
-                       \r
-                       // Operators.\r
-                               \r
-                               // Assignement.\r
-                               const BadAllocException& operator = (const BadAllocException& rBadAllocException);\r
-                               \r
-                       private :\r
-                       \r
-                       // Attributes.\r
-                               \r
-                               // A buffer used to build the message returned by the methode toString().\r
-                               char* reason;\r
-               };\r
-               \r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-#endif // !MSG_BADALLOCEXCEPTION_HPP\r
-\r
+/*
+ * BadAllocException.hpp
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_BADALLOCEXCEPTION_HPP
+#define MSG_BADALLOCEXCEPTION_HPP
+
+#ifndef __cplusplus
+       #error BadAllocException.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <Exception.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+               class SIMGRIDX_EXPORT BadAllocException : public Exception
+               {
+                       public:
+                       
+                       // Default constructor.
+                               BadAllocException();
+                       
+                       // Copy constructor.
+                               BadAllocException(const BadAllocException& rBadAllocException);
+                       
+                       // This constructor takes the name of the object of the allocation failure.
+                               BadAllocException(const char* objectName);
+                       
+                       // Destructor.
+                               virtual ~BadAllocException();
+                               
+                       // Operations.
+                                       
+                                       // Returns the reason of the exception :
+                                       // the message "Not enough memory to allocate : `object name'"
+                                       const char* toString(void) const;
+                       
+                       // Operators.
+                               
+                               // Assignement.
+                               const BadAllocException& operator = (const BadAllocException& rBadAllocException);
+                               
+                       private :
+                       
+                       // Attributes.
+                               
+                               // A buffer used to build the message returned by the methode toString().
+                               char* reason;
+               };
+               
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+#endif // !MSG_BADALLOCEXCEPTION_HPP
+
index 236ba2a..13887a2 100644 (file)
@@ -1,75 +1,75 @@
-/*\r
- * ClassNotFoundException.cxx\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
- /* ClassNotFoundException member functions implementation.\r
-  */  \r
-\r
-#include <ClassNotFoundException.hpp>\r
-\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-                       ClassNotFoundException::ClassNotFoundException()\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Class not found : unknown") + 1, sizeof(char));\r
-                               strcpy(this->reason, "Class not found : unknown");\r
-                       }\r
-               \r
-               \r
-                       ClassNotFoundException::ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException)\r
-                       {\r
-                               const char* reason = rClassNotFoundException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               strcpy(this->reason, reason);\r
-                               \r
-                       }\r
-               \r
-               \r
-                       ClassNotFoundException::ClassNotFoundException(const char* name)\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Class not found : ") + strlen(name) + 1, sizeof(char));\r
-                               sprintf(this->reason, "Class not found : %s", name);\r
-                       }\r
-               \r
-               \r
-                       ClassNotFoundException::~ClassNotFoundException()\r
-                       {\r
-                               if(this->reason)\r
-                                       free(this->reason);\r
-                       }\r
-                               \r
-                       const char* ClassNotFoundException::toString(void) const\r
-                       {\r
-                               return (const char*)(this->reason);     \r
-                       }\r
-               \r
-               \r
-                       const ClassNotFoundException& ClassNotFoundException::operator = (const ClassNotFoundException& rClassNotFoundException)\r
-                       {\r
-                               const char* reason = rClassNotFoundException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               \r
-                               return *this;\r
-                       }\r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-\r
+/*
+ * ClassNotFoundException.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* ClassNotFoundException member functions implementation.
+  */  
+
+#include <ClassNotFoundException.hpp>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+                       ClassNotFoundException::ClassNotFoundException()
+                       {
+                               this->reason = (char*) calloc(strlen("Class not found : unknown") + 1, sizeof(char));
+                               strcpy(this->reason, "Class not found : unknown");
+                       }
+               
+               
+                       ClassNotFoundException::ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException)
+                       {
+                               const char* reason = rClassNotFoundException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               strcpy(this->reason, reason);
+                               
+                       }
+               
+               
+                       ClassNotFoundException::ClassNotFoundException(const char* name)
+                       {
+                               this->reason = (char*) calloc(strlen("Class not found : ") + strlen(name) + 1, sizeof(char));
+                               sprintf(this->reason, "Class not found : %s", name);
+                       }
+               
+               
+                       ClassNotFoundException::~ClassNotFoundException()
+                       {
+                               if(this->reason)
+                                       free(this->reason);
+                       }
+                               
+                       const char* ClassNotFoundException::toString(void) const
+                       {
+                               return (const char*)(this->reason);     
+                       }
+               
+               
+                       const ClassNotFoundException& ClassNotFoundException::operator = (const ClassNotFoundException& rClassNotFoundException)
+                       {
+                               const char* reason = rClassNotFoundException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               
+                               return *this;
+                       }
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+
index bc90970..36a77b9 100644 (file)
@@ -1,69 +1,69 @@
-/*\r
- * ClassNotFoundException.hpp\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_CLASSNOTFOUNDEXCEPTION_HPP\r
-#define MSG_CLASSNOTFOUNDEXCEPTION_HPP\r
-\r
-#ifndef __cplusplus\r
-       #error ClassNotFoundException.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <Exception.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-               class SIMGRIDX_EXPORT ClassNotFoundException : public Exception\r
-               {\r
-                       public:\r
-                       \r
-                       // Default constructor.\r
-                               ClassNotFoundException();\r
-                       \r
-                       // Copy constructor.\r
-                               ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException);\r
-                       \r
-                       // This constructor takes the name of the class not found.\r
-                               ClassNotFoundException(const char* name);\r
-                       \r
-                       // Destructor.\r
-                               virtual ~ClassNotFoundException();\r
-                               \r
-                       // Operations.\r
-                                       \r
-                                       // Returns the reason of the exception :\r
-                                       // the message "Host not found `host name'"\r
-                                       const char* toString(void) const;\r
-                       \r
-                       // Operators.\r
-                               \r
-                               // Assignement.\r
-                               const ClassNotFoundException& operator = (const ClassNotFoundException& rClassNotFoundException);\r
-                               \r
-                       private :\r
-                       \r
-                       // Attributes.\r
-                               \r
-                               // A buffer used to build the message returned by the methode toString().\r
-                               char* reason;\r
-               };\r
-               \r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-#endif // !MSG_CLASSNOTFOUNDEXCEPTION_HPP\r
-\r
+/*
+ * ClassNotFoundException.hpp
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_CLASSNOTFOUNDEXCEPTION_HPP
+#define MSG_CLASSNOTFOUNDEXCEPTION_HPP
+
+#ifndef __cplusplus
+       #error ClassNotFoundException.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <Exception.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+               class SIMGRIDX_EXPORT ClassNotFoundException : public Exception
+               {
+                       public:
+                       
+                       // Default constructor.
+                               ClassNotFoundException();
+                       
+                       // Copy constructor.
+                               ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException);
+                       
+                       // This constructor takes the name of the class not found.
+                               ClassNotFoundException(const char* name);
+                       
+                       // Destructor.
+                               virtual ~ClassNotFoundException();
+                               
+                       // Operations.
+                                       
+                                       // Returns the reason of the exception :
+                                       // the message "Host not found `host name'"
+                                       const char* toString(void) const;
+                       
+                       // Operators.
+                               
+                               // Assignement.
+                               const ClassNotFoundException& operator = (const ClassNotFoundException& rClassNotFoundException);
+                               
+                       private :
+                       
+                       // Attributes.
+                               
+                               // A buffer used to build the message returned by the methode toString().
+                               char* reason;
+               };
+               
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+#endif // !MSG_CLASSNOTFOUNDEXCEPTION_HPP
+
index 0fc1e6f..2f9ed2d 100644 (file)
@@ -1,44 +1,44 @@
-\r
-/*\r
- * Config.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_CONFIG_HPP\r
-#define MSG_CONFIG_HPP\r
-\r
-#ifndef __cplusplus\r
-       #error Config.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               #if defined(WIN32) && !defined(__MINGW32__)\r
-                       #if defined(SIMGRIDX_EXPORTS)\r
-                               #define SIMGRIDX_EXPORT __declspec(dllexport)\r
-                       #else\r
-                               #define SIMGRIDX_EXPORT __declspec(dllimport)\r
-                       #endif\r
-               #else\r
-                       #define SIMGRIDX_EXPORT\r
-               #endif \r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
-#ifndef WIN32\r
-#define _strdup strdup\r
-#endif\r
-\r
-#endif // MSG_CONFIG_HPP\r
-\r
+
+/*
+ * Config.hpp
+ *
+ * This file contains the declaration of the wrapper class of the native MSG task type.
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+
+#ifndef MSG_CONFIG_HPP
+#define MSG_CONFIG_HPP
+
+#ifndef __cplusplus
+       #error Config.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               #if defined(WIN32) && !defined(__MINGW32__)
+                       #if defined(SIMGRIDX_EXPORTS)
+                               #define SIMGRIDX_EXPORT __declspec(dllexport)
+                       #else
+                               #define SIMGRIDX_EXPORT __declspec(dllimport)
+                       #endif
+               #else
+                       #define SIMGRIDX_EXPORT
+               #endif 
+       } // namespace Msg
+} // namespace SimGrid
+
+#ifndef WIN32
+#define _strdup strdup
+#endif
+
+#endif // MSG_CONFIG_HPP
+
index 71e0acf..0d9b003 100644 (file)
-/*\r
- * Environment.cxx\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
- /* Environment member functions implementation.\r
-  */  \r
-  \r
-#include <Environment.hpp>\r
-\r
-#include <stdlib.h>\r
-\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-\r
-#include <msg/msg.h>\r
-\r
-#ifndef S_ISREG\r
-       #define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG)\r
-#endif\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               Environment::Environment()\r
-               {\r
-                       this->file = NULL;\r
-                       this->loaded = false;\r
-               }\r
-                               \r
-               Environment::Environment(const Environment& rEnvironment)\r
-               {\r
-                       this->file = rEnvironment.getFile();\r
-                       this->loaded = rEnvironment.isLoaded();\r
-               }\r
-               \r
-               Environment::Environment(const char* file)\r
-               throw(NullPointerException, FileNotFoundException)\r
-               {\r
-                       // check parameters\r
-                       \r
-                       if(!file)\r
-                               throw NullPointerException("file (must not be NULL");\r
-                       \r
-                       struct stat statBuf = {0};\r
-                               \r
-                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
-                               throw FileNotFoundException("file (file not found)");\r
-                               \r
-                       this->file = file;\r
-                       this->loaded = false;\r
-               }\r
-               \r
-               Environment::~Environment()\r
-               {\r
-                       // NOTHING TODO\r
-               }\r
-               \r
-               // Operations.\r
-               \r
-               void Environment::load(void)\r
-               throw(LogicException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->loaded)\r
-                               throw LogicException("environement already loaded");\r
-                       \r
-                       // check the parameters\r
-                       if(!this->file)\r
-                               throw LogicException("you must specify the xml file which describe the environment to load\nuse Environment::setFile()"); \r
-                       \r
-                       MSG_create_environment(file);\r
-                       \r
-                       this->loaded = true;            \r
-               }\r
-               \r
-               void Environment::load(const char* file)\r
-               throw(NullPointerException, FileNotFoundException, LogicException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->loaded)\r
-                               throw LogicException("environment already loaded");\r
-                       \r
-                       // check the parameters\r
-                               \r
-                       if(!file)\r
-                               throw NullPointerException("file");\r
-                       \r
-                       struct stat statBuf = {0};\r
-                               \r
-                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
-                               throw FileNotFoundException(file);\r
-                                       \r
-                       MSG_create_environment(file);\r
-                       \r
-                       this->file = file;\r
-                       this->loaded = true;    \r
-               }\r
-               \r
-               bool Environment::isLoaded(void) const\r
-               {\r
-                       return this->loaded;\r
-               }\r
-               \r
-               // Getters/setters\r
-               void Environment::setFile(const char* file)\r
-               throw(NullPointerException, FileNotFoundException, LogicException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->loaded)\r
-                               throw LogicException("your are trying to change the file of an already loaded environment");\r
-                               \r
-                       // check parameters\r
-                       \r
-                       if(!file)\r
-                               throw NullPointerException("file (must not be NULL");\r
-                       \r
-                       struct stat statBuf = {0};\r
-                               \r
-                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
-                               throw FileNotFoundException("file (file not found)");\r
-                               \r
-                       this->file = file;\r
-               }\r
-               \r
-               const char* Environment::getFile(void) const\r
-               {\r
-                       return this->file;\r
-               }\r
-       \r
-               \r
-               const Environment& Environment::operator = (const Environment& rEnvironment)\r
-               throw(LogicException)\r
-               {\r
-                       // check logic\r
-                       \r
-                       if(this->loaded)\r
-                               throw LogicException("environment already loaded");\r
-                       \r
-                       this->file = rEnvironment.getFile();\r
-                       this->loaded = rEnvironment.isLoaded();\r
-                       \r
-                       return *this;\r
-               }\r
-                               \r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
+/*
+ * Environment.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* Environment member functions implementation.
+  */  
+  
+#include <Environment.hpp>
+
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <msg/msg.h>
+
+#ifndef S_ISREG
+       #define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG)
+#endif
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               Environment::Environment()
+               {
+                       this->file = NULL;
+                       this->loaded = false;
+               }
+                               
+               Environment::Environment(const Environment& rEnvironment)
+               {
+                       this->file = rEnvironment.getFile();
+                       this->loaded = rEnvironment.isLoaded();
+               }
+               
+               Environment::Environment(const char* file)
+               throw(NullPointerException, FileNotFoundException)
+               {
+                       // check parameters
+                       
+                       if(!file)
+                               throw NullPointerException("file (must not be NULL");
+                       
+                       struct stat statBuf = {0};
+                               
+                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))
+                               throw FileNotFoundException("file (file not found)");
+                               
+                       this->file = file;
+                       this->loaded = false;
+               }
+               
+               Environment::~Environment()
+               {
+                       // NOTHING TODO
+               }
+               
+               // Operations.
+               
+               void Environment::load(void)
+               throw(LogicException)
+               {
+                       // check logic
+                       
+                       if(this->loaded)
+                               throw LogicException("environement already loaded");
+                       
+                       // check the parameters
+                       if(!this->file)
+                               throw LogicException("you must specify the xml file which describe the environment to load\nuse Environment::setFile()"); 
+                       
+                       MSG_create_environment(file);
+                       
+                       this->loaded = true;            
+               }
+               
+               void Environment::load(const char* file)
+               throw(NullPointerException, FileNotFoundException, LogicException)
+               {
+                       // check logic
+                       
+                       if(this->loaded)
+                               throw LogicException("environment already loaded");
+                       
+                       // check the parameters
+                               
+                       if(!file)
+                               throw NullPointerException("file");
+                       
+                       struct stat statBuf = {0};
+                               
+                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))
+                               throw FileNotFoundException(file);
+                                       
+                       MSG_create_environment(file);
+                       
+                       this->file = file;
+                       this->loaded = true;    
+               }
+               
+               bool Environment::isLoaded(void) const
+               {
+                       return this->loaded;
+               }
+               
+               // Getters/setters
+               void Environment::setFile(const char* file)
+               throw(NullPointerException, FileNotFoundException, LogicException)
+               {
+                       // check logic
+                       
+                       if(this->loaded)
+                               throw LogicException("your are trying to change the file of an already loaded environment");
+                               
+                       // check parameters
+                       
+                       if(!file)
+                               throw NullPointerException("file (must not be NULL");
+                       
+                       struct stat statBuf = {0};
+                               
+                       if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))
+                               throw FileNotFoundException("file (file not found)");
+                               
+                       this->file = file;
+               }
+               
+               const char* Environment::getFile(void) const
+               {
+                       return this->file;
+               }
+       
+               
+               const Environment& Environment::operator = (const Environment& rEnvironment)
+               throw(LogicException)
+               {
+                       // check logic
+                       
+                       if(this->loaded)
+                               throw LogicException("environment already loaded");
+                       
+                       this->file = rEnvironment.getFile();
+                       this->loaded = rEnvironment.isLoaded();
+                       
+                       return *this;
+               }
+                               
+       } // namespace Msg
+} // namespace SimGrid
+
index 89f6e48..8f8e0a0 100644 (file)
-/*\r
- * Environment.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_ENVIRONMENT_HPP\r
-#define MSG_ENVIRONMENT_HPP\r
-\r
-#ifndef __cplusplus\r
-       #error Environment.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <NullPointerException.hpp>\r
-#include <FileNotFoundException.hpp>\r
-#include <InvalidArgumentException.hpp>\r
-#include <LogicException.hpp>\r
-#include <MsgException.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               class NullPointerException;\r
-               class FileNotFoundException;\r
-               class InvalidArgumentException;\r
-               class LogicException;\r
-               class MsgException;\r
-\r
-               // Environment class wrapper declaration\r
-               class SIMGRIDX_EXPORT Environment\r
-               {\r
-                       public:\r
-                               \r
-                               /*! \brief Default constructor.\r
-                                */\r
-                               Environment();\r
-                               \r
-                               /*! \brief Copy constructor.\r
-                                */\r
-                               Environment(const Environment& rEnvironment);\r
-                               \r
-                               /*! \brief Constructor.\r
-                                *\r
-                                * \param file                  The xml file describing the environment of the simulation.\r
-                                *\r
-                                * \exception                   If this constructor fails, it throws one of the exception\r
-                                *                                              described below:\r
-                                *\r
-                                *                                              [NullPointerException]          if the parameter file is NULL.\r
-                                *\r
-                                *                                              [FileNotFoundException]         if the file is not found.\r
-                                */\r
-                               Environment(const char* file)\r
-                               throw(NullPointerException, FileNotFoundException);\r
-                               \r
-                               /*! \brief Destructor.\r
-                                */\r
-                               virtual ~Environment();\r
-                               \r
-                       // Operations.\r
-                               \r
-                               /*! brief Environment::load() - Load the environment of a simulation.\r
-                                *\r
-                                * \exception                   If this method fails, it throws the exception described below:\r
-                                *\r
-                                *                                              [LogicException]                        if the file of the environment is not yet specified or\r
-                                *                                                                                                      if the environment is already loaded.\r
-                                */\r
-                               void load(void)\r
-                               throw(LogicException);\r
-                               \r
-                               /*! \brief Environment::load() - Load the environment of a simulation.\r
-                                *\r
-                                * \param file                  The xml file describing the environment of the simulation.\r
-                                *\r
-                                * \exception                   If this method fails, it throws one of the exceptions described below.\r
-                                *\r
-                                *                                              [NullPointerException]          if the parameter file is NULL.\r
-                                *\r
-                                *                                              [FileNotFoundException]         if the specified file is not found.\r
-                                *\r
-                                *                                              [LogicException]                        if the environment is already loaded.\r
-                                */\r
-                               void load(const char* file)\r
-                               throw(NullPointerException, FileNotFoundException, LogicException);\r
-                               \r
-                               /*! \brief Environment::isLoaded() - Tests if an environment is loaded.\r
-                                *\r
-                                * \return                              If the environment is loaded, the method returns true. Otherwise the method\r
-                                *                                              returns false.\r
-                                */\r
-                               bool isLoaded(void) const;\r
-                               \r
-                       // Getters/setters\r
-                               /*! \brief Environment::setFile() - Sets the xml file of the environment.\r
-                                *\r
-                                * \param file                  The file describing the environment.\r
-                                *\r
-                                * \exception                   If the method fails, it throws one of the exceptions described below:\r
-                                *\r
-                                *                                              [NullPointerException]          if the parameter file is NULL.\r
-                                *                              \r
-                                *                                              [FileNotFoundException]         if the file is not found.\r
-                                *\r
-                                *                                              [LogicException]                        if the environment is already loaded.\r
-                                */\r
-                               void setFile(const char* file)\r
-                               throw(NullPointerException, FileNotFoundException, LogicException);\r
-                               \r
-                               /*! \brief Environment::getFile() - Gets the xml file environment description.\r
-                                *\r
-                                * \return                              The xml file describing the environment.                                \r
-                                *\r
-                                */\r
-                               const char* getFile(void) const;\r
-                               \r
-                       // Operators.\r
-                               \r
-                               /*! \brief Assignment operator.\r
-                                *\r
-                                * \exception                   If this operator fails, it throws the exception described below:\r
-                                *\r
-                                *                                              [LogicException]                        if you try to assign a loaded environment.\r
-                                */\r
-                               const Environment& operator = (const Environment& rEnvironment)\r
-                               throw(LogicException);\r
-                               \r
-                       private:\r
-                               \r
-                               // Attributes.\r
-                               \r
-                               // the xml file which describe the environment of the simulation.\r
-                               const char* file;\r
-                               \r
-                               // flag : is true the environment of the simulation is loaded.\r
-                               bool loaded;\r
-               };\r
-               \r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
-\r
-#endif // !MSG_ENVIRONMENT_HPP\r
-\r
+/*
+ * Environment.hpp
+ *
+ * This file contains the declaration of the wrapper class of the native MSG task type.
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_ENVIRONMENT_HPP
+#define MSG_ENVIRONMENT_HPP
+
+#ifndef __cplusplus
+       #error Environment.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <NullPointerException.hpp>
+#include <FileNotFoundException.hpp>
+#include <InvalidArgumentException.hpp>
+#include <LogicException.hpp>
+#include <MsgException.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               class NullPointerException;
+               class FileNotFoundException;
+               class InvalidArgumentException;
+               class LogicException;
+               class MsgException;
+
+               // Environment class wrapper declaration
+               class SIMGRIDX_EXPORT Environment
+               {
+                       public:
+                               
+                               /*! \brief Default constructor.
+                                */
+                               Environment();
+                               
+                               /*! \brief Copy constructor.
+                                */
+                               Environment(const Environment& rEnvironment);
+                               
+                               /*! \brief Constructor.
+                                *
+                                * \param file                  The xml file describing the environment of the simulation.
+                                *
+                                * \exception                   If this constructor fails, it throws one of the exception
+                                *                                              described below:
+                                *
+                                *                                              [NullPointerException]          if the parameter file is NULL.
+                                *
+                                *                                              [FileNotFoundException]         if the file is not found.
+                                */
+                               Environment(const char* file)
+                               throw(NullPointerException, FileNotFoundException);
+                               
+                               /*! \brief Destructor.
+                                */
+                               virtual ~Environment();
+                               
+                       // Operations.
+                               
+                               /*! brief Environment::load() - Load the environment of a simulation.
+                                *
+                                * \exception                   If this method fails, it throws the exception described below:
+                                *
+                                *                                              [LogicException]                        if the file of the environment is not yet specified or
+                                *                                                                                                      if the environment is already loaded.
+                                */
+                               void load(void)
+                               throw(LogicException);
+                               
+                               /*! \brief Environment::load() - Load the environment of a simulation.
+                                *
+                                * \param file                  The xml file describing the environment of the simulation.
+                                *
+                                * \exception                   If this method fails, it throws one of the exceptions described below.
+                                *
+                                *                                              [NullPointerException]          if the parameter file is NULL.
+                                *
+                                *                                              [FileNotFoundException]         if the specified file is not found.
+                                *
+                                *                                              [LogicException]                        if the environment is already loaded.
+                                */
+                               void load(const char* file)
+                               throw(NullPointerException, FileNotFoundException, LogicException);
+                               
+                               /*! \brief Environment::isLoaded() - Tests if an environment is loaded.
+                                *
+                                * \return                              If the environment is loaded, the method returns true. Otherwise the method
+                                *                                              returns false.
+                                */
+                               bool isLoaded(void) const;
+                               
+                       // Getters/setters
+                               /*! \brief Environment::setFile() - Sets the xml file of the environment.
+                                *
+                                * \param file                  The file describing the environment.
+                                *
+                                * \exception                   If the method fails, it throws one of the exceptions described below:
+                                *
+                                *                                              [NullPointerException]          if the parameter file is NULL.
+                                *                              
+                                *                                              [FileNotFoundException]         if the file is not found.
+                                *
+                                *                                              [LogicException]                        if the environment is already loaded.
+                                */
+                               void setFile(const char* file)
+                               throw(NullPointerException, FileNotFoundException, LogicException);
+                               
+                               /*! \brief Environment::getFile() - Gets the xml file environment description.
+                                *
+                                * \return                              The xml file describing the environment.                                
+                                *
+                                */
+                               const char* getFile(void) const;
+                               
+                       // Operators.
+                               
+                               /*! \brief Assignment operator.
+                                *
+                                * \exception                   If this operator fails, it throws the exception described below:
+                                *
+                                *                                              [LogicException]                        if you try to assign a loaded environment.
+                                */
+                               const Environment& operator = (const Environment& rEnvironment)
+                               throw(LogicException);
+                               
+                       private:
+                               
+                               // Attributes.
+                               
+                               // the xml file which describe the environment of the simulation.
+                               const char* file;
+                               
+                               // flag : is true the environment of the simulation is loaded.
+                               bool loaded;
+               };
+               
+       } // namespace Msg
+} // namespace SimGrid
+
+
+#endif // !MSG_ENVIRONMENT_HPP
+
index 94ae26e..c314f13 100644 (file)
@@ -1,64 +1,64 @@
-/*\r
- * Exception.cxx\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
- /* Exception member functions implementation.\r
-  * The base class of all the types of exceptions of SimGrid::Msg.\r
-  */  \r
-\r
-#include <Exception.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-                       Exception::Exception()\r
-                       {\r
-                               reason = "Unknown reason";\r
-                       }\r
-               \r
-               \r
-                       Exception::Exception(const Exception& rException)\r
-                       {\r
-                               this->reason = rException.toString();\r
-                       }\r
-               \r
-               \r
-                       Exception::Exception(const char* reason)\r
-                       {\r
-                               this->reason = reason;\r
-                       }\r
-               \r
-               \r
-                       Exception::~Exception()\r
-                       {\r
-                               // NOTHING TODO\r
-                       }\r
-                               \r
-                       const char* Exception::toString(void) const\r
-                       {\r
-                               return this->reason;    \r
-                       }\r
-               \r
-               \r
-                       const Exception& Exception::operator = (const Exception& rException)\r
-                       {\r
-                               this->reason = rException.toString();\r
-                               return *this;\r
-                       }\r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-\r
+/*
+ * Exception.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* Exception member functions implementation.
+  * The base class of all the types of exceptions of SimGrid::Msg.
+  */  
+
+#include <Exception.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+                       Exception::Exception()
+                       {
+                               reason = "Unknown reason";
+                       }
+               
+               
+                       Exception::Exception(const Exception& rException)
+                       {
+                               this->reason = rException.toString();
+                       }
+               
+               
+                       Exception::Exception(const char* reason)
+                       {
+                               this->reason = reason;
+                       }
+               
+               
+                       Exception::~Exception()
+                       {
+                               // NOTHING TODO
+                       }
+                               
+                       const char* Exception::toString(void) const
+                       {
+                               return this->reason;    
+                       }
+               
+               
+                       const Exception& Exception::operator = (const Exception& rException)
+                       {
+                               this->reason = rException.toString();
+                               return *this;
+                       }
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+
index 1b1a8ee..2fc3067 100644 (file)
@@ -1,68 +1,68 @@
-/*\r
- * Exception.hpp\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_EXCEPTION_HPP\r
-#define MSG_EXCEPTION_HPP\r
-\r
-#ifndef __cplusplus\r
-       #error Exception.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <Config.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-               class SIMGRIDX_EXPORT Exception\r
-               {\r
-                       public:\r
-                       \r
-                       // Default constructor.\r
-                               Exception();\r
-                       \r
-                       // Copy constructor.\r
-                               Exception(const Exception& rException);\r
-                       \r
-                       // This constructor takes the reason of the exception.\r
-                               Exception(const char* reason);\r
-                       \r
-                       // Destructor.\r
-                               virtual ~Exception();\r
-                               \r
-                       // Operations.\r
-                                       \r
-                                       // Returns the reason of the exception.\r
-                                       const char* toString(void) const;\r
-                       \r
-                       // Operators.\r
-                               \r
-                               // Assignement.\r
-                               const Exception& operator = (const Exception& rException);\r
-                               \r
-                       private :\r
-                       \r
-                       // Attributes.\r
-                               \r
-                               // The reason of the exceptions.\r
-                               const char* reason;\r
-               };\r
-               \r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-#endif // !MSG_EXCEPTION_HPP\r
-\r
+/*
+ * Exception.hpp
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_EXCEPTION_HPP
+#define MSG_EXCEPTION_HPP
+
+#ifndef __cplusplus
+       #error Exception.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <Config.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+               class SIMGRIDX_EXPORT Exception
+               {
+                       public:
+                       
+                       // Default constructor.
+                               Exception();
+                       
+                       // Copy constructor.
+                               Exception(const Exception& rException);
+                       
+                       // This constructor takes the reason of the exception.
+                               Exception(const char* reason);
+                       
+                       // Destructor.
+                               virtual ~Exception();
+                               
+                       // Operations.
+                                       
+                                       // Returns the reason of the exception.
+                                       const char* toString(void) const;
+                       
+                       // Operators.
+                               
+                               // Assignement.
+                               const Exception& operator = (const Exception& rException);
+                               
+                       private :
+                       
+                       // Attributes.
+                               
+                               // The reason of the exceptions.
+                               const char* reason;
+               };
+               
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+#endif // !MSG_EXCEPTION_HPP
+
index 297d60c..3ceec07 100644 (file)
@@ -1,75 +1,75 @@
-/*\r
- * FileNotFoundException.cxx\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
- /* FileNotFoundException member functions implementation.\r
-  */  \r
-\r
-#include <FileNotFoundException.hpp>\r
-\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-                       FileNotFoundException::FileNotFoundException()\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("File not found") + 1, sizeof(char));\r
-                               strcpy(this->reason, "File not found");\r
-                       }\r
-               \r
-               \r
-                       FileNotFoundException::FileNotFoundException(const FileNotFoundException& rFileNotFoundException)\r
-                       {\r
-                               const char* reason = rFileNotFoundException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               strcpy(this->reason, reason);\r
-                               \r
-                       }\r
-               \r
-                       FileNotFoundException::FileNotFoundException(const char* file)\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("File not found ") + strlen(file) + 1, sizeof(char));\r
-                               sprintf(this->reason, "File not found %s", file);\r
-                       }\r
-               \r
-               \r
-                       FileNotFoundException::~FileNotFoundException()\r
-                       {\r
-                               if(this->reason)\r
-                                       free(this->reason);\r
-                       }\r
-                               \r
-                       const char* FileNotFoundException::toString(void) const\r
-                       {\r
-                               return (const char*)(this->reason);     \r
-                       }\r
-               \r
-               \r
-                       const FileNotFoundException& FileNotFoundException::operator = (const FileNotFoundException& rFileNotFoundException)\r
-                       {\r
-                               const char* reason = rFileNotFoundException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               \r
-                               return *this;\r
-                       }\r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-\r
+/*
+ * FileNotFoundException.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* FileNotFoundException member functions implementation.
+  */  
+
+#include <FileNotFoundException.hpp>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+                       FileNotFoundException::FileNotFoundException()
+                       {
+                               this->reason = (char*) calloc(strlen("File not found") + 1, sizeof(char));
+                               strcpy(this->reason, "File not found");
+                       }
+               
+               
+                       FileNotFoundException::FileNotFoundException(const FileNotFoundException& rFileNotFoundException)
+                       {
+                               const char* reason = rFileNotFoundException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               strcpy(this->reason, reason);
+                               
+                       }
+               
+                       FileNotFoundException::FileNotFoundException(const char* file)
+                       {
+                               this->reason = (char*) calloc(strlen("File not found ") + strlen(file) + 1, sizeof(char));
+                               sprintf(this->reason, "File not found %s", file);
+                       }
+               
+               
+                       FileNotFoundException::~FileNotFoundException()
+                       {
+                               if(this->reason)
+                                       free(this->reason);
+                       }
+                               
+                       const char* FileNotFoundException::toString(void) const
+                       {
+                               return (const char*)(this->reason);     
+                       }
+               
+               
+                       const FileNotFoundException& FileNotFoundException::operator = (const FileNotFoundException& rFileNotFoundException)
+                       {
+                               const char* reason = rFileNotFoundException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               
+                               return *this;
+                       }
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+
index a7ddfbc..53a6247 100644 (file)
@@ -1,69 +1,69 @@
-/*\r
- * FileNotFoundException.hpp\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_FILENOTFOUND_HPP\r
-#define MSG_FILENOTFOUND_HPP\r
-\r
-#ifndef __cplusplus\r
-       #error FileNotFoundException.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <Exception.hpp>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-               class SIMGRIDX_EXPORT FileNotFoundException : public Exception\r
-               {\r
-                       public:\r
-                       \r
-                       // Default constructor.\r
-                               FileNotFoundException();\r
-                       \r
-                       // Copy constructor.\r
-                               FileNotFoundException(const FileNotFoundException& rFileNotFoundException);\r
-                       \r
-                       // This constructor takes the name of the file.\r
-                               FileNotFoundException(const char* file);\r
-                       \r
-                       // Destructor.\r
-                               virtual ~FileNotFoundException();\r
-                               \r
-                       // Operations.\r
-                                       \r
-                                       // Returns the reason of the exception :\r
-                                       // the message "File not found : `object name'"\r
-                                       const char* toString(void) const;\r
-                       \r
-                       // Operators.\r
-                               \r
-                               // Assignement.\r
-                               const FileNotFoundException& operator = (const FileNotFoundException& rFileNotFoundException);\r
-                               \r
-                       private :\r
-                       \r
-                       // Attributes.\r
-                               \r
-                               // A buffer used to build the message returned by the methode toString().\r
-                               char* reason;\r
-               };\r
-               \r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-#endif // !MSG_MSGEXCEPTION_HPP\r
-\r
+/*
+ * FileNotFoundException.hpp
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_FILENOTFOUND_HPP
+#define MSG_FILENOTFOUND_HPP
+
+#ifndef __cplusplus
+       #error FileNotFoundException.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <Exception.hpp>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+               class SIMGRIDX_EXPORT FileNotFoundException : public Exception
+               {
+                       public:
+                       
+                       // Default constructor.
+                               FileNotFoundException();
+                       
+                       // Copy constructor.
+                               FileNotFoundException(const FileNotFoundException& rFileNotFoundException);
+                       
+                       // This constructor takes the name of the file.
+                               FileNotFoundException(const char* file);
+                       
+                       // Destructor.
+                               virtual ~FileNotFoundException();
+                               
+                       // Operations.
+                                       
+                                       // Returns the reason of the exception :
+                                       // the message "File not found : `object name'"
+                                       const char* toString(void) const;
+                       
+                       // Operators.
+                               
+                               // Assignement.
+                               const FileNotFoundException& operator = (const FileNotFoundException& rFileNotFoundException);
+                               
+                       private :
+                       
+                       // Attributes.
+                               
+                               // A buffer used to build the message returned by the methode toString().
+                               char* reason;
+               };
+               
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+#endif // !MSG_MSGEXCEPTION_HPP
+
index 18997ea..39f40eb 100644 (file)
-/*\r
- * Host.cxx\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
- /* Host class member functions implementation.\r
-  */ \r
-\r
-#include <Task.hpp>\r
-#include <Process.hpp>\r
-\r
-#include <Host.hpp>\r
-\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-\r
-#include <msg/msg.h>\r
-#include <msg/private.h>\r
-\r
-#include <xbt/fifo.h>\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               Host::Host()\r
-               {\r
-                       nativeHost = NULL;\r
-                       data = NULL;\r
-               }\r
-               \r
-               Host::Host(const Host& rHost)\r
-               {\r
-                       this->nativeHost = rHost.nativeHost;\r
-                       this->data = rHost.getData();   \r
-               }\r
-               \r
-               Host::~Host()\r
-               {\r
-                       // NOTHING TODO\r
-               }\r
-               \r
-               \r
-               Host& Host::getByName(const char* hostName)\r
-               throw(HostNotFoundException, NullPointerException, BadAllocException)\r
-               {\r
-                       // check the parameters\r
-                       if(!hostName)\r
-                               throw NullPointerException("hostName");\r
-                               \r
-                       m_host_t nativeHost = NULL;     // native host.\r
-                       Host* host = NULL;                      // wrapper host.\r
-                       \r
-                       if(!(nativeHost = MSG_get_host_by_name(hostName))) \r
-                               throw HostNotFoundException(hostName);\r
-                       \r
-                       if(!nativeHost->data) \r
-                       { // native host not associated yet with  its wrapper\r
-                       \r
-                               // instanciate a new wrapper \r
-                               if(!(host = new Host()))\r
-                                       throw BadAllocException(hostName);\r
-                               \r
-                               host->nativeHost = nativeHost; \r
-                       \r
-                               // the native host data field is set with its wrapper returned \r
-                               nativeHost->data = (void*)host;\r
-                       }\r
-                       \r
-                       // return the reference to cxx wrapper\r
-                       return *((Host*)nativeHost->data);                              \r
-               }\r
-               \r
-               int Host::getNumber(void)\r
-               {\r
-                       return MSG_get_host_number();\r
-               }\r
-               \r
-               Host& Host::currentHost(void)\r
-               {\r
-                       Host* host = NULL;\r
-                       m_host_t nativeHost = MSG_host_self();\r
-                       \r
-                       if(!nativeHost->data) \r
-                       {\r
-                               // the native host not yet associated with its wrapper\r
-                       \r
-                               // instanciate a new wrapper\r
-                               host = new Host();\r
-                       \r
-                               host->nativeHost = nativeHost;\r
-                       \r
-                               nativeHost->data = (void*)host;\r
-                       } \r
-                       else \r
-                       {\r
-                               host = (Host*)nativeHost->data;\r
-                       }\r
-                       \r
-                       return *host;\r
-               }\r
-               \r
-               void Host::all(Host*** hosts, int* len) \r
-               throw(InvalidArgumentException, BadAllocException) \r
-               {\r
-                       // check the parameters\r
-                       if(!hosts)\r
-                               throw InvalidArgumentException("hosts");\r
-                               \r
-                       if(len < 0)\r
-                               throw InvalidArgumentException("len parameter must be positive");\r
-                       \r
-                       int count = xbt_fifo_size(msg_global->host);\r
-                       \r
-                       if(*len < count)\r
-                               throw InvalidArgumentException("len parameter must be more than the number of installed host\n (use Host::getNumber() to get the number of hosts)");\r
-                       \r
-                       int index;\r
-                       m_host_t nativeHost;\r
-                       Host* host;\r
-               \r
-                       m_host_t* table = (m_host_t *)xbt_fifo_to_array(msg_global->host);\r
-                       \r
-                       for(index = 0; index < count; index++) \r
-                       {\r
-                               nativeHost = table[index];\r
-                               host = (Host*)(nativeHost->data);\r
-                       \r
-                               if(!host) \r
-                               {\r
-                                       if(!(host = new Host()))\r
-                                       {\r
-                                               // release all allocated memory.\r
-                                               for(int i = 0; i < index; i++)\r
-                                                       delete (*(hosts)[i]);\r
-                                               \r
-                                               throw BadAllocException("to fill the table of the hosts installed on your platform");\r
-                                       }\r
-                                       \r
-                                       host->nativeHost = nativeHost;\r
-                                       nativeHost->data = (void*)host;\r
-                               }\r
-                               \r
-                               (*hosts)[index] = host;\r
-                 }\r
-               \r
-                 *len = count;  \r
-               }\r
-               \r
-               const char* Host::getName(void) const\r
-               {\r
-                       return nativeHost->name;\r
-               }\r
-               \r
-               void Host::setData(void* data)\r
-               {\r
-                       this->data = data;\r
-               }\r
-               \r
-               void* Host::getData(void) const\r
-               {\r
-                       return this->data;\r
-               }\r
-               \r
-               int Host::getRunningTaskNumber(void) const\r
-               {\r
-                       return MSG_get_host_msgload(nativeHost); \r
-               }\r
-               \r
-               double Host::getSpeed(void) const\r
-               {\r
-                       return MSG_get_host_speed(nativeHost);\r
-               }\r
-               \r
-               bool Host::hasData(void) const\r
-               {\r
-                       return (NULL != this->data);\r
-               }\r
-               \r
-               int Host::isAvailable(void) const\r
-               {\r
-                       return SIMIX_host_get_state(nativeHost->simdata->smx_host);\r
-               }\r
-               \r
-               void Host::put(int channel, Task* task) \r
-               throw(MsgException, InvalidArgumentException)\r
-               {\r
-                       // checks the parameters\r
-                       if(channel < 0)\r
-                               throw InvalidArgumentException("channel (must be more or equal to zero)");\r
-                               \r
-                       if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, nativeHost, channel , -1.0))\r
-                               throw MsgException("MSG_task_put_with_timeout() failed");\r
-               } \r
-\r
-               void Host::put(int channel, Task* task, double timeout) \r
-               throw(MsgException, InvalidArgumentException) \r
-               {\r
-                       // checks the parameters\r
-                       if(channel < 0)\r
-                               throw InvalidArgumentException("channel (must be more or equal to zero)");\r
-                               \r
-                       if(timeout < 0.0 && timeout != -1.0)\r
-                               throw InvalidArgumentException("timeout (must be more or equal to zero or equal to -1.0)");     \r
-                               \r
-                               \r
-                   if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, nativeHost, channel , timeout))\r
-                               throw MsgException("MSG_task_put_with_timeout() failed");\r
-               }\r
-               \r
-               void Host::putBounded(int channel, Task* task, double maxRate) \r
-               throw(MsgException, InvalidArgumentException)\r
-               {\r
-                   // checks the parameters\r
-                       if(channel < 0)\r
-                               throw InvalidArgumentException("channel (must be more or equal to zero)");\r
-                               \r
-                       if(maxRate < 0.0 && maxRate != -1.0)\r
-                               throw InvalidArgumentException("maxRate (must be more or equal to zero or equal to -1.0)");     \r
-                   \r
-                       if(MSG_OK != MSG_task_put_bounded(task->nativeTask, nativeHost, channel, maxRate))\r
-                               throw MsgException("MSG_task_put_bounded() failed");\r
-               }\r
-               \r
-               void Host::send(Task* task) \r
-               throw(MsgException, BadAllocException)  \r
-               {       \r
-                       MSG_error_t rv;\r
-                       \r
-                       char* alias = (char*)calloc(strlen(this->getName())+ strlen(Process::currentProcess().getName()) + 2, sizeof(char));\r
-                               \r
-                       if(!alias)\r
-                               throw BadAllocException("alias");\r
-                               \r
-                       sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName());\r
-                               \r
-                       rv = MSG_task_send_with_timeout(task->nativeTask, alias, -1.0);\r
-                       \r
-                       free(alias);\r
-                       \r
-                       if(MSG_OK != rv)\r
-                               throw MsgException("MSG_task_send_with_timeout() failed");\r
-               } \r
-               \r
-               void Host::send(const char* alias, Task* task) \r
-               throw(InvalidArgumentException, MsgException) \r
-               {\r
-                       // check the parameters\r
-                       if(!alias)\r
-                               throw InvalidArgumentException("alias (must not be NULL)");\r
-                       \r
-                       if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias, -1.0))\r
-                               throw MsgException("MSG_task_send_with_timeout() failed");\r
-               }\r
-               \r
-               void Host::send(Task* task, double timeout) \r
-               throw(InvalidArgumentException, BadAllocException, MsgException) \r
-               {\r
-                       // check the parameters\r
-                       if(timeout < 0 && timeout != -1.0)\r
-                               throw InvalidArgumentException("timeout (must be positive or equal to zero or equal to -1.0)");\r
-                       \r
-                       MSG_error_t rv;\r
-                       \r
-                       char* alias = (char*)calloc(strlen(this->getName()) + strlen(Process::currentProcess().getName()) + 2, sizeof(char));\r
-                               \r
-                       if(!alias)\r
-                               throw BadAllocException("alias");\r
-                               \r
-                       sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName());\r
-                               \r
-                               \r
-                       rv = MSG_task_send_with_timeout(task->nativeTask, alias, timeout);\r
-                       \r
-                       free(alias);\r
-                       \r
-                       if(MSG_OK != rv)\r
-                               throw MsgException("MSG_task_send_with_timeout() failed");\r
-               }\r
-               \r
-               void Host::send(const char* alias, Task* task, double timeout) \r
-               throw(InvalidArgumentException, MsgException) \r
-               {\r
-                       // check the parameter\r
-                       \r
-                       if(!alias)\r
-                               throw InvalidArgumentException("alias (must not be NULL)");\r
-                               \r
-                       if(timeout < 0 && timeout != -1.0)\r
-                               throw InvalidArgumentException("timeout (must be positive or equal to zero or equal to -1.0)");\r
-                                       \r
-                       if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias, timeout))\r
-                               throw MsgException("MSG_task_send_with_timeout() failed");\r
-               }\r
-               \r
-               \r
-               void Host::sendBounded(Task* task, double maxRate) \r
-               throw(InvalidArgumentException, BadAllocException, MsgException) \r
-               {\r
-                       if(maxRate < 0 && maxRate != -1.0)\r
-                               throw InvalidArgumentException("maxRate (must be positive or equal to zero or equal to -1.0)");\r
-                       \r
-                       MSG_error_t rv;\r
-                       \r
-                       char* alias = (char*)calloc(strlen(this->getName()) + strlen(Process::currentProcess().getName()) + 2, sizeof(char));\r
-                       \r
-                       if(!alias)\r
-                               throw BadAllocException("alias");\r
-                               \r
-                       sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName());\r
-                               \r
-                       rv = MSG_task_send_bounded(task->nativeTask, alias, maxRate);\r
-                       \r
-                       free(alias);\r
-                       \r
-                       if(MSG_OK != rv)\r
-                               throw MsgException("MSG_task_send_bounded() failed");\r
-               }  \r
-               \r
-               void Host::sendBounded(const char* alias, Task* task, double maxRate) \r
-               throw(InvalidArgumentException, MsgException) \r
-               {\r
-                       // check the parameters\r
-                       if(!alias)\r
-                               throw InvalidArgumentException("alias (must not be NULL)");\r
-                       \r
-                       if(maxRate < 0 && maxRate != -1)\r
-                               throw InvalidArgumentException("maxRate (must be positive or equal to zero or equal to -1.0)");\r
-                       \r
-                       if(MSG_OK != MSG_task_send_bounded(task->nativeTask, alias, maxRate))\r
-                               throw MsgException("MSG_task_send_bounded() failed");\r
-                       \r
-               }\r
-       } // namspace Msg\r
-} // namespace SimGrid\r
-\r
+/*
+ * Host.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* Host class member functions implementation.
+  */ 
+
+#include <Task.hpp>
+#include <Process.hpp>
+
+#include <Host.hpp>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <msg/msg.h>
+#include <msg/private.h>
+
+#include <xbt/fifo.h>
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               Host::Host()
+               {
+                       nativeHost = NULL;
+                       data = NULL;
+               }
+               
+               Host::Host(const Host& rHost)
+               {
+                       this->nativeHost = rHost.nativeHost;
+                       this->data = rHost.getData();   
+               }
+               
+               Host::~Host()
+               {
+                       // NOTHING TODO
+               }
+               
+               
+               Host& Host::getByName(const char* hostName)
+               throw(HostNotFoundException, NullPointerException, BadAllocException)
+               {
+                       // check the parameters
+                       if(!hostName)
+                               throw NullPointerException("hostName");
+                               
+                       m_host_t nativeHost = NULL;     // native host.
+                       Host* host = NULL;                      // wrapper host.
+                       
+                       if(!(nativeHost = MSG_get_host_by_name(hostName))) 
+                               throw HostNotFoundException(hostName);
+                       
+                       if(!nativeHost->data) 
+                       { // native host not associated yet with  its wrapper
+                       
+                               // instanciate a new wrapper 
+                               if(!(host = new Host()))
+                                       throw BadAllocException(hostName);
+                               
+                               host->nativeHost = nativeHost; 
+                       
+                               // the native host data field is set with its wrapper returned 
+                               nativeHost->data = (void*)host;
+                       }
+                       
+                       // return the reference to cxx wrapper
+                       return *((Host*)nativeHost->data);                              
+               }
+               
+               int Host::getNumber(void)
+               {
+                       return MSG_get_host_number();
+               }
+               
+               Host& Host::currentHost(void)
+               {
+                       Host* host = NULL;
+                       m_host_t nativeHost = MSG_host_self();
+                       
+                       if(!nativeHost->data) 
+                       {
+                               // the native host not yet associated with its wrapper
+                       
+                               // instanciate a new wrapper
+                               host = new Host();
+                       
+                               host->nativeHost = nativeHost;
+                       
+                               nativeHost->data = (void*)host;
+                       } 
+                       else 
+                       {
+                               host = (Host*)nativeHost->data;
+                       }
+                       
+                       return *host;
+               }
+               
+               void Host::all(Host*** hosts, int* len) 
+               throw(InvalidArgumentException, BadAllocException) 
+               {
+                       // check the parameters
+                       if(!hosts)
+                               throw InvalidArgumentException("hosts");
+                               
+                       if(len < 0)
+                               throw InvalidArgumentException("len parameter must be positive");
+                       
+                       int count = xbt_fifo_size(msg_global->host);
+                       
+                       if(*len < count)
+                               throw InvalidArgumentException("len parameter must be more than the number of installed host\n (use Host::getNumber() to get the number of hosts)");
+                       
+                       int index;
+                       m_host_t nativeHost;
+                       Host* host;
+               
+                       m_host_t* table = (m_host_t *)xbt_fifo_to_array(msg_global->host);
+                       
+                       for(index = 0; index < count; index++) 
+                       {
+                               nativeHost = table[index];
+                               host = (Host*)(nativeHost->data);
+                       
+                               if(!host) 
+                               {
+                                       if(!(host = new Host()))
+                                       {
+                                               // release all allocated memory.
+                                               for(int i = 0; i < index; i++)
+                                                       delete (*(hosts)[i]);
+                                               
+                                               throw BadAllocException("to fill the table of the hosts installed on your platform");
+                                       }
+                                       
+                                       host->nativeHost = nativeHost;
+                                       nativeHost->data = (void*)host;
+                               }
+                               
+                               (*hosts)[index] = host;
+                 }
+               
+                 *len = count;  
+               }
+               
+               const char* Host::getName(void) const
+               {
+                       return nativeHost->name;
+               }
+               
+               void Host::setData(void* data)
+               {
+                       this->data = data;
+               }
+               
+               void* Host::getData(void) const
+               {
+                       return this->data;
+               }
+               
+               int Host::getRunningTaskNumber(void) const
+               {
+                       return MSG_get_host_msgload(nativeHost); 
+               }
+               
+               double Host::getSpeed(void) const
+               {
+                       return MSG_get_host_speed(nativeHost);
+               }
+               
+               bool Host::hasData(void) const
+               {
+                       return (NULL != this->data);
+               }
+               
+               int Host::isAvailable(void) const
+               {
+                       return SIMIX_host_get_state(nativeHost->simdata->smx_host);
+               }
+               
+               void Host::put(int channel, Task* task) 
+               throw(MsgException, InvalidArgumentException)
+               {
+                       // checks the parameters
+                       if(channel < 0)
+                               throw InvalidArgumentException("channel (must be more or equal to zero)");
+                               
+                       if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, nativeHost, channel , -1.0))
+                               throw MsgException("MSG_task_put_with_timeout() failed");
+               } 
+
+               void Host::put(int channel, Task* task, double timeout) 
+               throw(MsgException, InvalidArgumentException) 
+               {
+                       // checks the parameters
+                       if(channel < 0)
+                               throw InvalidArgumentException("channel (must be more or equal to zero)");
+                               
+                       if(timeout < 0.0 && timeout != -1.0)
+                               throw InvalidArgumentException("timeout (must be more or equal to zero or equal to -1.0)");     
+                               
+                               
+                   if(MSG_OK != MSG_task_put_with_timeout(task->nativeTask, nativeHost, channel , timeout))
+                               throw MsgException("MSG_task_put_with_timeout() failed");
+               }
+               
+               void Host::putBounded(int channel, Task* task, double maxRate) 
+               throw(MsgException, InvalidArgumentException)
+               {
+                   // checks the parameters
+                       if(channel < 0)
+                               throw InvalidArgumentException("channel (must be more or equal to zero)");
+                               
+                       if(maxRate < 0.0 && maxRate != -1.0)
+                               throw InvalidArgumentException("maxRate (must be more or equal to zero or equal to -1.0)");     
+                   
+                       if(MSG_OK != MSG_task_put_bounded(task->nativeTask, nativeHost, channel, maxRate))
+                               throw MsgException("MSG_task_put_bounded() failed");
+               }
+               
+               void Host::send(Task* task) 
+               throw(MsgException, BadAllocException)  
+               {       
+                       MSG_error_t rv;
+                       
+                       char* alias = (char*)calloc(strlen(this->getName())+ strlen(Process::currentProcess().getName()) + 2, sizeof(char));
+                               
+                       if(!alias)
+                               throw BadAllocException("alias");
+                               
+                       sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName());
+                               
+                       rv = MSG_task_send_with_timeout(task->nativeTask, alias, -1.0);
+                       
+                       free(alias);
+                       
+                       if(MSG_OK != rv)
+                               throw MsgException("MSG_task_send_with_timeout() failed");
+               } 
+               
+               void Host::send(const char* alias, Task* task) 
+               throw(InvalidArgumentException, MsgException) 
+               {
+                       // check the parameters
+                       if(!alias)
+                               throw InvalidArgumentException("alias (must not be NULL)");
+                       
+                       if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias, -1.0))
+                               throw MsgException("MSG_task_send_with_timeout() failed");
+               }
+               
+               void Host::send(Task* task, double timeout) 
+               throw(InvalidArgumentException, BadAllocException, MsgException) 
+               {
+                       // check the parameters
+                       if(timeout < 0 && timeout != -1.0)
+                               throw InvalidArgumentException("timeout (must be positive or equal to zero or equal to -1.0)");
+                       
+                       MSG_error_t rv;
+                       
+                       char* alias = (char*)calloc(strlen(this->getName()) + strlen(Process::currentProcess().getName()) + 2, sizeof(char));
+                               
+                       if(!alias)
+                               throw BadAllocException("alias");
+                               
+                       sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName());
+                               
+                               
+                       rv = MSG_task_send_with_timeout(task->nativeTask, alias, timeout);
+                       
+                       free(alias);
+                       
+                       if(MSG_OK != rv)
+                               throw MsgException("MSG_task_send_with_timeout() failed");
+               }
+               
+               void Host::send(const char* alias, Task* task, double timeout) 
+               throw(InvalidArgumentException, MsgException) 
+               {
+                       // check the parameter
+                       
+                       if(!alias)
+                               throw InvalidArgumentException("alias (must not be NULL)");
+                               
+                       if(timeout < 0 && timeout != -1.0)
+                               throw InvalidArgumentException("timeout (must be positive or equal to zero or equal to -1.0)");
+                                       
+                       if(MSG_OK != MSG_task_send_with_timeout(task->nativeTask, alias, timeout))
+                               throw MsgException("MSG_task_send_with_timeout() failed");
+               }
+               
+               
+               void Host::sendBounded(Task* task, double maxRate) 
+               throw(InvalidArgumentException, BadAllocException, MsgException) 
+               {
+                       if(maxRate < 0 && maxRate != -1.0)
+                               throw InvalidArgumentException("maxRate (must be positive or equal to zero or equal to -1.0)");
+                       
+                       MSG_error_t rv;
+                       
+                       char* alias = (char*)calloc(strlen(this->getName()) + strlen(Process::currentProcess().getName()) + 2, sizeof(char));
+                       
+                       if(!alias)
+                               throw BadAllocException("alias");
+                               
+                       sprintf(alias,"%s:%s", this->getName(),Process::currentProcess().getName());
+                               
+                       rv = MSG_task_send_bounded(task->nativeTask, alias, maxRate);
+                       
+                       free(alias);
+                       
+                       if(MSG_OK != rv)
+                               throw MsgException("MSG_task_send_bounded() failed");
+               }  
+               
+               void Host::sendBounded(const char* alias, Task* task, double maxRate) 
+               throw(InvalidArgumentException, MsgException) 
+               {
+                       // check the parameters
+                       if(!alias)
+                               throw InvalidArgumentException("alias (must not be NULL)");
+                       
+                       if(maxRate < 0 && maxRate != -1)
+                               throw InvalidArgumentException("maxRate (must be positive or equal to zero or equal to -1.0)");
+                       
+                       if(MSG_OK != MSG_task_send_bounded(task->nativeTask, alias, maxRate))
+                               throw MsgException("MSG_task_send_bounded() failed");
+                       
+               }
+       } // namspace Msg
+} // namespace SimGrid
+
index 0228097..c012513 100644 (file)
-/*\r
- * Host.hpp\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
-#ifndef MSG_HOST_HPP\r
-#define MSG_HOST_HPP\r
-\r
-\r
-/*! \brief Host class declaration.\r
- *\r
- * An host instance represents a location (any possible place) where a process may run. \r
- * Thus it is represented as a physical resource with computing capabilities, some \r
- * mailboxes to enable running process to communicate with remote ones, and some private \r
- * data that can be only accessed by local process. An instance of this class is always \r
- * binded with the corresponding native host. All the native hosts are automaticaly created \r
- * during the call of the static method Msg::createEnvironment(). This method takes as parameter\r
- * the platform file which describes all elements of the platform (host, link, root..).\r
- * You never need to create an host your self.\r
- *\r
- * The best way to get an host is to call the static method \r
- * Host.getByName() which returns a reference.\r
- *\r
- * For example to get the instance of the host. If your platform\r
- * file description contains an host named "Jacquelin" :\r
- *\r
- * \verbatim\r
-using namespace SimGrid.Msg;\r
-\r
-Host jacquelin;\r
-\r
-try \r
-{ \r
-       jacquelin = Host::getByName("Jacquelin");\r
-}\r
-catch(HostNotFoundException e) \r
-{\r
-       cerr << e.toString();\r
-}\r
-...\r
-\endverbatim\r
- *\r
- */\r
-\r
-#ifndef __cplusplus\r
-       #error Host.hpp requires C++ compilation (use a .cxx suffix)\r
-#endif\r
-\r
-#include <msg/datatypes.h>\r
-\r
-#include <InvalidArgumentException.hpp>\r
-#include <BadAllocException.hpp>\r
-#include <HostNotFoundException.hpp>\r
-#include <MsgException.hpp>\r
-#include <NullPointerException.hpp>\r
-\r
-\r
-\r
-// namespace SimGrid::Msg\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               class Task;\r
-               class Process;\r
-\r
-               // Declaration of the class SimGrid::Msg::Host.\r
-               class SIMGRIDX_EXPORT Host // final class.\r
-               {\r
-                       friend class Process;\r
-                       friend class Task;\r
-\r
-                       // Desable the default constructor.\r
-                       // The best way to get an host instance is to use the static method Host::getByName().\r
-                       \r
-                       public :\r
-                               \r
-                       // Default constructor (desabled).\r
-                               Host();\r
-                       \r
-                       public: \r
-                               \r
-                       // Copy constructor (desabled).\r
-                               Host(const Host& rHost);\r
-                               \r
-                       // Destructor (desable).\r
-                               virtual ~Host();\r
-                       \r
-                       // Operations\r
-                       \r
-                               /*! \brief Host::getByName() - returns an host by its name\r
-                                *\r
-                                * This static method returns a reference to the host instance associated \r
-                                * with a native host of your platform. This is the best way to get a host.\r
-                                *\r
-                                * \param hostName      The name of the host.\r
-                                *\r
-                                * \return                      If successful the method returns a reference to the instance\r
-                                *                                      associated with the native host having the name specified\r
-                                *                                      as parameter of your platform. Otherwise the method throws\r
-                                *                                      one of the exceptions detailed below.\r
-                                *\r
-                                * \exception           [HostNotFoundException]         if no host with the specified name\r
-                                *                                                                                              was found.\r
-                                *                                      [InvalidArgumentException]      if the hostName parameter is invalid (NULL).\r
-                                *                                      [BadAllocException]                     if there is not enough memory to allocate the host.\r
-                                */ \r
-                               static Host& getByName(const char* hostName)\r
-                               throw(HostNotFoundException, NullPointerException, BadAllocException);\r
-                               \r
-                               /*! \brief Host::getNumber() - returns the number of the installed hosts.\r
-                                *\r
-                                * \return                      The number of hosts installed.\r
-                                */\r
-                               static int getNumber(void);\r
-                               \r
-                               \r
-                               /*! \brief Host::currentHost() - This static method returns the location on which the current \r
-                                * process is executed.\r
-                                *\r
-                                * \return                      The host of the current process.\r
-                                *\r
-                                * \see                         Process::currentProcess().\r
-                                */\r
-                               static Host& currentHost(void);\r
-                               \r
-                               /*! \brief Host::all() - This static method retrieves all of the hosts of the installed platform.\r
-                                *\r
-                                * \param hosts         A pointer to array of Host pointers that receives all the hosts of the platform.\r
-                                *\r
-                                * \param len           A pointer to the length of the table of pointers.\r
-                                *\r
-                                * \return                      If successful the hosts table is filled and\r
-                                *                                      the parameter len is set with the number of hosts of the platform.\r
-                                *                                      Otherwise the method throw one of the exception described below.\r
-                                *\r
-                                * \exception           [InvalidArgumentException]      if the parameter hosts is invalid or\r
-                                *                                                                                              if the parameter len is negative or\r
-                                *                                                                                              less than the number of hosts installed\r
-                                *                                                                                              on the current platform.\r
-                                *                                      [BadAllocException]                     If the method can't allocate memory to fill\r
-                                *                                                                                              the table of hosts.\r
-                                *\r
-                                *\r
-                                * \remark                      To get the number of hosts installed on your platform use the static method\r
-                                *                                      Host::getNumber().\r
-                                *\r
-                                * \see                         Host::getNumber().\r
-                                *\r
-                                *\verbatim\r
-                                * // This example show how to use this method to get the list of hosts installed on your platform.\r
-                                *\r
-                                *      using namespace SimGrid::Msg;\r
-                                *      using <iostream>\r
-                                *\r
-                                *      // (1) get the number of hosts.\r
-                                *      int number = Host::getNumber();\r
-                                *      \r
-                                *      // (2) allocate the array that receives the list of hosts.\r
-                                *      HostPtr* ar = new HostPtr[number];      // HostPtr is defined as (typedef Host* HostPtr at the end of the\r
-                                *                                                                              // declaration of this class.\r
-                                *\r
-                                *      // (3) call the method\r
-                                *      try\r
-                                *      {\r
-                                *              Host::all(&ar, &number);\r
-                                *      }\r
-                                *      catch(BadAllocException e)\r
-                                *      {\r
-                                *              cerr << e.toString() << endl;\r
-                                *              ...\r
-                                *      }\r
-                                *      catch(InvalidArgumentException e)\r
-                                *      {\r
-                                *              cerr << e.toString() << endl;\r
-                                *              ..\r
-                                *      } \r
-                                *\r
-                                *      // (4) use the table of host (for example print all the name of all the hosts);\r
-                                *      \r
-                                *      for(int i = 0; i < number ; i++)\r
-                                *              cout << ar[i]->getName() << endl;\r
-                                *\r
-                                *      ...\r
-                                *              \r
-                                *      // (5) release the allocate table\r
-                                *      \r
-                                *      delete[] ar;\r
-                                *\r
-                                */ \r
-                               static void all(Host*** hosts /*in|out*/, int* len /*in|out*/)\r
-                               throw(InvalidArgumentException, BadAllocException) ;\r
-                               \r
-                               /*! \brief Host::getName() - This method return the name of the Msg host object.\r
-                                *\r
-                                * \return                      The name of the host object.\r
-                                */\r
-                               const char* getName(void) const;\r
-                               \r
-                               /*! \brief Host::setData() - Set the user data of an host object.\r
-                                *\r
-                                * \param data          The user data to set.\r
-                                */\r
-                               void setData(void* data);\r
-                               \r
-                               /*! \brief Host::getData() - Get the user data of a host object.\r
-                                *\r
-                                * \return                      The user data of the host object.\r
-                                */\r
-                               void* getData(void) const;\r
-                               \r
-                               /*! \brief Host::hasData() - Test if an host object has some data.\r
-                                *\r
-                                * \return                      This method returns true if the host object has some user data.\r
-                                *                                      Otherwise the method returns false.\r
-                                */\r
-                               bool hasData(void) const;\r
-                               \r
-                               /*! \brief Host::getRunningTaskNumber() - returns the number of tasks currently running on a host.\r
-                                *\r
-                                * \return                      The number of task currently running of the host object.\r
-                                *\r
-                                * \remark                      The external load is not taken in account.\r
-                                */\r
-                               int getRunningTaskNumber(void) const;\r
-                               \r
-                               /*! \brief Host::getSpeed() - returns the speed of the processor of a host,\r
-                                * regardless of the current load of the machine.\r
-                                *\r
-                                * \return                      The speed of the processor of the host in flops.\r
-                                */ \r
-                               double getSpeed(void) const;\r
-                               \r
-                               /*! \brief Host::isAvailable - tests if an host is availabled.\r
-                                * \r
-                                * \return                      Is the host is availabled the method returns\r
-                                *                                      1. Otherwise the method returns 0.\r
-                                */ \r
-                               int isAvailable(void) const;\r
-                               \r
-                               /* ! \brief Host::put() - put a task on the given channel of a host .\r
-                                *\r
-                                * \param channel       The channel where to put the task.\r
-                                * \param rTask         A refercence to the task object containing the native task to\r
-                                *                                      put on the channel specified by the parameter channel.\r
-                                *\r
-                                * \return                      If successful the task is puted on the specified channel. Otherwise\r
-                                *                                      the method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [MsgException]                          if an internal error occurs.\r
-                                *                                      [InvalidArgumentException]      if the value of the channel specified as\r
-                                *                                                                                              parameter is negative.\r
-                                */\r
-                               void put(int channel, Task* task) \r
-                               throw(MsgException, InvalidArgumentException);\r
-                               \r
-                               /* ! \brief Host::put() - put a task on the given channel of a host object (waiting at most timeout seconds).\r
-                                *\r
-                                * \param channel       The channel where to put the task.\r
-                                * \param rTask         A refercence to the task object containing the native task to\r
-                                *                                      put on the channel specified by the parameter channel.\r
-                                * \param timeout       The timeout in seconds.\r
-                                *\r
-                                * \return                      If successful the task is puted on the specified channel. Otherwise\r
-                                *                                      the method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [MsgException]                          if an internal error occurs.\r
-                                *                                      [InvalidArgumentException]      if the value of the channel specified as\r
-                                *                                                                                              parameter is negative or if the timeout value\r
-                                *                                                                                              is less than zero and diffĂ©rent of -1.\r
-                                *\r
-                                * \remark                      To specify no timeout set the timeout value with -1.0.\r
-                                */\r
-                               void put(int channel, Task* task, double timeout) \r
-                               throw(MsgException, InvalidArgumentException);\r
-                               \r
-                               /* ! \brief Host::putBounded() - put a task on the given channel of a host object (capping the emission rate to maxrate).\r
-                                *\r
-                                * \param channel       The channel where to put the task.\r
-                                * \param rTask         A refercence to the task object containing the native task to\r
-                                *                                      put on the channel specified by the parameter channel.\r
-                                * \param maxRate       The maximum rate.\r
-                                *\r
-                                * \return                      If successful the task is puted on the specified channel. Otherwise\r
-                                *                                      the method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [MsgException]                          if an internal error occurs.\r
-                                *                                      [InvalidArgumentException]      if the value of the channel specified as\r
-                                *                                                                                              parameter is negative or if the maxRate parameter value\r
-                                *                                                                                              is less than zero and diffĂ©rent of -1.0.\r
-                                *\r
-                                * \remark                      To specify no rate set the maxRate parameter value with -1.0.\r
-                                */\r
-                               void putBounded(int channel, Task* task, double maxRate) \r
-                               throw(MsgException, InvalidArgumentException);\r
-                               \r
-                               /* ! brief Host::send() - sends the given task to mailbox identified by the default alias.\r
-                                *\r
-                                * \param rTask         A reference to the task object containing the native msg task to send.\r
-                                *\r
-                                * \return                      If successful the task is sended to the default mailbox. Otherwise the\r
-                                *                                      method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [BadAllocException]                     if there is not enough memory to allocate\r
-                                *                                                                                              the default alias variable.\r
-                                *                                      [MsgException]                          if an internal error occurs.\r
-                                */\r
-                               void send(Task* task) \r
-                               throw(MsgException, BadAllocException);\r
-                               \r
-                               /* ! brief Host::send() - sends the given task to mailbox identified by the specified alias parameter.\r
-                                *\r
-                                * \param rTask         A reference to the task object containing the native msg task to send.\r
-                                * \param alias         The alias of the mailbox where to send the task.\r
-                                *\r
-                                * \return                      If successful the task is sended to the default mailbox. Otherwise the\r
-                                *                                      method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [InvalidArgumentException]      if alias parameter is invalid (NULL).\r
-                                *                                      [BadAllocException]                     if there is not enough memory to allocate\r
-                                *                                                                                              the default alias variable.\r
-                                *                                      [MsgException]                          if an internal error occurs.\r
-                                */\r
-                               void send(const char* alias, Task* task) \r
-                               throw(InvalidArgumentException, MsgException);\r
-                               \r
-                               /* ! brief Host::send() - sends the given task to mailbox identified by the default alias\r
-                                *  (waiting at most timeout seconds).\r
-                                *\r
-                                * \param rTask         A reference to the task object containing the native msg task to send.\r
-                                * \param timeout       The timeout value to wait for.\r
-                                *\r
-                                * \return                      If successful the task is sended to the default mailbox. Otherwise the\r
-                                *                                      method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [BadAllocException]                     if there is not enough memory to allocate\r
-                                *                                                                                              the default alias variable.\r
-                                *                                      [InvalidArgumentException]      if the timeout value is negative and different of\r
-                                *                                                                                              -1.0.                   \r
-                                *                                      [MsgException]                          if an internal error occurs.\r
-                                *\r
-                                * \remark                      To specify no timeout set the timeout value with -1.0 or use the previous \r
-                                *                                      version of this method.\r
-                                *\r
-                                */\r
-                               void send(Task* task, double timeout) \r
-                               throw(InvalidArgumentException, BadAllocException, MsgException);\r
-                               \r
-                               /* ! brief Host::send() - sends the given task to mailbox identified by the parameter alias\r
-                                *  (waiting at most timeout seconds).\r
-                                *\r
-                                * \param alias         The alias of the mailbox to send the task.\r
-                                * \param rTask         A reference to the task object containing the native msg task to send.\r
-                                * \param timeout       The timeout value to wait for.\r
-                                *\r
-                                * \return                      If successful the task is sended to the default mailbox. Otherwise the\r
-                                *                                      method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [InvalidArgumentException]      if the timeout value is negative and different of\r
-                                *                                                                                              -1.0 or if the alias parameter is invalid (NULL).                       \r
-                                *                                      [MsgException]                          if an internal error occurs.\r
-                                *\r
-                                * \remark                      To specify no timeout set the timeout value with -1.0 or use the previous \r
-                                *                                      version of this method.\r
-                                *\r
-                                */\r
-                               void send(const char* alias, Task* task, double timeout) \r
-                               throw(InvalidArgumentException, MsgException);\r
-                               \r
-                               /* ! brief Host::sendBounded() - sends the given task to mailbox associated to the default alias\r
-                                *  (capping the emission rate to maxRate).\r
-                                *\r
-                                * \param rTask         A reference to the task object containing the native msg task to send.\r
-                                * \param maxRate       The maximum rate value.\r
-                                *\r
-                                * \return                      If successful the task is sended to the default mailbox. Otherwise the\r
-                                *                                      method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [InvalidArgumentException]      if the maximum rate value is negative and different of\r
-                                *                                                                                              -1.0.                   \r
-                                *                                      [MsgException]                          if an internal error occurs.\r
-                                *                                      [BadAllocException]                     if there is not enough memory to allocate\r
-                                *                                                                                              the default alias variable.\r
-                                *\r
-                                * \remark                      To specify no rate set its value with -1.0.\r
-                                *\r
-                                */\r
-                               void sendBounded(Task* task, double maxRate) \r
-                               throw(InvalidArgumentException, BadAllocException, MsgException);\r
-                               \r
-                               /* ! brief Host::sendBounded() - sends the given task to mailbox identified by the parameter alias\r
-                                *  (capping the emission rate to maxRate).\r
-                                *\r
-                                * \param alias         The alias of the mailbox where to send the task.\r
-                                * \param rTask         A reference to the task object containing the native msg task to send.\r
-                                * \param maxRate       The maximum rate value.\r
-                                *\r
-                                * \return                      If successful the task is sended to the default mailbox. Otherwise the\r
-                                *                                      method throws one of the exceptions described below.\r
-                                *\r
-                                * \exception           [InvalidArgumentException]      if the maximum rate value is negative and different of\r
-                                *                                                                                              -1.0 or if the alias parameter is invalid (NULL).                       \r
-                                *                                      [MsgException]                          if an internal error occurs.\r
-                                *\r
-                                * \remark                      To specify no rate set its value with -1.0.\r
-                                *\r
-                                */\r
-                               void sendBounded(const char* alias, Task* task, double maxRate) \r
-                               throw(InvalidArgumentException, MsgException);\r
-                       \r
-                       protected:\r
-                       // Attributes.\r
-                       \r
-                               /**\r
-                                * This attribute represents the msg native host object. \r
-                                * It is set automaticatly during the call of the static \r
-                                * method Host::getByName().\r
-                                *\r
-                                * \see                         Host::getByName().\r
-                                */ \r
-                               m_host_t nativeHost;\r
-                       \r
-                       private:\r
-                               /**\r
-                                * User host data. \r
-                                */ \r
-                               void* data;\r
-               };\r
-               \r
-               typedef Host* HostPtr;\r
-       } // namespace Msg\r
-} // namespace SimGrid\r
-\r
-#endif // !MSG_HOST_HPP\r
+/*
+ * Host.hpp
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */  
+#ifndef MSG_HOST_HPP
+#define MSG_HOST_HPP
+
+
+/*! \brief Host class declaration.
+ *
+ * An host instance represents a location (any possible place) where a process may run. 
+ * Thus it is represented as a physical resource with computing capabilities, some 
+ * mailboxes to enable running process to communicate with remote ones, and some private 
+ * data that can be only accessed by local process. An instance of this class is always 
+ * binded with the corresponding native host. All the native hosts are automaticaly created 
+ * during the call of the static method Msg::createEnvironment(). This method takes as parameter
+ * the platform file which describes all elements of the platform (host, link, root..).
+ * You never need to create an host your self.
+ *
+ * The best way to get an host is to call the static method 
+ * Host.getByName() which returns a reference.
+ *
+ * For example to get the instance of the host. If your platform
+ * file description contains an host named "Jacquelin" :
+ *
+ * \verbatim
+using namespace SimGrid.Msg;
+
+Host jacquelin;
+
+try 
+{ 
+       jacquelin = Host::getByName("Jacquelin");
+}
+catch(HostNotFoundException e) 
+{
+       cerr << e.toString();
+}
+...
+\endverbatim
+ *
+ */
+
+#ifndef __cplusplus
+       #error Host.hpp requires C++ compilation (use a .cxx suffix)
+#endif
+
+#include <msg/datatypes.h>
+
+#include <InvalidArgumentException.hpp>
+#include <BadAllocException.hpp>
+#include <HostNotFoundException.hpp>
+#include <MsgException.hpp>
+#include <NullPointerException.hpp>
+
+
+
+// namespace SimGrid::Msg
+namespace SimGrid
+{
+       namespace Msg
+       {
+               class Task;
+               class Process;
+
+               // Declaration of the class SimGrid::Msg::Host.
+               class SIMGRIDX_EXPORT Host // final class.
+               {
+                       friend class Process;
+                       friend class Task;
+
+                       // Desable the default constructor.
+                       // The best way to get an host instance is to use the static method Host::getByName().
+                       
+                       public :
+                               
+                       // Default constructor (desabled).
+                               Host();
+                       
+                       public: 
+                               
+                       // Copy constructor (desabled).
+                               Host(const Host& rHost);
+                               
+                       // Destructor (desable).
+                               virtual ~Host();
+                       
+                       // Operations
+                       
+                               /*! \brief Host::getByName() - returns an host by its name
+                                *
+                                * This static method returns a reference to the host instance associated 
+                                * with a native host of your platform. This is the best way to get a host.
+                                *
+                                * \param hostName      The name of the host.
+                                *
+                                * \return                      If successful the method returns a reference to the instance
+                                *                                      associated with the native host having the name specified
+                                *                                      as parameter of your platform. Otherwise the method throws
+                                *                                      one of the exceptions detailed below.
+                                *
+                                * \exception           [HostNotFoundException]         if no host with the specified name
+                                *                                                                                              was found.
+                                *                                      [InvalidArgumentException]      if the hostName parameter is invalid (NULL).
+                                *                                      [BadAllocException]                     if there is not enough memory to allocate the host.
+                                */ 
+                               static Host& getByName(const char* hostName)
+                               throw(HostNotFoundException, NullPointerException, BadAllocException);
+                               
+                               /*! \brief Host::getNumber() - returns the number of the installed hosts.
+                                *
+                                * \return                      The number of hosts installed.
+                                */
+                               static int getNumber(void);
+                               
+                               
+                               /*! \brief Host::currentHost() - This static method returns the location on which the current 
+                                * process is executed.
+                                *
+                                * \return                      The host of the current process.
+                                *
+                                * \see                         Process::currentProcess().
+                                */
+                               static Host& currentHost(void);
+                               
+                               /*! \brief Host::all() - This static method retrieves all of the hosts of the installed platform.
+                                *
+                                * \param hosts         A pointer to array of Host pointers that receives all the hosts of the platform.
+                                *
+                                * \param len           A pointer to the length of the table of pointers.
+                                *
+                                * \return                      If successful the hosts table is filled and
+                                *                                      the parameter len is set with the number of hosts of the platform.
+                                *                                      Otherwise the method throw one of the exception described below.
+                                *
+                                * \exception           [InvalidArgumentException]      if the parameter hosts is invalid or
+                                *                                                                                              if the parameter len is negative or
+                                *                                                                                              less than the number of hosts installed
+                                *                                                                                              on the current platform.
+                                *                                      [BadAllocException]                     If the method can't allocate memory to fill
+                                *                                                                                              the table of hosts.
+                                *
+                                *
+                                * \remark                      To get the number of hosts installed on your platform use the static method
+                                *                                      Host::getNumber().
+                                *
+                                * \see                         Host::getNumber().
+                                *
+                                *\verbatim
+                                * // This example show how to use this method to get the list of hosts installed on your platform.
+                                *
+                                *      using namespace SimGrid::Msg;
+                                *      using <iostream>
+                                *
+                                *      // (1) get the number of hosts.
+                                *      int number = Host::getNumber();
+                                *      
+                                *      // (2) allocate the array that receives the list of hosts.
+                                *      HostPtr* ar = new HostPtr[number];      // HostPtr is defined as (typedef Host* HostPtr at the end of the
+                                *                                                                              // declaration of this class.
+                                *
+                                *      // (3) call the method
+                                *      try
+                                *      {
+                                *              Host::all(&ar, &number);
+                                *      }
+                                *      catch(BadAllocException e)
+                                *      {
+                                *              cerr << e.toString() << endl;
+                                *              ...
+                                *      }
+                                *      catch(InvalidArgumentException e)
+                                *      {
+                                *              cerr << e.toString() << endl;
+                                *              ..
+                                *      } 
+                                *
+                                *      // (4) use the table of host (for example print all the name of all the hosts);
+                                *      
+                                *      for(int i = 0; i < number ; i++)
+                                *              cout << ar[i]->getName() << endl;
+                                *
+                                *      ...
+                                *              
+                                *      // (5) release the allocate table
+                                *      
+                                *      delete[] ar;
+                                *
+                                */ 
+                               static void all(Host*** hosts /*in|out*/, int* len /*in|out*/)
+                               throw(InvalidArgumentException, BadAllocException) ;
+                               
+                               /*! \brief Host::getName() - This method return the name of the Msg host object.
+                                *
+                                * \return                      The name of the host object.
+                                */
+                               const char* getName(void) const;
+                               
+                               /*! \brief Host::setData() - Set the user data of an host object.
+                                *
+                                * \param data          The user data to set.
+                                */
+                               void setData(void* data);
+                               
+                               /*! \brief Host::getData() - Get the user data of a host object.
+                                *
+                                * \return                      The user data of the host object.
+                                */
+                               void* getData(void) const;
+                               
+                               /*! \brief Host::hasData() - Test if an host object has some data.
+                                *
+                                * \return                      This method returns true if the host object has some user data.
+                                *                                      Otherwise the method returns false.
+                                */
+                               bool hasData(void) const;
+                               
+                               /*! \brief Host::getRunningTaskNumber() - returns the number of tasks currently running on a host.
+                                *
+                                * \return                      The number of task currently running of the host object.
+                                *
+                                * \remark                      The external load is not taken in account.
+                                */
+                               int getRunningTaskNumber(void) const;
+                               
+                               /*! \brief Host::getSpeed() - returns the speed of the processor of a host,
+                                * regardless of the current load of the machine.
+                                *
+                                * \return                      The speed of the processor of the host in flops.
+                                */ 
+                               double getSpeed(void) const;
+                               
+                               /*! \brief Host::isAvailable - tests if an host is availabled.
+                                * 
+                                * \return                      Is the host is availabled the method returns
+                                *                                      1. Otherwise the method returns 0.
+                                */ 
+                               int isAvailable(void) const;
+                               
+                               /* ! \brief Host::put() - put a task on the given channel of a host .
+                                *
+                                * \param channel       The channel where to put the task.
+                                * \param rTask         A refercence to the task object containing the native task to
+                                *                                      put on the channel specified by the parameter channel.
+                                *
+                                * \return                      If successful the task is puted on the specified channel. Otherwise
+                                *                                      the method throws one of the exceptions described below.
+                                *
+                                * \exception           [MsgException]                          if an internal error occurs.
+                                *                                      [InvalidArgumentException]      if the value of the channel specified as
+                                *                                                                                              parameter is negative.
+                                */
+                               void put(int channel, Task* task) 
+                               throw(MsgException, InvalidArgumentException);
+                               
+                               /* ! \brief Host::put() - put a task on the given channel of a host object (waiting at most timeout seconds).
+                                *
+                                * \param channel       The channel where to put the task.
+                                * \param rTask         A refercence to the task object containing the native task to
+                                *                                      put on the channel specified by the parameter channel.
+                                * \param timeout       The timeout in seconds.
+                                *
+                                * \return                      If successful the task is puted on the specified channel. Otherwise
+                                *                                      the method throws one of the exceptions described below.
+                                *
+                                * \exception           [MsgException]                          if an internal error occurs.
+                                *                                      [InvalidArgumentException]      if the value of the channel specified as
+                                *                                                                                              parameter is negative or if the timeout value
+                           &nb