#include <task.h>
Public Types | |
enum | State { NEW, DISPATCHED, DEPENDENCIES_COMPLETED, RUNNING, COMPLETED } |
Public Member Functions | |
void | AddDependency (std::weak_ptr< Task > dependency) LOCKS_EXCLUDED(mutex_) |
State | GetState () LOCKS_EXCLUDED(mutex_) |
void | SetWorkItem (const WorkItem &work_item) LOCKS_EXCLUDED(mutex_) |
Task () | |
~Task () | |
Private Member Functions | |
void | AddDependentTask (Task *dependent_task) |
void | Execute () LOCKS_EXCLUDED(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) LOCKS_EXCLUDED(mutex_) |
Private Attributes | |
absl::Mutex | mutex_ |
Friends | |
class | ThreadPoolInterface |
void cartographer::common::Task::AddDependency | ( | std::weak_ptr< Task > | dependency | ) |
void cartographer::common::Task::AddDependentTask | ( | Task * | dependent_task | ) | [private] |
void cartographer::common::Task::Execute | ( | ) | [private] |
WorkItem work_item_ cartographer::common::Task::GUARDED_BY | ( | mutex_ | ) | [private] |
ThreadPoolInterface* thread_pool_to_notify_ cartographer::common::Task::GUARDED_BY | ( | mutex_ | ) | [private] |
State state_ cartographer::common::Task::GUARDED_BY | ( | mutex_ | ) | [private] |
unsigned int uncompleted_dependencies_ cartographer::common::Task::GUARDED_BY | ( | mutex_ | ) | [private, pure virtual] |
std::set<Task*> dependent_tasks_ cartographer::common::Task::GUARDED_BY | ( | mutex_ | ) | [private] |
void cartographer::common::Task::OnDependenyCompleted | ( | ) | [private] |
void cartographer::common::Task::SetThreadPool | ( | ThreadPoolInterface * | thread_pool | ) | [private] |
void cartographer::common::Task::SetWorkItem | ( | const WorkItem & | work_item | ) |
friend class ThreadPoolInterface [friend] |
absl::Mutex cartographer::common::Task::mutex_ [private] |