#include <task_manager.h>
|
virtual | ~TaskManager () |
|
void | Shutdown () |
|
template<typename F , typename... Args> |
auto | Enqueue (F &&func, Args &&... args) -> std::future< typename std::result_of< F(Args...)>::type > |
|
◆ ~TaskManager()
apollo::cyber::TaskManager::~TaskManager |
( |
| ) |
|
|
virtual |
◆ Enqueue()
template<typename F , typename... Args>
auto apollo::cyber::TaskManager::Enqueue |
( |
F && |
func, |
|
|
Args &&... |
args |
|
) |
| -> std::future<typename std::result_of<F(Args...)>::type> |
|
inline |
在文件 task_manager.h 第 41 行定义.
42 {
43 using return_type = typename std::result_of<F(Args...)>::type;
44 auto task = std::make_shared<std::packaged_task<return_type()>>(
45 std::bind(std::forward<F>(func), std::forward<Args>(args)...));
46 if (!stop_.load()) {
47 task_queue_->Enqueue([task]() { (*task)(); });
48 for (auto& task : tasks_) {
50 }
51 }
52 std::future<return_type> res(task->get_future());
53 return res;
54 }
bool NotifyTask(uint64_t crid)
◆ Shutdown()
void apollo::cyber::TaskManager::Shutdown |
( |
| ) |
|
在文件 task_manager.cc 第 63 行定义.
63 {
64 if (stop_.exchange(true)) {
65 return;
66 }
67 for (uint32_t i = 0; i < num_threads_; i++) {
69 }
70}
virtual bool RemoveTask(const std::string &name)=0
该类的文档由以下文件生成: