26 template<
typename T,
typename =
void>
39 template<
typename T,
typename =
void>
52 template<
typename Job>
60 using type = std::conditional_t<
62 decltype(std::declval<T>().priority()),
67 template<
typename Job>
73 template<
typename Job,
typename ExpectedJobType>
76 template<
typename Job,
typename ExpectedJobType>
78 static constexpr bool value =
81 std::is_same_v<job_type_t<Job>, ExpectedJobType>;
84 template<
typename Job,
typename ExpectedJobType>
94 template<
typename R,
typename... Args>
98 static constexpr size_t arity =
sizeof...(Args);
102 template<
typename C,
typename R,
typename... Args>
107 static constexpr size_t arity =
sizeof...(Args);
111 template<
typename C,
typename R,
typename... Args>
116 static constexpr size_t arity =
sizeof...(Args);
131 for (
size_t i = 0; i < N; ++i) {
136 constexpr operator const char*()
const {
return data; }
137 constexpr size_t size()
const {
return N - 1; }
147 return "generated_job";
153 template<JobType T,
typename Comparator = std::less<>>
161 return comp(traits::to_underlying(lhs), traits::to_underlying(rhs));
168 template<
bool Condition>
171 using type = std::conditional_t<Condition, T, void>;
179 static constexpr size_t size =
sizeof...(Types);
181 template<
size_t Index>
182 using at = std::tuple_element_t<Index, std::tuple<std::integral_constant<Types, Types>...>>;
184 static constexpr std::array<std::common_type_t<Types...>,
size>
values = {Types...};
192 template<
typename Job>
211 template<
typename Job>
213 [](
void* ptr) {
static_cast<Job*
>(ptr)->do_work(); },
214 [](
void* ptr) {
static_cast<Job*
>(ptr)->~Job(); }
224 template<
typename JobType,
typename... Args>
226 return std::forward_as_tuple(std::forward<Args>(args)...);
232 template<
typename Job, JobType ExpectedType>
235 "Job type must have a priority() method");
237 "Job type must have a do_work() method");
238 static_assert(std::is_same_v<job_type_t<Job>, ExpectedType>,
239 "Job priority type must match expected type");
Type erasure helper for heterogeneous job storage.
static constexpr vtable_t vtable_for
Represents a unit of work (task) to be executed, typically by a job queue.
typename job_type_extractor< Job >::type job_type_t
constexpr bool is_compatible_job_v
constexpr bool has_priority_method_v
constexpr bool has_do_work_method_v
constexpr auto generate_job_name()
Template for automatic job naming based on function signature.
constexpr auto make_job_args(Args &&... args)
Perfect forwarding helper for job construction.
Template for conditional compilation based on feature flags.
std::conditional_t< Condition, T, void > type
Constexpr string utilities for compile-time job naming.
constexpr constexpr_string(const char(&str)[N])
constexpr size_t size() const
std::tuple< Args... > argument_types
std::tuple< Args... > argument_types
std::tuple< Args... > argument_types
Type trait for function signature analysis.
SFINAE helper to detect if a type has a do_work method.
SFINAE helper to detect if a type has a specific member function.
Compile-time job validation.
Variadic template helper for job type lists.
static constexpr std::array< std::common_type_t< Types... >, size > values
static constexpr size_t size
std::tuple_element_t< Index, std::tuple< std::integral_constant< Types, Types >... > > at
Type traits for job types.
Compile-time job validation with detailed error messages.
static constexpr bool value
Priority comparison helper with custom comparison functions.
constexpr bool operator()(T lhs, T rhs) const
constexpr priority_comparator(Comparator c={})
Type traits for typed_thread_pool module.