Engine → Core → job_handle.h
jobs::job_handle
| Type | Class |
| Namespace | conjure::core::jobs |
| Include File Path | engine/include/conjure/core/jobs/job_handle.h |
| Source File Path | engine/src/core/jobs/job_handle.cpp |
| API ↗ | Jobs and threading |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | job_handle() noexcept = default; | |
| public | explicit job_handle(
std::shared_ptr<detail::job_counter> counter) noexcept; | Wraps an existing counter. Used by the job system; callers obtain handles from job_system::schedule(). |
| public | job_handle(
const job_handle &) = default; | |
| public | job_handle(
job_handle &&) noexcept = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~job_handle() = default; |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mCounter | std:: | nullptr |
Functions
Public
is_complete
is_complete[[nodiscard]] bool is_complete() const noexcept;True when every job behind this handle has finished executing. An invalid handle is always complete.
is_valid
is_valid[[nodiscard]] bool is_valid() const noexcept;True when this handle refers to scheduled work. False for a default-constructed or reset handle.
pending
pending[[nodiscard]] u64 pending() const noexcept;Number of jobs behind this handle that have not finished yet. 0 for an invalid handle.
reset
resetvoid reset() noexcept;Drops the reference and makes the handle invalid. The jobs themselves still run.
valid
valid[[deprecated("use is_valid()")]] [[nodiscard]] bool valid() const noexcept;The former name of is_valid(), kept for one wave; returns is_valid().
Operator Overloads
Public
operator=
operator=job_handle &operator=(
const job_handle &) = default;job_handle &operator=(
job_handle &&) noexcept = default;operator==
operator==[[nodiscard]] bool operator==(
const job_handle &other) const noexcept;Two handles are equal when they observe the same counter (or are both invalid).