Task queue for the thread pool.
More...
#include <TaskQueue.h>
|
|
using | SizeType = Tasks::size_type |
| | Size type of the task queue.
|
|
|
| TaskQueue () |
| | Default constructor for TaskQueue.
|
| | ~TaskQueue () |
| | Destructor for the TaskQueue class.
|
| SizeType | maxSize () const |
| | Returns the maximum possible size of a task queue.
|
| SizeType | size () const |
| | Returns the current size of the task queue.
|
| bool | isEmpty () const |
| | Returns true if the task queue has no elements.
|
| void | push (Task task) |
| | Adding a task to the end of the task queue.
|
| Task | pop () |
| | Returns the task from the front of the task queue.
|
| void | clear () |
| | Removing all tasks from the task queue.
|
| void | swap (TaskQueue &tq) noexcept |
| | Swapping the contents of two task queues.
|
|
|
using | Tasks = std::deque<Task> |
| | FIFO container for tasks.
|
|
|
Tasks | tasks_ |
| | FIFO container for the contained tasks.
|
Task queue for the thread pool.
The TaskQueue class represents the internal task container of a thread pool. It uses a FIFO (first in, first out) strategy to store and remove the assigned tasks.
◆ ~TaskQueue()
| blaze::threadpool::TaskQueue::~TaskQueue |
( |
| ) |
|
|
inline |
Destructor for the TaskQueue class.
The destructor destroys any remaining task in the task queue.
◆ clear()
| void blaze::threadpool::TaskQueue::clear |
( |
| ) |
|
|
inline |
Removing all tasks from the task queue.
- Returns
- void
◆ isEmpty()
| bool blaze::threadpool::TaskQueue::isEmpty |
( |
| ) |
const |
|
inline |
Returns true if the task queue has no elements.
- Returns
- true if the task queue is empty, false if it is not.
◆ maxSize()
Returns the maximum possible size of a task queue.
- Returns
- The maximum possible size.
◆ pop()
| Task blaze::threadpool::TaskQueue::pop |
( |
| ) |
|
|
inline |
Returns the task from the front of the task queue.
- Returns
- The first task in the task queue.
◆ push()
| void blaze::threadpool::TaskQueue::push |
( |
Task | task | ) |
|
|
inline |
Adding a task to the end of the task queue.
- Parameters
-
| task | The task to be added to the end of the task queue. |
- Returns
- void
This function adds the given task to the end of the task queue. It runs in constant time.
◆ size()
Returns the current size of the task queue.
- Returns
- The current size.
This function returns the number of the currently contained tasks.
◆ swap()
| void blaze::threadpool::TaskQueue::swap |
( |
TaskQueue & | tq | ) |
|
|
inlinenoexcept |
Swapping the contents of two task queues.
- Parameters
-
| tq | The task queue to be swapped. |
- Returns
- void
- Exceptions
-
The documentation for this class was generated from the following file: