knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <ThreadPool.h>
Public Types | |
using | StopChecker = std::function< bool()> |
using | StopChecker = std::function< bool()> |
Public Member Functions | |
LambdaRunner (const std::function< void(const StopChecker &)> &fn) | |
void | run () override |
LambdaRunner (const std::function< void(const StopChecker &)> &fn) | |
void | run () override |
Public Member Functions inherited from knowrob::ThreadPool::Runner | |
Runner () | |
virtual | ~Runner () |
Runner (const Runner &)=delete | |
void | join () |
void | stop (bool wait) |
bool | hasStopRequest () const |
bool | isTerminated () const |
Runner () | |
virtual | ~Runner () |
Runner (const Runner &)=delete | |
void | join () |
void | stop (bool wait) |
bool | hasStopRequest () const |
bool | isTerminated () const |
Protected Attributes | |
std::function< void(const StopChecker &)> | fn_ |
Protected Attributes inherited from knowrob::ThreadPool::Runner | |
std::atomic< bool > | isTerminated_ |
std::atomic< bool > | isRunning_ |
std::atomic< bool > | hasStopRequest_ |
std::mutex | mutex_ |
std::condition_variable | finishedCV_ |
ExceptionHandler | exceptionHandler_ |
Additional Inherited Members | |
Protected Member Functions inherited from knowrob::ThreadPool::Runner | |
void | runInternal () |
void | setExceptionHandler (ExceptionHandler exceptionHandler) |
void | runInternal () |
void | setExceptionHandler (ExceptionHandler exceptionHandler) |
A runner that executes a lambda function.
Definition at line 150 of file ThreadPool.h.
using knowrob::ThreadPool::LambdaRunner::StopChecker = std::function<bool()> |
Definition at line 152 of file ThreadPool.h.
using knowrob::ThreadPool::LambdaRunner::StopChecker = std::function<bool()> |
Definition at line 152 of file ThreadPool.h.
|
inlineexplicit |
fn | the lambda function to be executed |
Definition at line 157 of file ThreadPool.h.
|
inlineexplicit |
|
inlineoverridevirtual |
Run the computation in a worker thread.
Implements knowrob::ThreadPool::Runner.
Definition at line 159 of file ThreadPool.h.
|
inlineoverridevirtual |
Run the computation in a worker thread.
Implements knowrob::ThreadPool::Runner.
Definition at line 159 of file ThreadPool.h.
|
protected |
Definition at line 162 of file ThreadPool.h.