OmniSciDB  2e3a973ef4
threadpool::FuturesThreadPool< T, std::enable_if_t< std::is_object< T >::value > > Class Template Reference

#include <threadpool.h>

+ Inheritance diagram for threadpool::FuturesThreadPool< T, std::enable_if_t< std::is_object< T >::value > >:
+ Collaboration diagram for threadpool::FuturesThreadPool< T, std::enable_if_t< std::is_object< T >::value > >:

Public Member Functions

 FuturesThreadPool ()
 
auto join ()
 
- Public Member Functions inherited from threadpool::FuturesThreadPoolBase< T >
template<class Function , class... Args>
void spawn (Function &&f, Args &&... args)
 

Additional Inherited Members

- Protected Attributes inherited from threadpool::FuturesThreadPoolBase< T >
std::vector< std::future< T > > threads_
 

Detailed Description

template<typename T>
class threadpool::FuturesThreadPool< T, std::enable_if_t< std::is_object< T >::value > >

Definition at line 57 of file threadpool.h.

Constructor & Destructor Documentation

◆ FuturesThreadPool()

template<typename T >
threadpool::FuturesThreadPool< T, std::enable_if_t< std::is_object< T >::value > >::FuturesThreadPool ( )
inline

Definition at line 60 of file threadpool.h.

60 {}

Member Function Documentation

◆ join()

template<typename T >
auto threadpool::FuturesThreadPool< T, std::enable_if_t< std::is_object< T >::value > >::join ( )
inline

Definition at line 62 of file threadpool.h.

References run_benchmark_import::args, join(), threadpool::FuturesThreadPoolBase< T >::spawn(), and threadpool::FuturesThreadPoolBase< T >::threads_.

62  {
63  std::vector<T> results;
64  results.reserve(this->threads_.size());
65  for (auto& child : this->threads_) {
66  child.wait();
67  }
68  for (auto& child : this->threads_) {
69  results.push_back(child.get());
70  }
71  return results;
72  }
std::vector< std::future< T > > threads_
Definition: threadpool.h:38
+ Here is the call graph for this function:

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