Antkeeper  0.0.1
Public Member Functions | List of all members
input::device Class Referenceabstract

Abstract base class for virtual devices that generate input events. More...

#include <device.hpp>

Inheritance diagram for input::device:
input::gamepad input::keyboard input::mouse

Public Member Functions

void connect ()
 Simulates the device being connected. More...
 
void disconnect ()
 Simulates the device being disconnected. More...
 
bool is_connected () const noexcept
 Returns true if the device is currently connected. More...
 
void set_uuid (const ::uuid &id)
 Sets the universally unique identifier (UUID) of this input device. More...
 
const ::uuidget_uuid () const noexcept
 Returns the universally unique identifier (UUID) of this input device. More...
 
::event::channel< device_connected_event > & get_connected_channel () noexcept
 Returns the channel through which device connected events are published. More...
 
::event::channel< device_disconnected_event > & get_disconnected_channel () noexcept
 Returns the channel through which device disconnected events are published. More...
 
virtual constexpr device_type get_device_type () const noexcept=0
 Returns the input device type. More...
 

Detailed Description

Abstract base class for virtual devices that generate input events.

Definition at line 35 of file device.hpp.

Member Function Documentation

◆ connect()

void input::device::connect ( )

Simulates the device being connected.

Definition at line 24 of file device.cpp.

◆ disconnect()

void input::device::disconnect ( )

Simulates the device being disconnected.

Note
Disconnected devices can still generate input events.

Definition at line 30 of file device.cpp.

◆ get_connected_channel()

::event::channel<device_connected_event>& input::device::get_connected_channel ( )
inlinenoexcept

Returns the channel through which device connected events are published.

Definition at line 70 of file device.hpp.

◆ get_device_type()

virtual constexpr device_type input::device::get_device_type ( ) const
constexprpure virtualnoexcept

Returns the input device type.

Implemented in input::mouse, input::keyboard, and input::gamepad.

◆ get_disconnected_channel()

::event::channel<device_disconnected_event>& input::device::get_disconnected_channel ( )
inlinenoexcept

Returns the channel through which device disconnected events are published.

Definition at line 76 of file device.hpp.

◆ get_uuid()

const ::uuid& input::device::get_uuid ( ) const
inlinenoexcept

Returns the universally unique identifier (UUID) of this input device.

Definition at line 64 of file device.hpp.

◆ is_connected()

bool input::device::is_connected ( ) const
inlinenoexcept

Returns true if the device is currently connected.

Definition at line 51 of file device.hpp.

◆ set_uuid()

void input::device::set_uuid ( const ::uuid id)

Sets the universally unique identifier (UUID) of this input device.

Parameters
idUUID.

Definition at line 36 of file device.cpp.


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