Helios++
Helios software for LiDAR simulations
ThreadPool Class Reference

Base class providing core implementation of a thread pool to deal with multi threading tasks. More...

#include <ThreadPool.h>

Inheritance diagram for ThreadPool:
Collaboration diagram for ThreadPool:

Public Member Functions

 ThreadPool (std::size_t const _pool_size)
 Thread pool constructor. More...
 
virtual std::size_t getPoolSize () const
 Obtain the thread pool size. More...
 

Protected Attributes

boost::asio::io_service io_service_
 Instance of boost input/output service for asynchronous data processing.
 
boost::asio::executor_work_guard< boost::asio::io_service::executor_type > work_
 Instance of work guard to report the io service when it has pending tasks. More...
 
std::size_t pool_size
 Size of thread pool (number of threads)
 
boost::thread_group threads_
 Group of threads.
 

Detailed Description

Base class providing core implementation of a thread pool to deal with multi threading tasks.

Version
1.0

Constructor & Destructor Documentation

◆ ThreadPool()

ThreadPool::ThreadPool ( std::size_t const  _pool_size)
inlineexplicit

Thread pool constructor.

See also
ThreadPool::pool_size

Member Function Documentation

◆ getPoolSize()

virtual std::size_t ThreadPool::getPoolSize ( ) const
inlinevirtual

Obtain the thread pool size.

Returns
Thread pool size
See also
ThreadPool::pool_size

Member Data Documentation

◆ work_

boost::asio::executor_work_guard<boost::asio::io_service::executor_type> ThreadPool::work_
protected

Instance of work guard to report the io service when it has pending tasks.

See also
ThreadPool::io_service_

The documentation for this class was generated from the following file: