version 0.1.9
[fms.git] / include / pthreadwrapper / threadedexecutor.h
1 #ifndef _pthread_threadedexecutor_\r
2 #define _pthread_threadedexecutor_\r
3 \r
4 #include "noncopyable.h"\r
5 #include "runnable.h"\r
6 #include <vector>\r
7 \r
8 namespace PThread\r
9 {\r
10 \r
11 class ThreadedExecutor:public NonCopyable\r
12 {\r
13 public:\r
14         ThreadedExecutor()              {}\r
15         ~ThreadedExecutor();\r
16 \r
17         void Execute(Runnable *runnable);\r
18         \r
19         void Join();\r
20         void Cancel();\r
21 \r
22 private:\r
23         void CleanupFinished();\r
24         \r
25         std::vector<Thread *> m_threads;\r
26 };\r
27 \r
28 }\r
29 \r
30 #endif  // _pthread_threadedexecutor_\r