-/*\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
+