28 #ifndef __TERRALIB_COMMON_INTERNAL_THREADGROUP_H
29 #define __TERRALIB_COMMON_INTERNAL_THREADGROUP_H
35 #include <boost/thread.hpp>
36 #include <boost/asio/io_service.hpp>
64 template <
typename Function>
65 void addJob(Function func);
80 std::unique_ptr<boost::asio::io_service::work>
m_work;
84 template <
typename Function>
This class represents a thread group.
~ThreadGroup()
Gets the number of threads that are defined to be used by this class.
ThreadGroup(std::size_t threadCount=0)
< Constructor. If the given thread count is 0, it will detect and use all available threads
std::unique_ptr< boost::thread_group > m_threadGroup
Boost thread group.
void run()
< Starts the execution of the thread group. Note that the jobs must be added before the calling of th...
std::size_t m_threadCount
void addJob(Function func)
Waits for all threads to finish their jobs.
std::unique_ptr< boost::asio::io_service::work > m_work
Boost work.
std::size_t getThreadCount()
Creates a new job and binds it to the given function. Use std::bind(function, object,...
std::unique_ptr< boost::asio::io_service > m_ioService
Boost IO service.
#define TECOMMONEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).