libtasks Documentation  1.6
tasks::executor Class Reference

#include <executor.h>

Collaboration diagram for tasks::executor:

Public Member Functions

 executor ()
 
virtual ~executor ()
 
bool busy () const
 
void set_busy ()
 
void add_task (exec_task *t)
 
void terminate ()
 
bool terminated () const
 

Static Public Member Functions

static void set_timeout (uint32_t timeout)
 

Private Member Functions

void run ()
 

Private Attributes

std::atomic< bool > m_busy
 
std::atomic< bool > m_term
 
exec_taskm_task = nullptr
 
std::mutex m_mutex
 
std::condition_variable m_cond
 
std::unique_ptr< std::thread > m_thread
 

Static Private Attributes

static uint32_t m_timeout = 60
 

Friends

class test_exec
 

Detailed Description

Definition at line 22 of file executor.h.

Constructor & Destructor Documentation

tasks::executor::executor ( )

Definition at line 16 of file executor.cpp.

Here is the call graph for this function:

virtual tasks::executor::~executor ( )
inlinevirtual

Definition at line 28 of file executor.h.

Here is the call graph for this function:

Member Function Documentation

void tasks::executor::add_task ( exec_task t)
inline

Definition at line 38 of file executor.h.

bool tasks::executor::busy ( ) const
inline

Definition at line 34 of file executor.h.

void tasks::executor::run ( )
private

Definition at line 18 of file executor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void tasks::executor::set_busy ( )
inline

Definition at line 36 of file executor.h.

static void tasks::executor::set_timeout ( uint32_t  timeout)
inlinestatic

Definition at line 55 of file executor.h.

Here is the caller graph for this function:

void tasks::executor::terminate ( )
inline

Definition at line 47 of file executor.h.

Here is the caller graph for this function:

bool tasks::executor::terminated ( ) const
inline

Definition at line 53 of file executor.h.

Friends And Related Function Documentation

friend class test_exec
friend

Definition at line 23 of file executor.h.

Member Data Documentation

std::atomic<bool> tasks::executor::m_busy
private

Definition at line 58 of file executor.h.

std::condition_variable tasks::executor::m_cond
private

Definition at line 62 of file executor.h.

std::mutex tasks::executor::m_mutex
private

Definition at line 61 of file executor.h.

exec_task* tasks::executor::m_task = nullptr
private

Definition at line 60 of file executor.h.

std::atomic<bool> tasks::executor::m_term
private

Definition at line 59 of file executor.h.

std::unique_ptr<std::thread> tasks::executor::m_thread
private

Definition at line 64 of file executor.h.

uint32_t tasks::executor::m_timeout = 60
staticprivate

Definition at line 63 of file executor.h.


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