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
17 public bool operator(const string& first, const string& second)
\r
19 return first.compare(second);
\r
23 typedef vector<string> Strings;
\r
25 typedef map<string, string, Compare> Properties;
\r
28 class ApplicationHandler
\r
31 // Default constructor.
\r
32 ApplicationHandler();
\r
34 // Copy constructor.
\r
35 ApplicationHandler(const ApplicationHandler& rApplicationHandler);
\r
38 virtual ~ApplicationHandler();
\r
40 class ProcessFactory
\r
45 Properties* properties;
\r
55 this->args = new Strings();
\r
56 this->properties = new Properties();
\r
57 this->hostName = NULL;
\r
58 this->function = NULL;
\r
61 void setProcessIdentity(const string& hostName, const string& function);
\r
63 void registerProcessArg(const string& arg)
\r
65 this->args->push_back(arg);
\r
68 void setProperty(const string& id, const string& value)
\r
70 this->properties->insert(Properties::value_type(id,value));
\r
73 const String& getHostName(void)
\r
75 return this->hostName;
\r
78 void createProcess(void);
\r
82 static ProcessFactory* processFactory;
\r
86 static void onStartDocument(void);
\r
88 static void onEndDocument(void);
\r
90 static void onBeginProcess(void);
\r
92 static void onProcessArg(void);
\r
94 static void OnProperty(void);
\r
96 static void onEndProcess(void);
\r
101 #endif // !MSG_APPLICATION_HANDLER_HPP
\r