Robowflex
v0.1
Making MoveIt Easy
|
A job that returns RT. More...
#include <pool.h>
Public Member Functions | |
template<typename... Args> | |
Job (const std::function< RT(Args...)> &&function, Args &&... args) | |
Constructor. More... | |
void | execute () override |
Executes the task and stores the result in future_. More... | |
RT | get () |
Blocking call to retrieve the result of the function. Note that if the job was canceled it is not guaranteed that this function will return, as the job might never be executed. More... | |
void | wait () const |
Waits until result of the job is available. More... | |
bool | isDone () const |
Returns true if the task is done, false otherwise. More... | |
bool | waitFor (double time) const |
Waits for a number of seconds to see if the task completes. More... | |
Public Member Functions inherited from robowflex::Pool::Joblet | |
void | cancel () |
Cancels this job. More... | |
bool | isCancled () const |
Checks if this job has been cancled. More... | |
Private Attributes | |
std::function< RT()> | function_ |
Bound function to execute. More... | |
std::packaged_task< RT()> | task_ |
Task of function. More... | |
std::future< RT > | future_ |
Future of function result. More... | |
Additional Inherited Members | |
Protected Attributes inherited from robowflex::Pool::Joblet | |
bool | canceled {false} |
Whether the job is cancled or not. More... | |
A job that returns RT.
RT | Return type of function to be executed. |
|
inline |
Constructor.
[in] | function | Function to execute. |
[in] | args | Arguments to function. |
Args | Types of the function arguments. |
Definition at line 132 of file pool.h.
|
inlineoverridevirtual |
Executes the task and stores the result in future_.
Implements robowflex::Pool::Joblet.
|
inline |
Blocking call to retrieve the result of the function. Note that if the job was canceled it is not guaranteed that this function will return, as the job might never be executed.
|
inline |
Returns true if the task is done, false otherwise.
Definition at line 164 of file pool.h.
|
inline |
Waits until result of the job is available.
|
inline |
|
private |
|
private |
|
private |