Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::concepts Namespace Referenceexport

Classes

struct  callable_return_type
 Type trait to extract return type from a callable. More...
 
struct  callable_return_type< F, std::enable_if_t< std::is_invocable_v< F > > >
 
struct  has_get_method
 SFINAE helper to detect if a type has a get() method. More...
 
struct  has_get_method< T, std::void_t< decltype(std::declval< T >().get())> >
 
struct  has_wait_method
 SFINAE helper to detect if a type has a wait() method. More...
 
struct  has_wait_method< T, std::void_t< decltype(std::declval< T >().wait())> >
 
struct  is_duration
 Type trait to detect if a type is a std::chrono::duration. More...
 
struct  is_duration< std::chrono::duration< Rep, Period > >
 
struct  is_future_like
 Type trait to detect future-like types (has get() and wait() methods) More...
 
struct  is_nothrow_callable
 Helper to check if a callable is noexcept. More...
 
struct  is_valid_job_type
 SFINAE helper for JobType validation. More...
 
struct  is_valid_job_type< T, std::enable_if_t< JobType< T > > >
 

Typedefs

template<typename F >
using callable_return_type_t = typename callable_return_type<F>::type
 

Variables

template<typename T >
constexpr bool is_duration_v = is_duration<T>::value
 
template<typename T >
constexpr bool has_get_method_v = has_get_method<T>::value
 
template<typename T >
constexpr bool has_wait_method_v = has_wait_method<T>::value
 
template<typename T >
constexpr bool is_future_like_v = is_future_like<T>::value
 
template<typename F >
constexpr bool Callable = std::is_invocable_v<F>
 Fallback for Callable concept.
 
template<typename F >
constexpr bool VoidCallable
 Fallback for VoidCallable concept.
 
template<typename F >
constexpr bool ReturningCallable
 Fallback for ReturningCallable concept.
 
template<typename F , typename... Args>
constexpr bool CallableWith = std::is_invocable_v<F, Args...>
 Fallback for CallableWith concept.
 
template<typename T >
constexpr bool Duration = is_duration_v<T>
 Fallback for Duration concept.
 
template<typename T >
constexpr bool FutureLike = is_future_like_v<T>
 Fallback for FutureLike concept.
 
template<typename T >
constexpr bool JobType
 Fallback for JobType concept.
 
template<typename F >
constexpr bool JobCallable
 Fallback for JobCallable concept.
 
template<typename Job >
constexpr bool PoolJob
 Fallback for PoolJob concept.
 
template<typename T >
constexpr bool is_valid_job_type_v = is_valid_job_type<T>::value
 
template<typename F >
constexpr bool is_nothrow_callable_v = is_nothrow_callable<F>::value
 

Typedef Documentation

◆ callable_return_type_t

template<typename F >
using kcenon::thread::concepts::callable_return_type_t = typename callable_return_type<F>::type

Definition at line 101 of file thread_concepts.h.

Variable Documentation

◆ Callable

template<typename F >
bool kcenon::thread::concepts::Callable = std::is_invocable_v<F>
inlineconstexpr

Fallback for Callable concept.

Definition at line 192 of file thread_concepts.h.

◆ CallableWith

template<typename F , typename... Args>
bool kcenon::thread::concepts::CallableWith = std::is_invocable_v<F, Args...>
inlineconstexpr

Fallback for CallableWith concept.

Definition at line 212 of file thread_concepts.h.

◆ Duration

template<typename T >
bool kcenon::thread::concepts::Duration = is_duration_v<T>
inlineconstexpr

Fallback for Duration concept.

Definition at line 218 of file thread_concepts.h.

◆ FutureLike

template<typename T >
bool kcenon::thread::concepts::FutureLike = is_future_like_v<T>
inlineconstexpr

Fallback for FutureLike concept.

Definition at line 224 of file thread_concepts.h.

◆ has_get_method_v

template<typename T >
bool kcenon::thread::concepts::has_get_method_v = has_get_method<T>::value
inlineconstexpr

Definition at line 63 of file thread_concepts.h.

◆ has_wait_method_v

template<typename T >
bool kcenon::thread::concepts::has_wait_method_v = has_wait_method<T>::value
inlineconstexpr

Definition at line 76 of file thread_concepts.h.

◆ is_duration_v

template<typename T >
bool kcenon::thread::concepts::is_duration_v = is_duration<T>::value
inlineconstexpr

Definition at line 50 of file thread_concepts.h.

◆ is_future_like_v

template<typename T >
bool kcenon::thread::concepts::is_future_like_v = is_future_like<T>::value
inlineconstexpr

Definition at line 85 of file thread_concepts.h.

◆ is_nothrow_callable_v

template<typename F >
bool kcenon::thread::concepts::is_nothrow_callable_v = is_nothrow_callable<F>::value
inlineconstexpr

Definition at line 275 of file thread_concepts.h.

◆ is_valid_job_type_v

template<typename T >
bool kcenon::thread::concepts::is_valid_job_type_v = is_valid_job_type<T>::value
inlineconstexpr

Definition at line 266 of file thread_concepts.h.

◆ JobCallable

template<typename F >
bool kcenon::thread::concepts::JobCallable
inlineconstexpr
Initial value:
= std::is_invocable_v<F> &&
(std::is_void_v<std::invoke_result_t<F>> ||
std::is_same_v<std::invoke_result_t<F>, bool> ||
std::is_convertible_v<std::invoke_result_t<F>, std::string>)

Fallback for JobCallable concept.

Definition at line 237 of file thread_concepts.h.

◆ JobType

template<typename T >
bool kcenon::thread::concepts::JobType
inlineconstexpr
Initial value:
= std::is_enum_v<T> ||
(std::is_integral_v<T> && !std::is_same_v<T, bool>)

Fallback for JobType concept.

Definition at line 230 of file thread_concepts.h.

◆ PoolJob

template<typename Job >
bool kcenon::thread::concepts::PoolJob
inlineconstexpr
Initial value:
= Callable<Job> &&
(VoidCallable<Job> ||
std::is_convertible_v<callable_return_type_t<Job>, bool>)

Fallback for PoolJob concept.

Definition at line 246 of file thread_concepts.h.

◆ ReturningCallable

template<typename F >
bool kcenon::thread::concepts::ReturningCallable
inlineconstexpr
Initial value:
= std::is_invocable_v<F> &&
!std::is_void_v<std::invoke_result_t<F>>

Fallback for ReturningCallable concept.

Definition at line 205 of file thread_concepts.h.

◆ VoidCallable

template<typename F >
bool kcenon::thread::concepts::VoidCallable
inlineconstexpr
Initial value:
= std::is_invocable_v<F> &&
std::is_void_v<std::invoke_result_t<F>>

Fallback for VoidCallable concept.

Definition at line 198 of file thread_concepts.h.