JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Types | Public Member Functions
IOThreadPool< Worker > Class Template Reference

#include <IOThreadPool.h>

Inheritance diagram for IOThreadPool< Worker >:
[legend]
Collaboration diagram for IOThreadPool< Worker >:
[legend]

Public Types

typedef Worker::IQueue IQueue
 
typedef Worker::OQueue OQueue
 
typedef Worker::IPayload IPayload
 
typedef Worker::OPayload OPayload
 
typedef Worker::WConf WConf
 

Public Member Functions

virtual ~IOThreadPool ()=default
 
 IOThreadPool (IQueue *iqueue, OQueue *oqueue, WConf conf)
 
 IOThreadPool (IQueue *iqueue, OQueue *oqueue, size_t maxThreads, WConf conf)
 
void forceThreads (size_t threads) override
 
size_t getUsedThreads () const override
 
void wait ()
 
size_t getMaxThreads () const override
 
void setMaxThreads (size_t maxThreads) override
 
size_t recommendedThreads () const override
 
bool hasRunningThreads ()
 
void setWorkerConfig (const WConf &workerConfig)
 
- Public Member Functions inherited from IThreadUser
 IThreadUser (size_t maxThreads)
 
virtual ~IThreadUser ()=default
 

Additional Inherited Members

- Protected Attributes inherited from IThreadUser
size_t maxThreads
 

Detailed Description

template<class Worker>
class IOThreadPool< Worker >

A templatable threadpool with input and output queues defined by the Worker

Member Typedef Documentation

◆ IPayload

template<class Worker >
typedef Worker::IPayload IOThreadPool< Worker >::IPayload

◆ IQueue

template<class Worker >
typedef Worker::IQueue IOThreadPool< Worker >::IQueue

◆ OPayload

template<class Worker >
typedef Worker::OPayload IOThreadPool< Worker >::OPayload

◆ OQueue

template<class Worker >
typedef Worker::OQueue IOThreadPool< Worker >::OQueue

◆ WConf

template<class Worker >
typedef Worker::WConf IOThreadPool< Worker >::WConf

Constructor & Destructor Documentation

◆ ~IOThreadPool()

template<class Worker >
virtual IOThreadPool< Worker >::~IOThreadPool ( )
virtualdefault

◆ IOThreadPool() [1/2]

template<class Worker >
IOThreadPool< Worker >::IOThreadPool ( IQueue iqueue,
OQueue oqueue,
WConf  conf 
)
inlineexplicit

Creates a new IOThreadPool with given IO queues and configuration. The number of threads will be the recommended number of threads for the system.

Parameters
iqueueInput queue
oqueueOutput queue
confThread config class
Here is the call graph for this function:

◆ IOThreadPool() [2/2]

template<class Worker >
IOThreadPool< Worker >::IOThreadPool ( IQueue iqueue,
OQueue oqueue,
size_t  maxThreads,
WConf  conf 
)
inlineexplicit

Creates a new IOThreadPool with given IO queues and configuration. The number of threads will be as specified by the user

Parameters
iqueueInput queue
oqueueOutput queue
maxThreadsMaximum number of threads to use in the pool
confThread config class
Here is the call graph for this function:

Member Function Documentation

◆ forceThreads()

template<class Worker >
void IOThreadPool< Worker >::forceThreads ( size_t  threads)
inlineoverridevirtual

Forces the IOThreadPool to use the specified number of threads

Parameters
threadsnumber of threads to use

Implements IThreadUser.

Here is the call graph for this function:

◆ getMaxThreads()

template<class Worker >
size_t IOThreadPool< Worker >::getMaxThreads ( ) const
inlineoverridevirtual

Returns the maximum number of threads the IOThreadPool will use

Returns

Reimplemented from IThreadUser.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUsedThreads()

template<class Worker >
size_t IOThreadPool< Worker >::getUsedThreads ( ) const
inlineoverridevirtual

Returns the number of threads currently in use

Returns

Implements IThreadUser.

Here is the caller graph for this function:

◆ hasRunningThreads()

template<class Worker >
bool IOThreadPool< Worker >::hasRunningThreads ( )
inline

Checks if there are still threads running

Returns
true if yes, false else

◆ recommendedThreads()

template<class Worker >
size_t IOThreadPool< Worker >::recommendedThreads ( ) const
inlineoverridevirtual

Gets the recommended number of threads for the IOThreadPool template instance

Implements IThreadUser.

◆ setMaxThreads()

template<class Worker >
void IOThreadPool< Worker >::setMaxThreads ( size_t  maxThreads)
inlineoverridevirtual

Sets the maximum number of threads the IOThreadPool will use

Parameters
maxThreadsmaximum number of threads

Reimplemented from IThreadUser.

Here is the call graph for this function:

◆ setWorkerConfig()

template<class Worker >
void IOThreadPool< Worker >::setWorkerConfig ( const WConf workerConfig)
inline

◆ wait()

template<class Worker >
void IOThreadPool< Worker >::wait ( )
inline

Waits (blocking) for all threads to stop working


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