Kanzi 4.0.0-beta2
kanzi::wayland::WaylandOptionalHandle< NativeHandle, deleter > Class Template Reference

Represents a generic Wayland handle with managed lifetime. More...

#include <kanzi/core.ui/platform/windowing_ng/wayland/wayland_optional_handle.hpp>

Inheritance diagram for kanzi::wayland::WaylandOptionalHandle< NativeHandle, deleter >:
[legend]

Public Member Functions

KZ_NO_DISCARD wl_proxygetNativeProxy () const noexcept
 Gets the underlying native Wayland proxy.
 

Static Public Member Functions

static KZ_NO_DISCARD wl_proxygetNativeProxy (NativeHandle handle) noexcept
 Gets the underlying native Wayland proxy.
 

Static Public Attributes

static const wl_interface s_nativeInterface
 Represents the underlying native interface.
 

Additional Inherited Members

- Protected Types inherited from kanzi::OptionalHandle< NativeHandle, nullptr, deleter >
using HandleType
 Alias for this handle type.
 
using NativeHandleType
 Alias for the underlying native handle type.
 
- Protected Member Functions inherited from kanzi::OptionalHandle< NativeHandle, nullptr, deleter >
KZ_NO_DISCARD optional< NativeHandle > createOptional () const noexcept
 Creates a kanzi::optional copy of the native handle.
 
KZ_NO_DISCARD const NativeHandle get () const noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD NativeHandle get () noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD const NativeHandle getNativeHandle () const noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD NativeHandle getNativeHandle () noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD bool hasValue () const noexcept
 Checks if a handle is stored.
 
KZ_NO_DISCARD operator bool () const noexcept
 Conversion operator to bool.
 
KZ_NO_DISCARD NativeHandle && operator* () &&noexcept
 Provides access to stored handle via rvalue reference.
 
KZ_NO_DISCARD NativeHandle & operator* () &noexcept
 Provides access to stored handle via reference.
 
KZ_NO_DISCARD const NativeHandle && operator* () const &&noexcept
 Provides access to stored handle via const rvalue reference.
 
KZ_NO_DISCARD const NativeHandle & operator* () const &noexcept
 Provides access to stored handle via const reference.
 
OptionalHandleoperator= (const NativeHandle &value)
 Copy assignment operator.
 
OptionalHandleoperator= (const OptionalHandle &other)=delete
 Copy assignment operator.
 
OptionalHandleoperator= (NativeHandle &&value) noexcept
 Move assignment operator.
 
OptionalHandleoperator= (OptionalHandle &&other) noexcept
 Move assignment operator.
 
 OptionalHandle () noexcept
 Constructor.
 
 OptionalHandle (const NativeHandle &nativeHandle) noexcept
 Constructor.
 
 OptionalHandle (const OptionalHandle &other)=delete
 Copy constructor.
 
 OptionalHandle (OptionalHandle &&other) noexcept
 Move constructor.
 
NativeHandle release () noexcept
 Releases ownership of a native handle without destroying the resource.
 
void reset () noexcept
 Replaces stored handle with sentinel value.
 
void reset (U &&newHandle) noexcept
 Stores a new handle inside.
 
void swap (OptionalHandle &other)
 Swap function.
 
KZ_NO_DISCARD optional< NativeHandle > toOptional () &&noexcept
 Converts OptionalHandle to kanzi::optional.
 
 ~OptionalHandle ()
 Destructor.
 
- Static Protected Member Functions inherited from kanzi::OptionalHandle< NativeHandle, nullptr, deleter >
static constexpr auto getDeleter () noexcept
 Gets deleter function.
 
static constexpr NativeHandle getSentinel () noexcept
 Gets sentinel value that can be used to represent invalid handle.
 
- Protected Attributes inherited from kanzi::OptionalHandle< NativeHandle, nullptr, deleter >
FlatOptional< NativeHandle, sentinel > m_handle
 Native handle that is managed by this class.
 

Detailed Description

template<typename NativeHandle, auto deleter>
class kanzi::wayland::WaylandOptionalHandle< NativeHandle, deleter >

Represents a generic Wayland handle with managed lifetime.

Uses CRTP pattern. The user is encouraged to derive from it and pass itself as a template parameter.

Template Parameters
NativeHandleNative Wayland handle type.
deleterDeleter function for the handle.
Since
Kanzi 3.9.8
Kanzi 4.0.0 inherits from OptionalHandle and accepts deleter as a template parameter.

Member Function Documentation

◆ getNativeProxy() [1/2]

template<typename NativeHandle , auto deleter>
static KZ_NO_DISCARD wl_proxy * kanzi::wayland::WaylandOptionalHandle< NativeHandle, deleter >::getNativeProxy ( NativeHandle handle)
inlinestaticnoexcept

Gets the underlying native Wayland proxy.

Parameters
handleNative handle to get Wayland proxy for.
Returns
Native Wayland proxy.

◆ getNativeProxy() [2/2]

template<typename NativeHandle , auto deleter>
KZ_NO_DISCARD wl_proxy * kanzi::wayland::WaylandOptionalHandle< NativeHandle, deleter >::getNativeProxy ( ) const
inlinenoexcept

Gets the underlying native Wayland proxy.

Returns
Native Wayland proxy.

Member Data Documentation

◆ s_nativeInterface

template<typename NativeHandle , auto deleter>
const wl_interface kanzi::wayland::WaylandOptionalHandle< NativeHandle, deleter >::s_nativeInterface
static

Represents the underlying native interface.


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