xrootd
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
XrdEc::ThreadPool Class Reference

#include <XrdEcThreadPool.hh>

Collaboration diagram for XrdEc::ThreadPool:
Collaboration graph
[legend]

Classes

class  AnyJob
 
struct  seq_gen
 
struct  seq_gen< 0, Ns... >
 
struct  seq_gen< I, Ns... >
 
struct  sequence
 

Public Member Functions

 ~ThreadPool ()
 Destructor.
 
template<typename FUNC , typename ... ARGs>
std::future< typename std::result_of< FUNC(ARGs...)>::type > Execute (FUNC func, ARGs... args)
 Schedule a functional (together with its arguments) for execution.
 

Static Public Member Functions

static ThreadPoolInstance ()
 Singleton access.
 

Private Member Functions

 ThreadPool ()
 Constructor.
 

Static Private Member Functions

template<typename FUNC , typename TUPL , int ... INDICES>
static auto tuple_call_impl (FUNC &func, TUPL &args, sequence< INDICES... >) -> decltype(func(std::move(std::get< INDICES >(args))...))
 
template<typename FUNC , typename ... ARGs>
static auto tuple_call (FUNC &func, std::tuple< ARGs... > &tup) -> decltype(tuple_call_impl(func, tup, typename seq_gen< sizeof...(ARGs)>::type{}))
 

Private Attributes

XrdCl::JobManager threadpool
 

Constructor & Destructor Documentation

◆ ~ThreadPool()

XrdEc::ThreadPool::~ThreadPool ( )
inline

◆ ThreadPool()

XrdEc::ThreadPool::ThreadPool ( )
inlineprivate

Member Function Documentation

◆ Execute()

template<typename FUNC , typename ... ARGs>
std::future< typename std::result_of< FUNC(ARGs...)>::type > XrdEc::ThreadPool::Execute ( FUNC  func,
ARGs...  args 
)
inline

Schedule a functional (together with its arguments) for execution.

References XrdEc::ThreadPool::AnyJob< FUNC, RET, ARGs >::GetFuture(), XrdCl::JobManager::QueueJob(), and threadpool.

Referenced by XrdEc::WrtBuff::Encode().

◆ Instance()

static ThreadPool & XrdEc::ThreadPool::Instance ( )
inlinestatic

Singleton access.

Referenced by XrdEc::WrtBuff::Encode(), and XrdEc::StrmWriter::EnqueueBuff().

◆ tuple_call()

template<typename FUNC , typename ... ARGs>
static auto XrdEc::ThreadPool::tuple_call ( FUNC &  func,
std::tuple< ARGs... > &  tup 
) -> decltype( tuple_call_impl( func, tup, typename seq_gen<sizeof...(ARGs)>::type{} ) )
inlinestaticprivate

◆ tuple_call_impl()

template<typename FUNC , typename TUPL , int ... INDICES>
static auto XrdEc::ThreadPool::tuple_call_impl ( FUNC &  func,
TUPL &  args,
sequence< INDICES... >   
) -> decltype( func( std::move( std::get<INDICES>( args ) )... ) )
inlinestaticprivate

Member Data Documentation

◆ threadpool

XrdCl::JobManager XrdEc::ThreadPool::threadpool
private

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


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