#include <Job.hpp>
A job is a function pointer and series of arguments to the function as well as providing a link back to its thread-local allocating pool and JobGroup
counter.
Public Types | |
enum | State { State::unknown, State::ready, State::running, State::completed } |
Represents the state of a job at any given time. More... | |
Public Member Functions | |
Job () | |
Job (const size_t size, void *job_function, const uint32_t allocating_worker) | |
void | execute () |
Runs the jobs function. More... | |
Public Attributes | |
JobPool * | source_pool |
The source pool from which the job was allocated and should be free'd from. More... | |
State | state |
The jobs current running state. More... | |
detail::AtomicCounter * | group_counter |
Pointer to the counter belonging to a JobGroup if the job belongs to one. More... | |
uint32_t | worker_alloc |
The id of the worker that the job was allocated from. More... | |
uint8_t | function [64 - data_size] {} |
Buffer holding the JobFunction and associated arguments. More... | |
Static Public Attributes | |
static constexpr size_t | data_size |
Size of all members, used to offset the function buffer. More... | |
|
strong |
|
inline |
|
inline |
|
inline |
Runs the jobs function.
|
static |
Size of all members, used to offset the function buffer.
uint8_t jobrocket::Job::function[64 - data_size] {} |
Buffer holding the JobFunction
and associated arguments.
detail::AtomicCounter* jobrocket::Job::group_counter |
Pointer to the counter belonging to a JobGroup
if the job belongs to one.
JobPool* jobrocket::Job::source_pool |
The source pool from which the job was allocated and should be free'd from.
State jobrocket::Job::state |
The jobs current running state.
uint32_t jobrocket::Job::worker_alloc |
The id of the worker that the job was allocated from.