cpp-mate  0.7
Helpful library for C++.
CppMate::PipelineThreadPool< R, A > Class Template Reference

Represents pipeline implemetation with ThreadPool backend. More...

#include <ThreadPool.hpp>

Inheritance diagram for CppMate::PipelineThreadPool< R, A >:
Collaboration diagram for CppMate::PipelineThreadPool< R, A >:

Public Member Functions

 PipelineThreadPool (const PipelineThreadPool &other)=default
 
 PipelineThreadPool (PipelineThreadPool &&other)=default
 
PipelineThreadPooloperator= (const PipelineThreadPool &other)=default
 
PipelineThreadPooloperator= (PipelineThreadPool &&other)=default
 
std::future< R > addTask (typename Pipeline< R, A... >::Signature task, A &&... args) override
 
 PipelineThreadPool (unsigned maxThreads=0)
 Constructor. More...
 
 PipelineThreadPool (std::shared_ptr< ThreadPool< R >> pool)
 Constructor. More...
 
std::shared_ptr< ThreadPool< R > > getPool () const
 getPool More...
 
- Public Member Functions inherited from CppMate::Pipeline< R, A... >
virtual ~Pipeline ()=default
 
virtual std::future< R > addTask (Signature task, A &&... args)=0
 Adds a new task for execution. More...
 

Static Public Member Functions

static std::unique_ptr< Pipeline< R, A... > > create (unsigned maxThreads=0)
 Creates pipeline instance. More...
 
static std::unique_ptr< Pipeline< R, A... > > create (std::shared_ptr< ThreadPool< R >> pool)
 Creates pipeline instance. More...
 

Additional Inherited Members

- Public Types inherited from CppMate::Pipeline< R, A... >
using Signature = std::function< R(A...)>
 

Detailed Description

template<typename R, typename... A>
class CppMate::PipelineThreadPool< R, A >

Represents pipeline implemetation with ThreadPool backend.

Constructor & Destructor Documentation

◆ PipelineThreadPool() [1/4]

template<typename R , typename... A>
CppMate::PipelineThreadPool< R, A >::PipelineThreadPool ( const PipelineThreadPool< R, A > &  other)
default

◆ PipelineThreadPool() [2/4]

template<typename R , typename... A>
CppMate::PipelineThreadPool< R, A >::PipelineThreadPool ( PipelineThreadPool< R, A > &&  other)
default

◆ PipelineThreadPool() [3/4]

template<typename R , typename... A>
CppMate::PipelineThreadPool< R, A >::PipelineThreadPool ( unsigned  maxThreads = 0)
inlineexplicit

Constructor.

Parameters
maxThreadsthe desired value of maximum possible threads in the pool. Zero value means choosing an optimal value for the current platform.

◆ PipelineThreadPool() [4/4]

template<typename R , typename... A>
CppMate::PipelineThreadPool< R, A >::PipelineThreadPool ( std::shared_ptr< ThreadPool< R >>  pool)
inlineexplicit

Constructor.

Parameters
poolthe exisiting thread pool backend.

Member Function Documentation

◆ addTask()

template<typename R , typename... A>
std::future<R> CppMate::PipelineThreadPool< R, A >::addTask ( typename Pipeline< R, A... >::Signature  task,
A &&...  args 
)
inlineoverride

◆ create() [1/2]

template<typename R , typename... A>
static std::unique_ptr<Pipeline<R, A...> > CppMate::PipelineThreadPool< R, A >::create ( std::shared_ptr< ThreadPool< R >>  pool)
inlinestatic

Creates pipeline instance.

Parameters
poolthe exisiting thread pool backend.
Returns
the pipeline instance.

◆ create() [2/2]

template<typename R , typename... A>
static std::unique_ptr<Pipeline<R, A...> > CppMate::PipelineThreadPool< R, A >::create ( unsigned  maxThreads = 0)
inlinestatic

Creates pipeline instance.

Parameters
maxThreadsthe desired value of maximum possible threads in the pool. Zero value means choosing an optimal value for the current platform.
Returns
the pipeline instance.

◆ getPool()

template<typename R , typename... A>
std::shared_ptr<ThreadPool<R> > CppMate::PipelineThreadPool< R, A >::getPool ( ) const
inline

getPool

Returns

◆ operator=() [1/2]

template<typename R , typename... A>
PipelineThreadPool& CppMate::PipelineThreadPool< R, A >::operator= ( const PipelineThreadPool< R, A > &  other)
default

◆ operator=() [2/2]

template<typename R , typename... A>
PipelineThreadPool& CppMate::PipelineThreadPool< R, A >::operator= ( PipelineThreadPool< R, A > &&  other)
default

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