NCBI C++ ToolKit
Public Types | Public Member Functions | Public Attributes | List of all members
bm::task_descr Struct Reference

Search Toolkit Book for bm::task_descr

BitMagic task with a captured function. More...

#include <util/bitset/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 () noexcept
 
 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 ()
 

Public Attributes

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

Detailed Description

BitMagic task with a captured function.

Definition at line 61 of file bmtask.h.

Member Enumeration Documentation

◆ 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 ( )
inlinenoexcept

Definition at line 82 of file bmtask.h.

◆ 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 td.

◆ task_descr() [3/3]

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

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 
)
inlinenoexcept

Definition at line 98 of file bmtask.h.

References argp, done, f(), 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().

Member Data Documentation

◆ argp

void* bm::task_descr::argp

◆ done

std::atomic_bool bm::task_descr::done

◆ err_code

int bm::task_descr::err_code

◆ 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(), TestTasks(), and bm::thread_pool< QValue, Lock >::worker_func().


The documentation for this struct was generated from the following file:
Modified on Wed May 15 15:08:57 2024 by modify_doxy.py rev. 669887