This class represents a task queue in which all tasks are executed one by one.
More...
#include <trantor/utils/SerialTaskQueue.h>
|
| virtual void | runTaskInQueue (const std::function< void()> &task) |
| | Run a task in the queue.
|
| virtual void | runTaskInQueue (std::function< void()> &&task) |
| virtual std::string | getName () const |
| | Get the name of the queue.
|
|
void | waitAllTasksFinished () |
| | Wait until all tasks in the queue are finished.
|
| | SerialTaskQueue (const std::string &name) |
| | Construct a new serial task queue instance.
|
| bool | isRuningTask () |
| | Check whether a task is running in the queue.
|
| bool | isRunningTask () |
| | Check whether a task is running in the queue.
|
| size_t | getTaskCount () |
| | Get the number of tasks in the queue.
|
|
void | stop () |
| | Stop the queue.
|
| void | syncTaskInQueue (const std::function< void()> &task) |
| | Run a task in the queue synchronously. This means that the task is executed before the method returns.
|
|
|
| NonCopyable (const NonCopyable &)=delete |
|
NonCopyable & | operator= (const NonCopyable &)=delete |
|
| NonCopyable (NonCopyable &&) noexcept(true)=default |
|
NonCopyable & | operator= (NonCopyable &&) noexcept(true)=default |
This class represents a task queue in which all tasks are executed one by one.
◆ SerialTaskQueue()
| trantor::SerialTaskQueue::SerialTaskQueue |
( |
const std::string & | name | ) |
|
|
explicit |
Construct a new serial task queue instance.
- Parameters
-
◆ getName()
| virtual std::string trantor::SerialTaskQueue::getName |
( |
| ) |
const |
|
inlinevirtual |
◆ getTaskCount()
| size_t trantor::SerialTaskQueue::getTaskCount |
( |
| ) |
|
Get the number of tasks in the queue.
- Returns
- size_t
◆ isRuningTask()
| bool trantor::SerialTaskQueue::isRuningTask |
( |
| ) |
|
|
inline |
Check whether a task is running in the queue.
- Returns
- true
-
false
- Deprecated
- Use isRunningTask instead
◆ isRunningTask()
| bool trantor::SerialTaskQueue::isRunningTask |
( |
| ) |
|
|
inline |
Check whether a task is running in the queue.
- Returns
- true
-
false
◆ runTaskInQueue() [1/2]
| virtual void trantor::SerialTaskQueue::runTaskInQueue |
( |
const std::function< void()> & | task | ) |
|
|
virtual |
◆ runTaskInQueue() [2/2]
| virtual void trantor::SerialTaskQueue::runTaskInQueue |
( |
std::function< void()> && | task | ) |
|
|
virtual |
The documentation for this class was generated from the following file: