version 0.3.29
[fms.git] / include / fmsapp.h
1 #ifndef _fmsapp_\r
2 #define _fmsapp_\r
3 \r
4 #include "threadwrapper/threadedexecutor.h"\r
5 #include "ithreaddatabase.h"\r
6 \r
7 #include <Poco/Util/ServerApplication.h>\r
8 \r
9 #include <map>\r
10 \r
11 // main FMS application class\r
12 class FMSApp:public Poco::Util::ServerApplication,public IThreadDatabase\r
13 {\r
14 public:\r
15         FMSApp();\r
16 \r
17         static void Terminate() { ((FMSApp *)&FMSApp::instance())->terminate(); }\r
18 \r
19 private:\r
20         void initialize(Poco::Util::Application &self);\r
21         void initializeLogger();\r
22         void defineOptions(Poco::Util::OptionSet &options);\r
23         int main(const std::vector<std::string> &args);\r
24 \r
25         void StartThreads();\r
26 \r
27         void handleHelp(const std::string &name, const std::string &value);\r
28         void displayHelp();\r
29         void handleLogOption(const std::string &name, const std::string &value);\r
30         void handleShowOptions(const std::string &name, const std::string &value);\r
31         void showOptions();\r
32         void handleSetOption(const std::string &name, const std::string &value);\r
33         void setOptions();\r
34 \r
35         bool m_displayhelp;\r
36         bool m_showoptions;\r
37         bool m_setoption;\r
38         std::map<std::string,std::string> m_setoptions;\r
39         std::string m_logtype;\r
40         std::string m_workingdirectory;\r
41 \r
42         ThreadedExecutor m_threads;\r
43 \r
44 };\r
45 \r
46 #endif  // _fmsapp_\r