Class JobBase¶
Defined in File job.h
Inheritance Relationships¶
Derived Types¶
public portal::Job< Result >(Template Class Job)public portal::Job< void >(Template Class Job< void >)
Class Documentation¶
-
class JobBase¶
Base class for Job<T> providing type-erased job handle.
Move-only. Jobs must be dispatched to scheduler before destruction.
Subclassed by portal::Job< Result >, portal::Job< void >
Public Types
-
using handle_type = std::coroutine_handle<JobPromise>¶
Public Functions
-
inline JobBase(const handle_type handle)¶
-
inline virtual ~JobBase()¶
-
inline auto operator co_await() noexcept¶
-
void set_dispatched()¶
Mark job as dispatched to scheduler (prevents double-free on destruction).
-
void set_scheduler(jobs::Scheduler *scheduler_ptr) const noexcept¶
Set the scheduler for this job.
- Parameters:
scheduler_ptr – Pointer to the owning scheduler
-
void set_counter(jobs::Counter *counter_ptr) const noexcept¶
Set the counter to decrement on completion.
- Parameters:
counter_ptr – Pointer to the synchronization counter
-
inline bool is_dispatched() const noexcept¶
-
inline bool is_completed() const noexcept¶
Public Members
-
handle_type handle¶
-
using handle_type = std::coroutine_handle<JobPromise>¶