cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::base::thread_pool_singleton_t Class Reference

简单的线程池单例封装/A simple singleton wrapper around thread_pool_t More...

#include <thread_pool_singleton.hpp>

Public Member Functions

template<class F , class... Args>
auto submit (F &&f, Args &&... args) -> std::future< typename std::invoke_result_t< F, Args... > >
 提交任务/Submit a task
 
size_t get_thread_count () const
 获取线程数量/Get underlying worker count
 

Static Public Member Functions

static thread_pool_singleton_tinstance ()
 获取单例实例/Get the singleton instance
 

Detailed Description

简单的线程池单例封装/A simple singleton wrapper around thread_pool_t

Member Function Documentation

◆ get_thread_count()

size_t toolbox::base::thread_pool_singleton_t::get_thread_count ( ) const
inline

获取线程数量/Get underlying worker count

◆ instance()

static thread_pool_singleton_t & toolbox::base::thread_pool_singleton_t::instance ( )
inlinestatic

获取单例实例/Get the singleton instance

◆ submit()

template<class F , class... Args>
auto toolbox::base::thread_pool_singleton_t::submit ( F &&  f,
Args &&...  args 
) -> std::future<typename std::invoke_result_t<F, Args...>>
inline

提交任务/Submit a task


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