|
SDL3pp
A slim C++ wrapper for SDL3
|
Opaque representation of a computer-readable network address. More...
Public Member Functions | |
| constexpr | Address (AddressRaw resource) noexcept |
| Constructs from raw Address. | |
| constexpr | Address (Address &&other) noexcept |
| Move constructor. | |
| Address (StringParam host) | |
| Resolve a human-readable hostname. | |
| Address (const Address &address) | |
| Add a reference to an Address. | |
| ~Address () | |
| Destructor. | |
| constexpr Address & | operator= (Address &&other) noexcept |
| Assignment operator. | |
| Address & | operator= (const Address &other) |
| Assignment operator. | |
| Public Member Functions inherited from SDL::AddressBase | |
| void | Unref () |
| Drop a reference to an Address. | |
| Status | WaitUntilResolved (Sint32 timeout) |
| Block until an address is resolved. | |
| Status | GetStatus () |
| Check if an address is resolved, without blocking. | |
| const char * | GetString () |
| Get a human-readable string from a resolved address. | |
| const void * | GetBytes (int *num_bytes) |
| Get the protocol-level bytes of a network address from a resolved address. | |
| int | Compare (AddressRef b) const |
| Compare two Address objects. | |
| bool | operator== (const AddressBase &other) const |
| Compares two addresses for equality. | |
| auto | operator<=> (const AddressBase &other) const |
| Compares two addresses. | |
| StreamSocket | CreateClient (Uint16 port, PropertiesRef props) |
| Begin connecting a socket as a client to a remote server. | |
| Server | CreateServer (Uint16 port, PropertiesRef props) |
| Create a server, which listens for connections to accept. | |
| DatagramSocket | CreateDatagramSocket (Uint16 port, PropertiesRef props) |
| Create and bind a new datagram socket. | |
| constexpr | ResourceBaseT ()=default |
| Default constructor, creates null/invalid resource. | |
| constexpr | ResourceBaseT (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | ResourceBaseT (std::nullptr_t) |
| Constructs null/invalid. | |
| constexpr | ResourceBaseT (const ResourceBaseT &)=default |
| Copy constructor. | |
| constexpr | ResourceBaseT (ResourceBaseT &&) noexcept=default |
| Move constructor. | |
| Public Member Functions inherited from SDL::ResourceBaseT< AddressRaw > | |
| constexpr | ResourceBaseT ()=default |
| Default constructor, creates null/invalid resource. | |
| constexpr | operator bool () const |
| Converts to bool. | |
| constexpr auto | operator<=> (const ResourceBaseT &other) const=default |
| Comparison. | |
| constexpr RawConstPointer | operator-> () const noexcept |
| member access to underlying resource pointer. | |
| constexpr RawPointer | get () const noexcept |
| Retrieves underlying resource pointer. | |
| constexpr RawPointer | release () noexcept |
| Retrieves underlying resource pointer and clear this. | |
Static Public Member Functions | |
| static Address | borrow (AddressRaw resource) |
| Safely borrows the from AddressRaw. | |
Additional Inherited Members | |
| Public Types inherited from SDL::ResourceBaseT< AddressRaw > | |
| using | RawPointer |
| The underlying raw pointer type. | |
| using | RawConstPointer |
| The underlying const raw pointer type. | |
| Protected Member Functions inherited from SDL::ResourceBaseT< AddressRaw > | |
| constexpr | ~ResourceBaseT ()=default |
| Destructor. | |
| constexpr ResourceBaseT & | operator= (const ResourceBaseT &)=default |
| Assignment operator. | |
Opaque representation of a computer-readable network address.
This is an opaque datatype, to be treated by the app as a handle.
SDL_net uses these to identify other servers; you use them to connect to a remote machine, and you use them to find out who connected to you. They are also used to decide what network interface to use when creating a server.
These are intended to be protocol-independent; a given address might be for IPv4, IPv6, or something more esoteric. SDL_net attempts to hide the differences.
|
inlineexplicitconstexprnoexcept |
Constructs from raw Address.
| resource | a AddressRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.
|
inlinestatic |