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

A callable that creates a job or task. More...

#include <callable.h>

Concept definition

template<typename F, typename T>
std::convertible_to<std::invoke_result_t<F>, std::unique_ptr<T>>
A callable type that can be invoked with given arguments.
Definition callable.h:62
A callable that creates a job or task.
Definition callable.h:240

Detailed Description

A callable that creates a job or task.

Use this concept for factory functions that produce executable tasks.

Example usage:

template<TaskFactory<interfaces::IJob> F>
void schedule_from_factory(F&& factory) {
auto job = factory();
executor.execute(std::move(job));
}

Definition at line 240 of file callable.h.