21#ifndef IO_SOCKET_MESSAGE_HPP
22#define IO_SOCKET_MESSAGE_HPP
23#include "detail/socket.hpp"
47 [[nodiscard]]
explicit operator socket_message_type() noexcept;
56template <
AllocatorLike Allocator = std::allocator<native_buffer_type>>
60 using buffer_type = std::vector<native_buffer_type, Allocator>;
62 using iterator =
typename buffer_type::iterator;
73 noexcept(Allocator()));
90 constexpr auto push_back(const Buf &buf) ->
void;
96 constexpr auto push_back(native_buffer_type buf) ->
void;
105 template <typename... Args>
106 constexpr auto emplace_back(Args &&...args) -> decltype(auto);
109 [[nodiscard]] constexpr auto begin() noexcept ->
iterator;
116 [[nodiscard]] constexpr auto end() noexcept ->
iterator;
122 [[nodiscard]] constexpr auto size() const noexcept ->
size_type;
125 [[nodiscard]] constexpr auto empty() const noexcept ->
bool;
131 [[nodiscard]] explicit constexpr operator
bool() const noexcept;
154template <SocketAddress Addr = sockaddr_storage_type,
159 Allocator>::template rebind_alloc<native_buffer_type>;
162 std::allocator_traits<Allocator>::template rebind_alloc<std::byte>;
185 [[nodiscard]] explicit operator socket_message_type() noexcept;
190#include "impl/socket_message_impl.hpp"
A container for managing buffers for scatter-gather I/O operations.
Definition socket_message.hpp:57
typename buffer_type::const_iterator const_iterator
Constant iterator for the buffer.
Definition socket_message.hpp:64
std::vector< native_buffer_type, Allocator > buffer_type
The underlying buffer type.
Definition socket_message.hpp:60
message_buffer(const Allocator &alloc=Allocator()) noexcept(noexcept(Allocator()))
Construct message buffer with a custom allocator.
typename buffer_type::iterator iterator
Iterator for the buffer.
Definition socket_message.hpp:62
typename buffer_type::size_type size_type
Size type for the buffer.
Definition socket_message.hpp:66
A concept that checks if a type is an allocator.
Definition concepts.hpp:51
A concept that describes a scatter/gather like buffer object.
Definition concepts.hpp:59
The io::socket namespace provides a cross-platform abstraction for socket-level I/O operations.
Definition poll_multiplexer.hpp:36
Defines the socket_address class for platform-independent socket address management.
Represents a complete socket message.
Definition socket_message.hpp:156
std::vector< std::byte, control_allocator > control_type
The control buffer type.
Definition socket_message.hpp:168
std::optional< socket_address< Addr > > address_type
The socket address type.
Definition socket_message.hpp:164
address_type address
Optional address of the sender/receiver.
Definition socket_message.hpp:171
std::allocator_traits< Allocator >::template rebind_alloc< std::byte > control_allocator
The allocator type for control data.
Definition socket_message.hpp:162
message_type buffers
Buffers for scatter/gather I/O.
Definition socket_message.hpp:174
control_type control
Ancillary data (control information).
Definition socket_message.hpp:177
std::allocator_traits< Allocator >::template rebind_alloc< native_buffer_type > message_allocator
The allocator type for message buffers.
Definition socket_message.hpp:159