This class represents a thread group.
More...
#include <ThreadGroup.h>
|
template<typename Function > |
void | addJob (Function func) |
| Waits for all threads to finish their jobs.
|
|
std::size_t | getThreadCount () |
| Creates a new job and binds it to the given function. Use std::bind(function, object, params...) as argument.
|
|
| ThreadGroup (std::size_t threadCount=0) |
| < Constructor. If the given thread count is 0, it will detect and use all available threads
|
|
void | waitToFinish () |
|
| ~ThreadGroup () |
| Gets the number of threads that are defined to be used by this class.
|
|
|
void | run () |
| < Starts the execution of the thread group. Note that the jobs must be added before the calling of this function
|
|
|
std::unique_ptr< boost::asio::io_service > | m_ioService |
| Boost IO service.
|
|
std::size_t | m_threadCount |
|
std::unique_ptr< boost::thread_group > | m_threadGroup |
| Boost thread group.
|
|
std::unique_ptr< boost::asio::io_service::work > | m_work |
| Boost work.
|
|
This class represents a thread group.
Definition at line 50 of file ThreadGroup.h.
◆ ThreadGroup()
te::common::ThreadGroup::ThreadGroup |
( |
std::size_t |
threadCount = 0 | ) |
|
< Constructor. If the given thread count is 0, it will detect and use all available threads
Destructor
◆ ~ThreadGroup()
te::common::ThreadGroup::~ThreadGroup |
( |
| ) |
|
Gets the number of threads that are defined to be used by this class.
◆ addJob()
template<typename Function >
void te::common::ThreadGroup::addJob |
( |
Function |
func | ) |
|
◆ getThreadCount()
std::size_t te::common::ThreadGroup::getThreadCount |
( |
| ) |
|
Creates a new job and binds it to the given function. Use std::bind(function, object, params...) as argument.
◆ run()
void te::common::ThreadGroup::run |
( |
| ) |
|
|
private |
< Starts the execution of the thread group. Note that the jobs must be added before the calling of this function
◆ waitToFinish()
void te::common::ThreadGroup::waitToFinish |
( |
| ) |
|
◆ m_ioService
std::unique_ptr<boost::asio::io_service> te::common::ThreadGroup::m_ioService |
|
private |
◆ m_threadCount
std::size_t te::common::ThreadGroup::m_threadCount |
|
private |
◆ m_threadGroup
std::unique_ptr<boost::thread_group> te::common::ThreadGroup::m_threadGroup |
|
private |
◆ m_work
std::unique_ptr<boost::asio::io_service::work> te::common::ThreadGroup::m_work |
|
private |
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_release/src/terralib/common/ThreadGroup.h