Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The default alias name is now build from the name of the host of the process and...
[simgrid.git] / src / cxx / ApplicationHandler.hpp
index 37e5bf1..df91691 100644 (file)
@@ -20,6 +20,8 @@
        #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
@@ -28,26 +30,15 @@ namespace SimGrid
 {\r
        namespace Msg\r
        {\r
+               class Process;\r
+\r
                // Declaration of the class ApplicationHandler (Singleton).\r
-               class ApplicationHandler\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
@@ -66,32 +57,51 @@ 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
-                       throw (ClassNotFoundException, HostNotFoundException); \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
@@ -122,4 +132,4 @@ namespace SimGrid
 } // namespace SimGrid\r
 \r
 #endif // !MSG_APPLICATION_HANDLER_HPP\r
-       
\ No newline at end of file
+\r