1 #ifndef BLUB_CORE_DISPATCHER_HPP
2 #define BLUB_CORE_DISPATCHER_HPP
4 #include "blub/async/predecl.hpp"
5 #include "blub/core/list.hpp"
6 #include "blub/core/noncopyable.hpp"
7 #include "blub/core/scopedPtr.hpp"
8 #include "blub/core/string.hpp"
32 typedef std::function<void ()> t_toCallFunction;
34 dispatcher(
const uint16& numThreads = 0,
const bool& endThreadsAfterAllDone =
true,
const string& threadName =
"");
43 void dispatch(
const t_toCallFunction &handler);
44 void post(
const t_toCallFunction &handler);
51 int32 getThreadCount(
void);
53 boost::asio::io_service* _getIoService(
void);
56 void nameThread(
const int32 &indThread);
59 void runThread(
const int32& indThread);
62 const string m_threadName;
65 scopedPointer<boost::asio::io_service> m_service;
68 bool m_endThreadsAfterAllDone;
79 #endif // BLUB_CORE_DISPATCHER_HPP
Definition: dispatcher.hpp:13
Definition: dispatcher.hpp:29
Definition: noncopyable.hpp:10
Definition: deadlineTimer.hpp:10
void waitForQueueDone(void)
waitForQueueDone will work only if one thread
Definition: dispatcher.cpp:91