#include <task.h>
Public Types | |
enum | State { NEW, DISPATCHED, DEPENDENCIES_COMPLETED, RUNNING, COMPLETED } |
using | WorkItem = std::function< void()> |
Public Member Functions | |
void | AddDependency (std::weak_ptr< Task > dependency) EXCLUDES(mutex_) |
State | GetState () EXCLUDES(mutex_) |
void | SetWorkItem (const WorkItem &work_item) EXCLUDES(mutex_) |
Task ()=default | |
~Task () | |
Private Member Functions | |
void | AddDependentTask (Task *dependent_task) |
void | Execute () EXCLUDES(mutex_) |
WorkItem work_item_ | GUARDED_BY (mutex_) |
ThreadPoolInterface *thread_pool_to_notify_ | GUARDED_BY (mutex_) |
State state_ | GUARDED_BY (mutex_) |
unsigned int uncompleted_dependencies_ | GUARDED_BY (mutex_)=0 |
std::set< Task * > dependent_tasks_ | GUARDED_BY (mutex_) |
void | OnDependenyCompleted () |
void | SetThreadPool (ThreadPoolInterface *thread_pool) EXCLUDES(mutex_) |
Private Attributes | |
Mutex | mutex_ |
Friends | |
class | ThreadPoolInterface |
using cartographer::common::Task::WorkItem = std::function<void()> |
|
default |
void cartographer::common::Task::AddDependency | ( | std::weak_ptr< Task > | dependency | ) |
|
private |
Task::State cartographer::common::Task::GetState | ( | ) |
|
private |
|
privatepure virtual |
|
private |
|
private |
void cartographer::common::Task::SetWorkItem | ( | const WorkItem & | work_item | ) |
|
friend |