|
Core Library
1.6.0.0
Library containing core utilities and tools for threading, networking, logging, INI and CSV file management etc.
|
I/O Service Thread group class. More...
#include <IoServiceThreadGroup.h>
Public Member Functions | |
| IoServiceThreadGroup (unsigned int numThreads=std::thread::hardware_concurrency()) | |
| Initialising constuctor. More... | |
| IoServiceThreadGroup (const IoServiceThreadGroup &)=delete | |
| Copy constructor deleted. | |
| IoServiceThreadGroup & | operator= (const IoServiceThreadGroup &)=delete |
| Copy assignment operator deleted. | |
| IoServiceThreadGroup (IoServiceThreadGroup &&)=delete | |
| Move constructor deleted. | |
| IoServiceThreadGroup & | operator= (IoServiceThreadGroup &&)=delete |
| Move assignment operator deleted. | |
| ~IoServiceThreadGroup () | |
| Destructor. | |
| boost_ioservice_t & | IoService () |
| Get the I/O service. More... | |
| template<typename F > | |
| void | Post (F function) |
| Post a function object to be run by one of our threads. More... | |
Private Attributes | |
| boost_ioservice_t | m_ioService |
| Boost ASIO I/O service. | |
| boost_ioservice_t::work | m_ioWork |
| Boost ASIO I/O service work object. | |
| threads::ThreadGroup | m_threadGroup |
| Our thread group. | |
I/O Service Thread group class.
This class implements a thread group mechanism for use by Boost's ASIO I/O service. This allows the I/O Service to spread its work load across multiple threads. This class also calls run on the I/O service from each registered thread and also calls stop and joins all threads in its destructor.
|
explicit |
Initialising constuctor.
| [in] | numThreads | - (Optional) Number of threads to create. |
If the number of threads is not specified then the value will be assigned using std::thread::hardware_concurrency().
| boost_ioservice_t & core_lib::asio::IoServiceThreadGroup::IoService | ( | ) |
Get the I/O service.
|
inline |
Post a function object to be run by one of our threads.
| [in] | function | - Function to be run by one of our threads. |