Beatmup
Beatmup::DRM::Device Class Reference

#include <drm.hpp>

Public Member Functions

 Device ()
 
 Device (const char *path)
 
 ~Device ()
 
Deviceoperator= (Device &&other)
 
int getHandle ()
 
 operator bool () const
 

Private Member Functions

 Device (const Device &)=delete
 

Private Attributes

int device
 

Detailed Description

Definition at line 42 of file drm.hpp.

Constructor & Destructor Documentation

◆ Device() [1/3]

Beatmup::DRM::Device::Device ( const Device )
privatedelete

◆ Device() [2/3]

Beatmup::DRM::Device::Device ( )
inline

Definition at line 47 of file drm.hpp.

47 : device(0) {}

◆ Device() [3/3]

Beatmup::DRM::Device::Device ( const char *  path)
inline

Definition at line 49 of file drm.hpp.

49  {
50  device = open(path, O_RDWR | O_CLOEXEC);
51  if (device == 0)
52  throw DRMError(std::string("Cannot open DRM device") + path);
53  }

◆ ~Device()

Beatmup::DRM::Device::~Device ( )
inline

Definition at line 55 of file drm.hpp.

55  {
56  if (device != 0)
57  close(device);
58  }
collection close()

Member Function Documentation

◆ operator=()

Device& Beatmup::DRM::Device::operator= ( Device &&  other)
inline

Definition at line 60 of file drm.hpp.

60  {
61  device = other.device;
62  other.device = 0;
63  return *this;
64  }

◆ getHandle()

int Beatmup::DRM::Device::getHandle ( )
inline

Definition at line 66 of file drm.hpp.

66 { return device; }

◆ operator bool()

Beatmup::DRM::Device::operator bool ( ) const
inline

Definition at line 68 of file drm.hpp.

68  {
69  return device != 0;
70  }

Member Data Documentation

◆ device

int Beatmup::DRM::Device::device
private

Definition at line 45 of file drm.hpp.


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