Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::jobs::job_interface Class Referenceabstract

Interface for executable job objects. More...

#include <job_types.h>

Collaboration diagram for kcenon::thread::jobs::job_interface:
Collaboration graph

Public Member Functions

virtual ~job_interface ()=default
 
virtual bool execute ()=0
 Execute the job.
 
virtual job_priority priority () const =0
 Get the priority of this job.
 
virtual job_state state () const =0
 Get the current state of this job.
 
virtual std::string description () const =0
 Get a description of this job (for debugging/logging)
 
virtual bool cancel ()=0
 Cancel the job if it hasn't started executing yet.
 

Detailed Description

Interface for executable job objects.

This interface defines the contract that all job objects must follow. It provides a clean abstraction for work units that can be scheduled and executed by thread pools.

Definition at line 46 of file job_types.h.

Constructor & Destructor Documentation

◆ ~job_interface()

virtual kcenon::thread::jobs::job_interface::~job_interface ( )
virtualdefault

Member Function Documentation

◆ cancel()

virtual bool kcenon::thread::jobs::job_interface::cancel ( )
pure virtual

Cancel the job if it hasn't started executing yet.

Returns
true if job was cancelled, false if already running/completed

◆ description()

virtual std::string kcenon::thread::jobs::job_interface::description ( ) const
nodiscardpure virtual

Get a description of this job (for debugging/logging)

Returns
Human-readable job description

◆ execute()

virtual bool kcenon::thread::jobs::job_interface::execute ( )
pure virtual

Execute the job.

Returns
true if execution was successful, false otherwise

◆ priority()

virtual job_priority kcenon::thread::jobs::job_interface::priority ( ) const
nodiscardpure virtual

Get the priority of this job.

Returns
Job priority level

◆ state()

virtual job_state kcenon::thread::jobs::job_interface::state ( ) const
nodiscardpure virtual

Get the current state of this job.

Returns
Current job state

The documentation for this class was generated from the following file: