Skip to content

Engine → Core → job_handle.h

jobs::job_handle

Syntax

class CONJURE_API job_handle

Constructors

AccessSignatureDescription
publicjob_handle() noexcept = default;
publicexplicit 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().
publicjob_handle( const job_handle &) = default;
publicjob_handle( job_handle &&) noexcept = default;

Destructors

AccessSignatureDescription
public~job_handle() = default;

Variables

AccessNameTypeDefaultDescription
privatemCounterstd::shared_ptr<detail::job_counter>nullptr

Functions

Public

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

[[nodiscard]] bool is_valid() const noexcept;

True when this handle refers to scheduled work. False for a default-constructed or reset handle.

pending

[[nodiscard]] u64 pending() const noexcept;

Number of jobs behind this handle that have not finished yet. 0 for an invalid handle.

reset

void reset() noexcept;

Drops the reference and makes the handle invalid. The jobs themselves still run.

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=

job_handle &operator=(
    const job_handle &) = default;
job_handle &operator=(
    job_handle &&) noexcept = default;

operator==

[[nodiscard]] bool operator==(
    const job_handle &other) const noexcept;

Two handles are equal when they observe the same counter (or are both invalid).