21#ifndef IO_CONCEPTS_HPP
22#define IO_CONCEPTS_HPP
26#include "platforms/posix/concepts_posix.hpp"
28#include "io/socket/detail/socket.hpp"
39enum struct execution_trigger : std::uint8_t;
50template <
typename Allocator>
52 requires(Allocator alloc,
typename Allocator::value_type *ptr) {
53 { alloc.allocate(0) } -> std::same_as<
decltype(ptr)>;
54 { alloc.deallocate(ptr, 0) } -> std::same_as<void>;
58template <
typename Lock>
60 { lock.lock() } -> std::same_as<void>;
61 { lock.unlock() } -> std::same_as<void>;
67 std::ranges::data(buf);
68 std::ranges::size(buf);
81 typename T::event_type;
82 typename T::interval_type;
83 typename T::size_type;
84 typename T::template is_eager_t<T>;
85 T::template is_eager_v<T>;
94 requires std::is_invocable_v<Fn>;
95 typename std::invoke_result_t<Fn>::value_type;
96 requires std::is_same_v<
97 std::invoke_result_t<Fn>,
98 std::optional<typename std::invoke_result_t<Fn>::value_type>>;
112 typename T::demultiplexer;
113 typename T::template sender<
decltype([]() -> std::optional<int> {
116 mux.set(std::shared_ptr<socket::socket_handle>{},
117 execution::execution_trigger{},
118 []() -> std::optional<int> {
return std::nullopt; });
119 mux.wait_for(
typename T::interval_type{});
126template <
typename Socket>
128 requires std::is_constructible_v<Socket, socket::native_socket_type>;
129 static_cast<socket::native_socket_type
>(Socket{});
136template <
typename Dialog>
138 typename Dialog::executor_type;
147template <
typename Message>
149 requires(Message msg) {
static_cast<socket::socket_message_type
>(msg); };
A concept that checks if a type is an allocator.
Definition concepts.hpp:51
A concept that validates the C++ BasicLockable named requirement.
Definition concepts.hpp:59
Concept for a completion handler.
Definition concepts.hpp:93
Concept for types that behave like a dialog.
Definition concepts.hpp:137
Concept for types that behave like a socket message.
Definition concepts.hpp:148
Concept for a multiplexer.
Definition concepts.hpp:110
Concept for a multiplexer tag.
Definition concepts.hpp:80
A concept that describes a scatter/gather like buffer object.
Definition concepts.hpp:66
Concept for types that behave like a socket.
Definition concepts.hpp:127
This file defines various macros that configure AsyncBerkeley.
The io namespace contains all the functions and classes for the I/O library.
Definition executor.hpp:33