Struct JobData

Struct Documentation

struct JobData

Data to be sent to workers

Public Functions

JobData() = default
inline JobData(int *jobDone, std::condition_variable *jobDoneChangedCondition, std::mutex *jobDoneChangedMutex)

Public Members

int jobId = -1

auto-assigned (unique number up to MAX_INT)

std::vector<char> sendBuffer

data to send

std::vector<char> recvBuffer

data to receive (set when job finished)

int *jobDone = nullptr

incremented by one, once the results have been received (if set)

std::condition_variable *jobDoneChangedCondition = nullptr

is signaled after jobDone has been incremented (if set)

std::mutex *jobDoneChangedMutex = nullptr

is locked to signal jobDoneChangedCondition condition (if set)

std::function<void(JobData*)> callbackJobFinished = nullptr

callback when job is finished (if set)