bm::task_descr Struct Reference
BitMagic Library » Task parallel programming

BitMagic task with a captured function. More...

`#include <bmtask.h>`

## Public Types

enum | task_flags { no_flag = 0 , barrier_ok = 1u , barrier_any = (1u << 1) , barrier_ok_delayed = (1u << 2) }

## Public Member Functions

| task_descr () BMNOEXCEPT
| task_descr (const task_descr &td)
| task_descr (task_function_t f, void *argptr=0) noexcept
void | init (task_function_t f, void *argptr) noexcept
int | run ()

## Data Fields

task_function_t | func
| captured function callback
void * | argp
| arg pointer
bm::id64_t | flags
| task flags to designate barriers
int | err_code
| error code
std::atomic_bool | done
| 0 - pending

## Detailed Description

BitMagic task with a captured function.

Definition at line 61 of file bmtask.h.

## Member Enumeration Documentation

## task_flags

enum bm::task_descr::task_flags

Enumerator
no_flag | no flag specified
barrier_ok | barrier waits all prev.tasks done without error
barrier_any | barrier waits all prev tasks done (success or not)
barrier_ok_delayed |

Definition at line 63 of file bmtask.h.

## Constructor & Destructor Documentation

## task_descr() [1/3]

bm::task_descr::task_descr | ( |  | ) |

inline

Definition at line 82 of file bmtask.h.

References BMNOEXCEPT.

Referenced by task_descr().

## task_descr() [2/3]

bm::task_descr::task_descr | ( | const task_descr & | td | ) |

inline

Definition at line 84 of file bmtask.h.

References argp, done, err_code, flags, func, and task_descr().

## task_descr() [3/3]

bm::task_descr::task_descr | ( | task_function_t | f,
|  | void * | argptr = 0 )

inline noexcept

Definition at line 93 of file bmtask.h.

References init().

## Member Function Documentation

## init()

void bm::task_descr::init | ( | task_function_t | f,
|  | void * | argptr )

inline noexcept

Definition at line 98 of file bmtask.h.

References argp, done, flags, func, and no_flag.

Referenced by bm::sv_serialization_plan_builder< SV >::build_plan(), and task_descr().

## run()

int bm::task_descr::run | ( |  | ) |

inline

Definition at line 103 of file bmtask.h.

References argp, done, err_code, and func.

Referenced by bm::run_task_batch().

## Field Documentation

## argp

void* bm::task_descr::argp

arg pointer

Definition at line 72 of file bmtask.h.

Referenced by init(), run(), bm::thread_pool_executor< TPool >::run(), bm::run_task_batch(), task_descr(), and bm::thread_pool< QValue, Lock >::worker_func().

## done

std::atomic_bool bm::task_descr::done

0 - pending

Definition at line 77 of file bmtask.h.

Referenced by init(), run(), bm::thread_pool_executor< TPool >::run(), task_descr(), bm::thread_pool_executor< TPool >::wait_for_batch_done(), and bm::thread_pool< QValue, Lock >::worker_func().

## err_code

int bm::task_descr::err_code

error code

Definition at line 76 of file bmtask.h.

Referenced by run(), bm::thread_pool_executor< TPool >::run(), task_descr(), and bm::thread_pool< QValue, Lock >::worker_func().

## flags

bm::id64_t bm::task_descr::flags

task flags to designate barriers

Definition at line 75 of file bmtask.h.

Referenced by init(), bm::thread_pool_executor< TPool >::run(), and task_descr().

## func

task_function_t bm::task_descr::func

captured function callback

Definition at line 71 of file bmtask.h.

Referenced by init(), run(), bm::thread_pool_executor< TPool >::run(), task_descr(), and bm::thread_pool< QValue, Lock >::worker_func().

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

- bmtask.h