ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
colmap::ThreadPool Class Reference

#include <threading.h>

Public Member Functions

 ThreadPool (const int num_threads=kMaxNumThreads)
 
 ~ThreadPool ()
 
size_t NumThreads () const
 
template<class func_t , class... args_t>
auto AddTask (func_t &&f, args_t &&... args) -> std::future< typename std::result_of< func_t(args_t...)>::type >
 
void Stop ()
 
void Wait ()
 
std::thread::id GetThreadId () const
 
int GetThreadIndex ()
 

Static Public Attributes

static const int kMaxNumThreads = -1
 

Constructor & Destructor Documentation

◆ ThreadPool()

colmap::ThreadPool::ThreadPool ( const int  num_threads = kMaxNumThreads)
explicit

◆ ~ThreadPool()

colmap::ThreadPool::~ThreadPool ( )

References Stop().

Member Function Documentation

◆ AddTask()

template<class func_t , class... args_t>
auto colmap::ThreadPool::AddTask ( func_t &&  f,
args_t &&...  args 
) -> std::future<typename std::result_of<func_t(args_t...)>::type>

◆ GetThreadId()

std::thread::id colmap::ThreadPool::GetThreadId ( ) const

Referenced by GetThreadIndex().

◆ GetThreadIndex()

int colmap::ThreadPool::GetThreadIndex ( )

References GetThreadId().

Referenced by BOOST_AUTO_TEST_CASE().

◆ NumThreads()

size_t colmap::ThreadPool::NumThreads ( ) const
inline

◆ Stop()

void colmap::ThreadPool::Stop ( )

References std::swap().

Referenced by BOOST_AUTO_TEST_CASE(), and ~ThreadPool().

◆ Wait()

void colmap::ThreadPool::Wait ( )

Member Data Documentation

◆ kMaxNumThreads

const int colmap::ThreadPool::kMaxNumThreads = -1
static

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