This class represents a thread group. More...
#include <ThreadGroup.h>
Public Member Functions | |
| template<typename Function > | |
| void | addJob (Function func) |
| Waits for all threads to finish their jobs. More... | |
| ThreadGroup (std::size_t numberOfThreads=std::string::npos) | |
| < Constructor. If the number of thread is not especified, it will use all available threads More... | |
| void | waitToFinish () |
| ~ThreadGroup () | |
| Creates a new job and binds it to the given function. Use std::bind(function, object, params...) as argument. More... | |
Protected Attributes | |
| std::unique_ptr< boost::asio::io_service > | m_ioService |
| Boost IO service. More... | |
| std::unique_ptr< boost::thread_group > | m_threadGroup |
| Boost thread group. More... | |
| std::unique_ptr< boost::asio::io_service::work > | m_work |
| Boost work. More... | |
This class represents a thread group.
Definition at line 50 of file ThreadGroup.h.
| te::common::ThreadGroup::ThreadGroup | ( | std::size_t | numberOfThreads = std::string::npos | ) |
< Constructor. If the number of thread is not especified, it will use all available threads
Destructor
| te::common::ThreadGroup::~ThreadGroup | ( | ) |
Creates a new job and binds it to the given function. Use std::bind(function, object, params...) as argument.
| void te::common::ThreadGroup::addJob | ( | Function | func | ) |
Waits for all threads to finish their jobs.
Definition at line 76 of file ThreadGroup.h.
References m_ioService.
| void te::common::ThreadGroup::waitToFinish | ( | ) |
|
protected |
|
protected |
Boost thread group.
Definition at line 70 of file ThreadGroup.h.
|
protected |
Boost work.
Definition at line 71 of file ThreadGroup.h.