SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches

The data provided for new incoming packets from ReceiveDatagram(). More...

Inheritance diagram for SDL::Datagram:
[legend]

Public Member Functions

constexpr Datagram (DatagramRaw resource) noexcept
 Constructs from raw Datagram.
constexpr Datagram (Datagram &&other) noexcept
 Move constructor.
 Datagram (DatagramSocketRef sock)
 Receive a new packet that a remote system sent to a datagram socket.
 ~Datagram ()
 Destructor.
constexpr Datagramoperator= (Datagram &&other) noexcept
 Assignment operator.
Public Member Functions inherited from SDL::DatagramBase
constexpr operator DatagramConstRef () const noexcept
 Converts to DatagramConstRef.
void Destroy ()
 Dispose of a datagram packet previously received.
bool Receive (DatagramSocketRef sock)
 Receive a new packet that a remote system sent to a 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< DatagramRaw, DatagramRawConst >
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.

Additional Inherited Members

Public Types inherited from SDL::ResourceBaseT< DatagramRaw, DatagramRawConst >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< DatagramRaw, DatagramRawConst >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

The data provided for new incoming packets from ReceiveDatagram().

Since
This datatype is available since SDL_net 3.0.0.
See also
ReceiveDatagram
DestroyDatagram
Category:
Resource

Constructor & Destructor Documentation

◆ Datagram()

SDL::Datagram::Datagram ( DatagramRaw resource)
inlineexplicitconstexprnoexcept

Constructs from raw Datagram.

Parameters
resourcea DatagramRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.


The documentation for this struct was generated from the following file: