Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::JobLike Concept Referenceexport

A type that satisfies the Job interface requirements. More...

#include <callable.h>

Concept definition

template<typename T>
concept kcenon::common::concepts::JobLike = requires(T t) {
{ t.execute() };
{ t.get_name() } -> std::convertible_to<std::string>;
{ t.get_priority() } -> std::convertible_to<int>;
}
A type that satisfies the Job interface requirements.
Definition callable.h:193

Detailed Description

A type that satisfies the Job interface requirements.

Types satisfying this concept can be executed by an executor, providing name and priority information for scheduling.

Example usage:

template<JobLike J>
void schedule(std::unique_ptr<J> job) {
std::cout << "Scheduling job: " << job->get_name()
<< " with priority " << job->get_priority() << std::endl;
job->execute();
}

Definition at line 193 of file callable.h.