version 0.1.10
[fms.git] / include / threadcontroller.h
1 #ifndef _threadcontroller_\r
2 #define _threadcontroller_\r
3 \r
4 #include "ilogger.h"\r
5 #include "pthreadwrapper/thread.h"\r
6 #include "pthreadwrapper/singleton.h"\r
7 \r
8 class ThreadController:public PThread::Singleton<ThreadController>,public ILogger\r
9 {\r
10 public:\r
11         ThreadController():m_freenetthread(NULL),m_httpthread(NULL),m_nntpthread(NULL)          {}\r
12         ~ThreadController();\r
13 \r
14         void StartThreads();\r
15         void ShutdownThreads();\r
16         void RestartThreads();\r
17 \r
18         void StartFreenetThread();\r
19         void StartHTTPThread();\r
20         void StartNNTPThread();\r
21 \r
22         void ShutdownFreenetThread();\r
23         void ShutdownHTTPThread();\r
24         void ShutdownNNTPThread();\r
25 \r
26 private:\r
27         void ReadConfig();\r
28 \r
29         bool m_startfreenet;\r
30         bool m_starthttp;\r
31         bool m_startnntp;\r
32 \r
33         PThread::Thread *m_freenetthread;\r
34         PThread::Thread *m_httpthread;\r
35         PThread::Thread *m_nntpthread;\r
36 \r
37 };\r
38 \r
39 #endif  // _threadcontroller_\r