Eclipse SUMO - Simulation of Urban MObility
|
#include <TaskQueue.h>
Public Types | |
using | TaskPtrType = std::unique_ptr< TaskBase< C > > |
Public Member Functions | |
bool | isEnabled () const |
template<typename TaskT > | |
auto | push (TaskT &&task) -> std::future< decltype(task(std::declval< C >()))> |
void | setEnabled (bool enabled) |
TaskQueue ()=default | |
bool | tryPop (TaskPtrType &task) |
template<typename TaskT > | |
auto | tryPush (TaskT &&task, bool &success) -> std::future< decltype(task(std::declval< C >()))> |
bool | waitAndPop (TaskPtrType &task) |
~TaskQueue ()=default | |
Private Types | |
using | LockType = std::unique_lock< std::mutex > |
Private Member Functions | |
TaskQueue & | operator= (const TaskQueue &)=delete |
TaskQueue (const TaskQueue &)=delete | |
Private Attributes | |
bool | myEnabled = true |
std::mutex | myMutex |
std::queue< TaskPtrType > | myQueue |
std::condition_variable | myReady |
Definition at line 56 of file TaskQueue.h.
|
private |
Definition at line 57 of file TaskQueue.h.
Definition at line 60 of file TaskQueue.h.
|
default |
|
privatedelete |
|
inline |
Definition at line 74 of file TaskQueue.h.
References TaskQueue< C >::myEnabled, and TaskQueue< C >::myMutex.
|
privatedelete |
|
inline |
Definition at line 91 of file TaskQueue.h.
References TaskQueue< C >::myMutex, TaskQueue< C >::myQueue, and TaskQueue< C >::myReady.
|
inline |
Definition at line 64 of file TaskQueue.h.
References TaskQueue< C >::myEnabled, TaskQueue< C >::myMutex, and TaskQueue< C >::myReady.
|
inline |
Definition at line 104 of file TaskQueue.h.
References TaskQueue< C >::myEnabled, TaskQueue< C >::myMutex, and TaskQueue< C >::myQueue.
|
inline |
Definition at line 115 of file TaskQueue.h.
References TaskQueue< C >::myMutex, TaskQueue< C >::myQueue, and TaskQueue< C >::myReady.
|
inline |
Definition at line 79 of file TaskQueue.h.
References TaskQueue< C >::myEnabled, TaskQueue< C >::myMutex, TaskQueue< C >::myQueue, and TaskQueue< C >::myReady.
|
private |
Definition at line 139 of file TaskQueue.h.
Referenced by TaskQueue< C >::isEnabled(), TaskQueue< C >::setEnabled(), TaskQueue< C >::tryPop(), and TaskQueue< C >::waitAndPop().
|
mutableprivate |
Definition at line 140 of file TaskQueue.h.
Referenced by TaskQueue< C >::isEnabled(), TaskQueue< C >::push(), TaskQueue< C >::setEnabled(), TaskQueue< C >::tryPop(), TaskQueue< C >::tryPush(), and TaskQueue< C >::waitAndPop().
|
private |
Definition at line 138 of file TaskQueue.h.
Referenced by TaskQueue< C >::push(), TaskQueue< C >::tryPop(), TaskQueue< C >::tryPush(), and TaskQueue< C >::waitAndPop().
|
private |
Definition at line 141 of file TaskQueue.h.
Referenced by TaskQueue< C >::push(), TaskQueue< C >::setEnabled(), TaskQueue< C >::tryPush(), and TaskQueue< C >::waitAndPop().