BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
fc::task_base Class Reference

#include <task.hpp>

Inheritance diagram for fc::task_base:
fc::promise_base fc::task< R, FunctorSize > fc::task< void, FunctorSize >

Public Member Functions

void run ()
 
virtual void cancel (const char *reason FC_CANCELATION_REASON_DEFAULT_ARG) override
 
virtual ~task_base ()
 
void retain ()
 
void release ()
 
- Public Member Functions inherited from fc::promise_base
virtual ~promise_base ()
 
const char * get_desc () const
 
bool canceled () const
 
bool ready () const
 
bool error () const
 
void set_exception (const fc::exception_ptr &e)
 

Protected Member Functions

void _set_active_context (context *)
 
 task_base (void *func)
 
void run_impl ()
 
void cleanup_task_specific_data ()
 
- Protected Member Functions inherited from fc::promise_base
 promise_base (const char *desc FC_TASK_NAME_DEFAULT_ARG)
 
void _wait (const microseconds &timeout_us)
 
void _wait_until (const time_point &timeout_us)
 
void _notify ()
 
void _set_value (const void *v)
 
void _on_complete (detail::completion_handler *c)
 

Protected Attributes

uint64_t _posted_num
 Task priority looks like unsupported feature. More...
 
priority _prio
 
time_point _when
 
context_active_context
 
task_base_next
 
std::vector< detail::specific_data_info > * _task_specific_data
 
fwd< spin_lock, 8 > _spinlock
 
void * _promise_impl
 
void * _functor
 
void(* _destroy_functor )(void *)
 
void(* _run_functor )(void *, void *)
 
- Protected Attributes inherited from fc::promise_base
const char * _cancellation_reason
 

Friends

class thread
 
class thread_d
 
class detail::idle_guard
 
void * detail::get_task_specific_data (unsigned slot)
 
void detail::set_task_specific_data (unsigned slot, void *new_value, void(*cleanup)(void *))
 

Additional Inherited Members

- Public Types inherited from fc::promise_base
typedef std::shared_ptr< promise_baseptr
 

Detailed Description

Definition at line 33 of file task.hpp.

Constructor & Destructor Documentation

fc::task_base::~task_base ( )
virtual

Definition at line 82 of file task.cpp.

fc::task_base::task_base ( void *  func)
protected

Definition at line 17 of file task.cpp.

Member Function Documentation

void fc::task_base::_set_active_context ( context c)
protected

Definition at line 87 of file task.cpp.

void fc::task_base::cancel ( const char *reason  FC_CANCELATION_REASON_DEFAULT_ARG)
overridevirtual

Reimplemented from fc::promise_base.

Reimplemented in fc::task< void, FunctorSize >, and fc::task< R, FunctorSize >.

Definition at line 64 of file task.cpp.

void fc::task_base::cleanup_task_specific_data ( )
protected

Definition at line 93 of file task.cpp.

void fc::task_base::release ( )

Definition at line 109 of file task.cpp.

void fc::task_base::retain ( )

Definition at line 105 of file task.cpp.

void fc::task_base::run ( )

Definition at line 29 of file task.cpp.

void fc::task_base::run_impl ( )
protected

Definition at line 41 of file task.cpp.

Friends And Related Function Documentation

void* detail::get_task_specific_data ( unsigned  slot)
friend
friend class detail::idle_guard
friend

Definition at line 78 of file task.hpp.

void detail::set_task_specific_data ( unsigned  slot,
void *  new_value,
void(*)(void *)  cleanup 
)
friend
friend class thread
friend

Definition at line 76 of file task.hpp.

friend class thread_d
friend

Definition at line 77 of file task.hpp.

Member Data Documentation

context* fc::task_base::_active_context
protected

Definition at line 64 of file task.hpp.

void(* fc::task_base::_destroy_functor) (void *)
protected

Definition at line 84 of file task.hpp.

void* fc::task_base::_functor
protected

Definition at line 83 of file task.hpp.

task_base* fc::task_base::_next
protected

Definition at line 65 of file task.hpp.

uint64_t fc::task_base::_posted_num
protected

Task priority looks like unsupported feature.

Definition at line 60 of file task.hpp.

priority fc::task_base::_prio
protected

Definition at line 61 of file task.hpp.

void* fc::task_base::_promise_impl
protected

Definition at line 82 of file task.hpp.

void(* fc::task_base::_run_functor) (void *, void *)
protected

Definition at line 85 of file task.hpp.

fwd<spin_lock,8> fc::task_base::_spinlock
protected

Definition at line 79 of file task.hpp.

std::vector<detail::specific_data_info>* fc::task_base::_task_specific_data
protected

Definition at line 68 of file task.hpp.

time_point fc::task_base::_when
protected

Definition at line 62 of file task.hpp.


The documentation for this class was generated from the following files: