|
AsyncBerkeley
Asynchronous Berkeley sockets. Simple.
|
Represents a platform-independent socket address. More...
#include <io/socket/socket_address.hpp>
Public Types | |
| using | Base = socket_option< Addr > |
| The base class for the socket address. | |
Public Types inherited from io::socket::socket_option< T > | |
| using | value_type = std::decay_t< T > |
| The type of the socket option value. | |
| using | size_type = std::size_t |
| The size type for the socket option. | |
Public Member Functions | |
| template<socklen_type Size = sizeof(Addr)> requires (Size <= sizeof(Addr)) | |
| socket_address (const sockaddr_type *addr, socklen_type size=Size) noexcept | |
| Constructs a socket_address from a raw socket address structure. | |
| template<SocketAddress OtherAddr> | |
| socket_address (const socket_address< OtherAddr > &other) noexcept | |
| Constructs a socket_address from another socket_address. | |
Public Member Functions inherited from io::socket::socket_option< T > | |
| template<size_type Size = sizeof(value_type)> requires (Size <= sizeof(value_type)) | |
| constexpr | socket_option (size_type size=Size) noexcept |
| Constructs a socket_option with a given size. | |
| socket_option (const socket_option &)=default | |
| Default copy constructor. | |
| socket_option (socket_option &&)=default | |
| Default move constructor. | |
| socket_option (const value_type &val) noexcept | |
| Constructs a socket_option from a value. | |
| template<size_type Size> requires (Size <= sizeof(value_type) || Size == std::dynamic_extent) | |
| socket_option (std::span< const std::byte, Size > option) noexcept | |
| Constructs a socket_option from a span of bytes. | |
| template<size_type Size> requires (Size <= sizeof(value_type) || Size == std::dynamic_extent) | |
| socket_option (std::span< std::byte, Size > option) noexcept | |
| Constructs a socket_option from a span of bytes. | |
| auto | operator= (const socket_option &) -> socket_option &=default |
| Default copy assignment operator. | |
| auto | operator= (socket_option &&) -> socket_option &=default |
| Default move assignment operator. | |
| ~socket_option ()=default | |
| Default destructor. | |
| constexpr auto | operator* () noexcept -> value_type & |
| Dereferences the socket option to its value. | |
| constexpr auto | operator-> () noexcept -> value_type * |
| Accesses the socket option's value. | |
| constexpr auto | begin () noexcept -> std::byte * |
| Gets an iterator to the beginning of the option's byte representation. | |
| constexpr auto | begin () const noexcept -> const std::byte * |
| Gets a const iterator to the beginning of the option's byte representation. | |
| constexpr auto | end () noexcept -> std::byte * |
| Gets an iterator to the end of the option's byte representation. | |
| constexpr auto | end () const noexcept -> const std::byte * |
| Gets a const iterator to the end of the option's byte representation. | |
| auto | operator<=> (const socket_option &other) const noexcept -> bool |
| Compares this socket_option with another for ordering. | |
| auto | operator== (const socket_option &other) const noexcept -> bool |
| Compares two socket_option objects for equality. | |
Represents a platform-independent socket address.
This class inherits from socket_option to provide a generic way to handle different socket address types.
|
inlinenoexcept |
Constructs a socket_address from a raw socket address structure.
| Size | The size of the socket address structure. |
| addr | A pointer to the raw socket address structure. |
| size | The size of the socket address structure. |
|
inlinenoexcept |
Constructs a socket_address from another socket_address.
| OtherAddr | The type of the other socket address. |
| other | The other socket_address to construct from. |