MarlinMT  0.1.0
marlinmt::concurrency::WorkerBase< IN, OUT > Class Template Referenceabstract

WorkerBase class Base class to implement processing of task data (so called queued-element) pushed in a thread pool. More...

#include <Worker.h>

Public Types

using Input = IN
 
using Output = OUT
 

Public Member Functions

virtual ~WorkerBase ()=default
 
virtual OUT process (IN &&data)=0
 Process a single queued data taken form the thread pool. More...
 

Protected Member Functions

void processElement (QueueElement< IN, OUT > &element)
 Process queued element from the thread pool. More...
 

Friends

class Worker< IN, OUT >
 

Detailed Description

template<typename IN, typename OUT>
class marlinmt::concurrency::WorkerBase< IN, OUT >

WorkerBase class Base class to implement processing of task data (so called queued-element) pushed in a thread pool.

The IN and OUT types must be movable. See also specialization for void IN and OUT types

Definition at line 37 of file Worker.h.

Member Typedef Documentation

◆ Input

template<typename IN, typename OUT>
using marlinmt::concurrency::WorkerBase< IN, OUT >::Input = IN

Definition at line 40 of file Worker.h.

◆ Output

template<typename IN, typename OUT>
using marlinmt::concurrency::WorkerBase< IN, OUT >::Output = OUT

Definition at line 41 of file Worker.h.

Constructor & Destructor Documentation

◆ ~WorkerBase()

template<typename IN, typename OUT>
virtual marlinmt::concurrency::WorkerBase< IN, OUT >::~WorkerBase ( )
virtualdefault

Member Function Documentation

◆ process()

template<typename IN, typename OUT>
virtual OUT marlinmt::concurrency::WorkerBase< IN, OUT >::process ( IN &&  data)
pure virtual

◆ processElement()

template<typename IN , typename OUT >
void marlinmt::concurrency::WorkerBase< IN, OUT >::processElement ( QueueElement< IN, OUT > &  element)
inlineprotected

Process queued element from the thread pool.

Parameters
elementa thread pool queued element

Definition at line 102 of file Worker.h.

Friends And Related Function Documentation

◆ Worker< IN, OUT >

template<typename IN, typename OUT>
friend class Worker< IN, OUT >
friend

Definition at line 38 of file Worker.h.


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