Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::interfaces::IJob Interface Referenceabstractexport

Abstract job interface for task execution. More...

#include <executor_interface.h>

Inheritance diagram for kcenon::common::interfaces::IJob:
Inheritance graph
Collaboration diagram for kcenon::common::interfaces::IJob:
Collaboration graph

Public Member Functions

virtual ~IJob ()=default
 
virtual VoidResult execute ()=0
 Execute the job.
 
virtual std::string get_name () const
 Get the name of the job (for logging/debugging)
 
virtual int get_priority () const
 Get the priority of the job (higher = more important)
 
virtual ~IJob ()=default
 
virtual VoidResult execute ()=0
 Execute the job.
 
virtual std::string get_name () const
 Get the name of the job.
 
virtual int get_priority () const
 Get the priority of the job.
 

Detailed Description

Abstract job interface for task execution.

Phase 2: Job-based execution support for better control and testability

Examples
executor_example.cpp.

Definition at line 49 of file executor.cppm.

Constructor & Destructor Documentation

◆ ~IJob() [1/2]

virtual kcenon::common::interfaces::IJob::~IJob ( )
virtualdefault

◆ ~IJob() [2/2]

virtual kcenon::common::interfaces::IJob::~IJob ( )
exportvirtualdefault

Member Function Documentation

◆ execute() [1/2]

virtual VoidResult kcenon::common::interfaces::IJob::execute ( )
pure virtual

Execute the job.

Returns
VoidResult indicating success or failure

Implemented in calculation_job, and function_job.

◆ execute() [2/2]

virtual VoidResult kcenon::common::interfaces::IJob::execute ( )
exportpure virtual

Execute the job.

Returns
VoidResult indicating success or failure

Implemented in calculation_job, and function_job.

◆ get_name() [1/2]

virtual std::string kcenon::common::interfaces::IJob::get_name ( ) const
inlinevirtual

Get the name of the job (for logging/debugging)

Returns
Job name

Implemented in calculation_job, and function_job.

Definition at line 46 of file executor_interface.h.

46{ return "unnamed_job"; }

◆ get_name() [2/2]

virtual std::string kcenon::common::interfaces::IJob::get_name ( ) const
inlineexportvirtual

Get the name of the job.

Returns
Job name

Implemented in calculation_job, and function_job.

Definition at line 63 of file executor.cppm.

63{ return "unnamed_job"; }

◆ get_priority() [1/2]

virtual int kcenon::common::interfaces::IJob::get_priority ( ) const
inlinevirtual

Get the priority of the job (higher = more important)

Returns
Job priority (default: 0)

Implemented in calculation_job.

Definition at line 52 of file executor_interface.h.

52{ return 0; }

◆ get_priority() [2/2]

virtual int kcenon::common::interfaces::IJob::get_priority ( ) const
inlineexportvirtual

Get the priority of the job.

Returns
Job priority (default: 0)

Implemented in calculation_job.

Definition at line 69 of file executor.cppm.

69{ return 0; }

The documentation for this interface was generated from the following files: