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