Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use pointers instead references.
[simgrid.git] / src / cxx / ApplicationHandler.hpp
index c33cc76..df91691 100644 (file)
@@ -1,3 +1,17 @@
+/*\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
        #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
-               // Declaration of the class ApplicationHandler.\r
-               class ApplicationHandler\r
+               class Process;\r
+\r
+               // Declaration of the class ApplicationHandler (Singleton).\r
+               class SIMGRIDX_EXPORT ApplicationHandler\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
+                       //friend Process;\r
+\r
+               public:\r
+\r
                        class ProcessFactory \r
                        {\r
                                public:\r
@@ -49,35 +57,56 @@ namespace SimGrid
                        \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 const char* getHostName(void);\r
-                               \r
-                               // Create the current process.\r
-                       void createProcess(void); \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
@@ -103,4 +132,4 @@ namespace SimGrid
 } // namespace SimGrid\r
 \r
 #endif // !MSG_APPLICATION_HANDLER_HPP\r
-       
\ No newline at end of file
+\r