version 0.1.9
[fms.git] / include / threadcontroller.h
diff --git a/include/threadcontroller.h b/include/threadcontroller.h
new file mode 100644 (file)
index 0000000..d1190c8
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef _threadcontroller_\r
+#define _threadcontroller_\r
+\r
+#include "pthreadwrapper/thread.h"\r
+#include "pthreadwrapper/singleton.h"\r
+\r
+class ThreadController:public PThread::Singleton<ThreadController>\r
+{\r
+public:\r
+       ThreadController():m_freenetthread(NULL),m_httpthread(NULL),m_nntpthread(NULL)          {}\r
+       ~ThreadController();\r
+\r
+       void StartThreads();\r
+       void ShutdownThreads();\r
+       void RestartThreads();\r
+\r
+       void StartFreenetThread();\r
+       void StartHTTPThread();\r
+       void StartNNTPThread();\r
+\r
+       void ShutdownFreenetThread();\r
+       void ShutdownHTTPThread();\r
+       void ShutdownNNTPThread();\r
+\r
+private:\r
+       void ReadConfig();\r
+\r
+       bool m_startfreenet;\r
+       bool m_starthttp;\r
+       bool m_startnntp;\r
+\r
+       PThread::Thread *m_freenetthread;\r
+       PThread::Thread *m_httpthread;\r
+       PThread::Thread *m_nntpthread;\r
+\r
+};\r
+\r
+#endif // _threadcontroller_\r