PicoScenes API Docs
 
Loading...
Searching...
No Matches
TaggedThreadPool< ThreadCountCompileTime > Class Template Reference

#include <TaggedThreadPool.hxx>

Public Member Functions

 TaggedThreadPool (const int threadCount=ThreadCountCompileTime, const std::string &threadNamePrefix=std::string{})
 
void addThread (const int numThreads2Add)
 
template<typename Task , typename Params , typename = std::enable_if_t<std::is_invocable_v<Task, const std::any &> && std::is_same_v<std::decay_t<Params>, std::any>>>
void addJob (Task &&task, Params &&params, const std::optional< uint32_t > &threadSN=std::nullopt)
 
void AddJob (const std::function< void()> &task)
 
size_t threadCount () const
 
size_t taskCount () const
 
 ~TaggedThreadPool ()
 

Detailed Description

template<unsigned ThreadCountCompileTime = 1>
class TaggedThreadPool< ThreadCountCompileTime >

Definition at line 25 of file TaggedThreadPool.hxx.

Constructor & Destructor Documentation

◆ TaggedThreadPool()

template<unsigned ThreadCountCompileTime = 1>
TaggedThreadPool< ThreadCountCompileTime >::TaggedThreadPool ( const int  threadCount = ThreadCountCompileTime,
const std::string &  threadNamePrefix = std::string{} 
)
inlineexplicit

Definition at line 27 of file TaggedThreadPool.hxx.

◆ ~TaggedThreadPool()

template<unsigned ThreadCountCompileTime = 1>
TaggedThreadPool< ThreadCountCompileTime >::~TaggedThreadPool ( )
inline

Definition at line 85 of file TaggedThreadPool.hxx.

Member Function Documentation

◆ AddJob()

template<unsigned ThreadCountCompileTime = 1>
void TaggedThreadPool< ThreadCountCompileTime >::AddJob ( const std::function< void()> &  task)
inline

◆ addJob()

template<unsigned ThreadCountCompileTime = 1>
template<typename Task , typename Params , typename = std::enable_if_t<std::is_invocable_v<Task, const std::any &> && std::is_same_v<std::decay_t<Params>, std::any>>>
void TaggedThreadPool< ThreadCountCompileTime >::addJob ( Task &&  task,
Params &&  params,
const std::optional< uint32_t > &  threadSN = std::nullopt 
)
inline

threadSN是从0开始的整数

Definition at line 55 of file TaggedThreadPool.hxx.

Referenced by TaggedThreadPool< ThreadCountCompileTime >::AddJob().

◆ addThread()

template<unsigned ThreadCountCompileTime = 1>
void TaggedThreadPool< ThreadCountCompileTime >::addThread ( const int  numThreads2Add)
inline

Definition at line 31 of file TaggedThreadPool.hxx.

◆ taskCount()

template<unsigned ThreadCountCompileTime = 1>
size_t TaggedThreadPool< ThreadCountCompileTime >::taskCount ( ) const
inline

◆ threadCount()

template<unsigned ThreadCountCompileTime = 1>
size_t TaggedThreadPool< ThreadCountCompileTime >::threadCount ( ) const
inline

Definition at line 72 of file TaggedThreadPool.hxx.


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