Ream v0.1.0-1
C++ graphics library for Linux
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
RDRMPlatformHandle Class Reference

Platform handle for the DRM platform. More...

#include <RDRMPlatformHandle.h>

+ Inheritance diagram for RDRMPlatformHandle:

Public Member Functions

const std::unordered_set< RDRMFdHandle > & fds () const noexcept
 Returns the set of internally duplicated DRM file descriptors.
 
 ~RDRMPlatformHandle () noexcept
 Closes all internally duplicated DRM file descriptors.
 
- Public Member Functions inherited from RPlatformHandle
RPlatform platform () const noexcept
 Returns the platform this handle belongs to.
 
RWLPlatformHandleasWL () noexcept
 Casts this handle to a Wayland platform handle.
 
RDRMPlatformHandleasDRM () noexcept
 Casts this handle to a DRM platform handle.
 
- Public Member Functions inherited from RObject
 RObject ()=default
 Constructs a default RObject.
 

Static Public Member Functions

static std::shared_ptr< RDRMPlatformHandleMake (const std::unordered_set< RDRMFdHandle > &fds) noexcept
 Creates a DRM platform handle from a set of DRM device file descriptors.
 

Detailed Description

Platform handle for the DRM platform.

An RPlatformHandle implementation (see RPlatformHandle) whose platform() is RPlatform::DRM. It holds the set of DRM device file descriptors a client is allowed to use.

Use Make() to create an instance.

Constructor & Destructor Documentation

◆ ~RDRMPlatformHandle()

~RDRMPlatformHandle ( )
noexcept

Closes all internally duplicated DRM file descriptors.

Member Function Documentation

◆ Make()

static std::shared_ptr< RDRMPlatformHandle > Make ( const std::unordered_set< RDRMFdHandle > &  fds)
staticnoexcept

Creates a DRM platform handle from a set of DRM device file descriptors.

Each file descriptor is duplicated internally (with F_DUPFD_CLOEXEC), so the caller retains ownership of the passed descriptors. Handles that fail to duplicate are skipped.

Parameters
fdsA non-empty set of DRM file descriptors (with associated user data).
Returns
A shared pointer to the created handle, or nullptr if fds is empty or none of the descriptors could be duplicated.

◆ fds()

const std::unordered_set< RDRMFdHandle > & fds ( ) const
inlinenoexcept

Returns the set of internally duplicated DRM file descriptors.