载入中...
搜索中...
未找到
eve::thread::Task类 参考

A job executed by a ThreadPool worker. Status strings (no enums): "pending" | "running" | "done" | "failed". 更多...

#include <Task.h>

Public 成员函数

 Task (std::function< void()> fn)
 Task.
 
 ~Task ()
 Task.
 
std::string getStatus () const
 Returns the status.
 
bool isDone () const
 True when done.
 
bool hasFailed () const
 True when failed.
 
std::string getError () const
 Returns the error.
 
void wait ()
 Block until the task finishes (done or failed).
 
void run ()
 Run.
 

友元

class ThreadPool
 

详细描述

A job executed by a ThreadPool worker. Status strings (no enums): "pending" | "running" | "done" | "failed".

在文件 Task.h 第 18 行定义.

构造及析构函数说明

◆ Task()

eve::thread::Task::Task ( std::function< void()>  fn)
explicit

Task.

在文件 Task.cpp 第 8 行定义.

引用了 fn.

◆ ~Task()

eve::thread::Task::~Task ( )
default

Task.

成员函数说明

◆ getError()

std::string eve::thread::Task::getError ( ) const

Returns the error.

在文件 Task.cpp 第 33 行定义.

◆ getStatus()

std::string eve::thread::Task::getStatus ( ) const

Returns the status.

在文件 Task.cpp 第 18 行定义.

◆ hasFailed()

bool eve::thread::Task::hasFailed ( ) const

True when failed.

在文件 Task.cpp 第 28 行定义.

◆ isDone()

bool eve::thread::Task::isDone ( ) const

True when done.

在文件 Task.cpp 第 23 行定义.

◆ run()

void eve::thread::Task::run ( )

Run.

在文件 Task.cpp 第 44 行定义.

引用了 run().

被这些函数引用 run().

◆ wait()

void eve::thread::Task::wait ( )

Block until the task finishes (done or failed).

在文件 Task.cpp 第 38 行定义.

引用了 state.

友元及相关函数文档

◆ ThreadPool

friend class ThreadPool
friend

在文件 Task.h 第 59 行定义.


该类的文档由以下文件生成: