#include <task.hpp>
|
| struct | State |
| | Heap-resident bookkeeping for a single task. More...
|
| |
◆ TaskHandle() [1/4]
| threadman::TaskHandle::TaskHandle |
( |
const std::uint64_t |
id, |
|
|
const std::uint64_t |
pool_id, |
|
|
std::optional< std::string > |
name = std::nullopt |
|
) |
| |
|
inlineexplicit |
Construct a handle owning a freshly-allocated State.
◆ TaskHandle() [2/4]
| threadman::TaskHandle::TaskHandle |
( |
| ) |
|
|
default |
◆ TaskHandle() [3/4]
| threadman::TaskHandle::TaskHandle |
( |
const TaskHandle & |
| ) |
|
|
default |
◆ TaskHandle() [4/4]
| threadman::TaskHandle::TaskHandle |
( |
TaskHandle && |
| ) |
|
|
defaultnoexcept |
◆ ~TaskHandle()
| threadman::TaskHandle::~TaskHandle |
( |
| ) |
|
|
default |
◆ display_info()
| static const comms::DisplayInfo & threadman::TaskHandle::display_info |
( |
| ) |
|
|
inlinestatic |
◆ id()
| std::uint64_t threadman::TaskHandle::id |
( |
| ) |
const |
|
inlinenoexcept |
◆ mark_cancelled()
| void threadman::TaskHandle::mark_cancelled |
( |
const std::exception_ptr & |
ex = nullptr | ) |
const |
|
inline |
Transition any non-terminal state → Cancelled and stamp finished_at.
◆ mark_completed()
| void threadman::TaskHandle::mark_completed |
( |
| ) |
const |
|
inline |
Transition Running → Completed and stamp finished_at = now.
◆ mark_failed()
| void threadman::TaskHandle::mark_failed |
( |
const std::exception_ptr & |
ex | ) |
const |
|
inline |
Transition Running → Failed and stamp finished_at = now.
The caller is responsible for stashing the exception_ptr separately if it wants users of the snapshot to see failed=true.
◆ mark_running()
| void threadman::TaskHandle::mark_running |
( |
| ) |
const |
|
inline |
Transition Queued → Running and stamp started_at = now.
◆ name()
| std::optional< std::string > threadman::TaskHandle::name |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pool_id()
| std::uint64_t threadman::TaskHandle::pool_id |
( |
| ) |
const |
|
inlinenoexcept |
◆ raw()
| std::shared_ptr< State > threadman::TaskHandle::raw |
( |
| ) |
const |
|
inlinenoexcept |
Direct access to the shared state; used by the pool/future internals.
◆ snapshot()
Consistent snapshot of the task's state.
◆ state()
| TaskState threadman::TaskHandle::state |
( |
| ) |
const |
|
inlinenoexcept |
◆ valid()
| bool threadman::TaskHandle::valid |
( |
| ) |
const |
|
inlinenoexcept |
True iff this handle owns a state.
The documentation for this class was generated from the following file: