1 #ifndef MSG_APPLICATION_HANDLER_HPP
\r
2 #define MSG_APPLICATION_HANDLER_HPP
\r
4 // Compilation C++ recquise
\r
6 #error ApplicationHandler.hpp requires C++ compilation (use a .cxx suffix)
\r
14 // Declaration of the class ApplicationHandler.
\r
15 class ApplicationHandler
\r
19 // Desable the default constructor, the copy constructor , the assignement operator
\r
20 // and the destructor of this class. Assume that this class is static.
\r
22 // Default constructor.
\r
23 ApplicationHandler();
\r
25 // Copy constructor.
\r
26 ApplicationHandler(const ApplicationHandler& rApplicationHandler);
\r
29 virtual ~ApplicationHandler();
\r
31 // Assignement operator.
\r
32 const ApplicationHandler& operator = (const ApplicationHandler& rApplicationHandler);
\r
34 class ProcessFactory
\r
38 // the list of the argument of the process to create.
\r
40 // the properties of the process to create
\r
41 xbt_dict_t properties;
\r
45 // the current host name parsed
\r
46 const char* hostName;
\r
47 // the name of the class of the process
\r
48 const char* function;
\r
52 // Default constructor.
\r
55 // Copy constructor.
\r
56 ProcessFactory(const ProcessFactory& rProcessFactory);
\r
59 virtual ~ProcessFactory();
\r
61 // Set the identity of the current process.
\r
62 void setProcessIdentity(const char* hostName, const char* function);
\r
64 // Register an argument of the current process.
\r
65 void registerProcessArg(const char* arg);
\r
67 // Set the property of the current process.
\r
68 void setProperty(const char* id, const char* value);
\r
70 // Return the host name of the current process.
\r
71 const const char* getHostName(void);
\r
73 // Create the current process.
\r
74 void createProcess(void);
\r
78 // the process factory used by the application handler.
\r
79 static ProcessFactory* processFactory;
\r
83 // Handle the begining of the parsing of the xml file describing the application.
\r
84 static void onStartDocument(void);
\r
86 // Handle at the end of the parsing.
\r
87 static void onEndDocument(void);
\r
89 // Handle the begining of the parsing of a xml process element.
\r
90 static void onBeginProcess(void);
\r
92 // Handle the parsing of an argument of the current xml process element.
\r
93 static void onProcessArg(void);
\r
95 // Handle the parsing of a property of the currnet xml process element.
\r
96 static void OnProperty(void);
\r
98 // Handle the end of the parsing of a xml process element
\r
99 static void onEndProcess(void);
\r
103 } // namespace SimGrid
\r
105 #endif // !MSG_APPLICATION_HANDLER_HPP
\r