19#ifndef MTCORE_THREAD_TRAITS_HPP
20#define MTCORE_THREAD_TRAITS_HPP
40 { t.attempt() } -> std::same_as<Result<void, SelectOptionErrors>>;
41 { ct.prevents_deadlock() } -> std::same_as<bool>;
50 { t.close() } -> std::same_as<void>;
59 concept Sender =
requires(T &t,
const typename T::Message &m) {
88 { t.receive_block() } -> std::same_as<Optional<typename T::Message>>;
96 concept SenderBefore =
requires(T &t,
const std::chrono::time_point<std::chrono::system_clock> &sc) {
105 concept ReceiverBefore =
requires(T &t,
const std::chrono::time_point<std::chrono::system_clock> &sc) {
139 requires(T &t,
const std::chrono::time_point<std::chrono::system_clock> &sc,
Allocator &a) {
149 { T::CHANNEL_CLOSED };
152#define MTCORE_THREAD_TRAIT_ISA(Concept) \
154 template<typename T> \
155 struct Is##Concept; \
156 template<Concept T> \
157 struct Is##Concept<T> : std::true_type {}; \
158 template<typename T> \
159 struct Is##Concept : std::false_type {}; \
232 MTCORE_THREAD_TRAIT_ISA(
Sender);
Represents a type that fulfills the "result" contract while having a success value of a specific type...
Represents a type that fulfills the "result" contract while having no success value Does NOT check th...
Checks if something qualifies as a growing channel Growing channels can:
Checks if something qualifies as a channel Channels can:
Checks if something is closeable (e.g.
Checks if an error type has a "Has Closed" error called CHANNEL_CLOSED.
Checks if messages can be received in a blocking manner with a timeout.
Checks if messages can be received in a blocking manner.
Checks if messages can be received from something (e.g.
Checks if something qualifies as an option to a select statement Allows defining custom options and c...
Checks if messages can be sent to something (e.g.
Checks if messages can be sent in a blocking manner with a timeout.
Checks if messages can be sent to something (e.g.
Checks if messages can be sent in a blocking manner.
Checks if messages can be sent to something (e.g.
Checks if blocking with timeout sends and receives are supported with allocation to grow.
Checks if blocking with timeout sends and receives are supported.
Checks if blocking sends and receives are supported with allocation to grow.
Checks if blocking sends and receives are supported.
Checks if non-blocking sends and receives are supported with allocation to grow.
Checks if non-blocking sends and receives are supported.
Checks if messages can be sent to something (e.g.
SelectOptionErrors
Errors indicating control flow from a select option ATTEMPT_FAILED indicates to try the next option S...
constexpr bool is_sender_receiver_block
Checks if a type can be sent to and received from (blocking)
constexpr bool is_sender_receiver_block_grow
Checks if a type can be sent to and received from (blocking) with growing send.
constexpr bool is_channel_like
Checks if a type is channel-like.
constexpr bool is_receiver_block
Checks if a type can be received from (blocking)
constexpr bool is_sender_receiver_grow
Checks if a type can be sent to and received from with growing send.
constexpr bool is_sender_before_grow
Checks if a type can be sent to (blocking, timeout) with growing.
constexpr bool is_sender_receiver
Checks if a type can be sent to and received from.
constexpr bool is_channel_like_grow
Checks if a type is growing channel-like.
constexpr bool is_receiver
Checks if a type can be received from.
constexpr bool is_select_option
Checks if a type can be used in a select statement as an option.
constexpr bool is_sender_receiver_before_grow
Checks if a type can be sent to and received from (blocking, timeout) with growing send.
constexpr bool is_sender
Checks if a type can be sent to.
constexpr bool has_closed_error
Checks if an error type has a recognized closed error.
constexpr bool is_sender_before
Checks if a type can be sent to (blocking, timeout)
constexpr bool is_sender_receiver_before
Checks if a type can be sent to and received from (blocking, timeout)
constexpr bool is_sender_block
Checks if a type can be sent to (blocking)
constexpr bool is_sender_block_grow
Checks if a type can be sent to (blocking) with growing.
constexpr bool is_closeable
Checks if a type is closeable.
constexpr bool is_receiver_before
Checks if a type can be received from (blocking, timeout)
constexpr bool is_sender_grow
Checks if a type can be sent to with growing.
Thread-related namespace The methods and classes provided by this class are thread-safe Classes and m...
Represents a memory allocator Exact behavior depends on the underlying VTable used Should use the a_*...