Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
cartographer::common::testing::ThreadPoolForTesting Class Reference

#include <thread_pool_for_testing.h>

Inheritance diagram for cartographer::common::testing::ThreadPoolForTesting:
Inheritance graph
[legend]

Public Member Functions

std::weak_ptr< TaskSchedule (std::unique_ptr< Task > task) EXCLUDES(mutex_) override
 
 ThreadPoolForTesting ()
 
void WaitUntilIdle ()
 
 ~ThreadPoolForTesting ()
 
- Public Member Functions inherited from cartographer::common::ThreadPoolInterface
 ThreadPoolInterface ()
 
virtual ~ThreadPoolInterface ()
 

Private Member Functions

void DoWork ()
 
bool running_ GUARDED_BY (mutex_)
 
bool idle_ GUARDED_BY (mutex_)
 
std::deque< std::shared_ptr< Task > > task_queue_ GUARDED_BY (mutex_)
 
std::map< Task *, std::shared_ptr< Task > > tasks_not_ready_ GUARDED_BY (mutex_)
 
std::thread thread_ GUARDED_BY (mutex_)
 
void NotifyDependenciesCompleted (Task *task) EXCLUDES(mutex_) override
 

Private Attributes

Mutex mutex_
 

Friends

class Task
 

Additional Inherited Members

- Protected Member Functions inherited from cartographer::common::ThreadPoolInterface
void Execute (Task *task)
 
void SetThreadPool (Task *task)
 

Detailed Description

Definition at line 32 of file thread_pool_for_testing.h.

Constructor & Destructor Documentation

◆ ThreadPoolForTesting()

cartographer::common::testing::ThreadPoolForTesting::ThreadPoolForTesting ( )

Definition at line 33 of file thread_pool_for_testing.cc.

◆ ~ThreadPoolForTesting()

cartographer::common::testing::ThreadPoolForTesting::~ThreadPoolForTesting ( )

Definition at line 36 of file thread_pool_for_testing.cc.

Member Function Documentation

◆ DoWork()

void cartographer::common::testing::ThreadPoolForTesting::DoWork ( )
private

Definition at line 83 of file thread_pool_for_testing.cc.

◆ GUARDED_BY() [1/5]

bool running_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [2/5]

bool idle_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [3/5]

std::deque<std::shared_ptr<Task> > task_queue_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [4/5]

std::map<Task*, std::shared_ptr<Task> > tasks_not_ready_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY ( mutex_  )
private

◆ GUARDED_BY() [5/5]

std::thread thread_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY ( mutex_  )
private

◆ NotifyDependenciesCompleted()

void cartographer::common::testing::ThreadPoolForTesting::NotifyDependenciesCompleted ( Task task)
overrideprivatevirtual

◆ Schedule()

std::weak_ptr< Task > cartographer::common::testing::ThreadPoolForTesting::Schedule ( std::unique_ptr< Task task)
overridevirtual

◆ WaitUntilIdle()

void cartographer::common::testing::ThreadPoolForTesting::WaitUntilIdle ( )

Definition at line 71 of file thread_pool_for_testing.cc.

Friends And Related Function Documentation

◆ Task

friend class Task
friend

Definition at line 43 of file thread_pool_for_testing.h.

Member Data Documentation

◆ mutex_

Mutex cartographer::common::testing::ThreadPoolForTesting::mutex_
private

Definition at line 49 of file thread_pool_for_testing.h.


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


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:59