KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LIBSPNAV_DRIVER Class Reference

#include <libspnav_driver.h>

Inheritance diagram for LIBSPNAV_DRIVER:
SPACENAV_DRIVER

Public Member Functions

 LIBSPNAV_DRIVER ()
 
 ~LIBSPNAV_DRIVER ()
 
bool Connect () override
 Connect to the device.
 
void Disconnect () override
 Disconnect from the device.
 
void Poll () override
 Poll for pending events and dispatch them to the handler.
 
void SetHandler (SPACEMOUSE_HANDLER *aHandler)
 

Protected Attributes

SPACEMOUSE_HANDLERm_handler = nullptr
 

Private Attributes

bool m_client_connected = false
 

Static Private Attributes

static std::mutex s_mutex
 
static int s_connection_count = 0
 
static bool s_spnav_connected = false
 

Detailed Description

Definition at line 36 of file libspnav_driver.h.

Constructor & Destructor Documentation

◆ LIBSPNAV_DRIVER()

LIBSPNAV_DRIVER::LIBSPNAV_DRIVER ( )

Definition at line 34 of file libspnav_driver.cpp.

◆ ~LIBSPNAV_DRIVER()

LIBSPNAV_DRIVER::~LIBSPNAV_DRIVER ( )

Definition at line 38 of file libspnav_driver.cpp.

References Disconnect().

Member Function Documentation

◆ Connect()

bool LIBSPNAV_DRIVER::Connect ( )
overridevirtual

Connect to the device.

Returns true on success.

Implements SPACENAV_DRIVER.

Definition at line 43 of file libspnav_driver.cpp.

References m_client_connected, s_connection_count, s_mutex, and s_spnav_connected.

◆ Disconnect()

void LIBSPNAV_DRIVER::Disconnect ( )
overridevirtual

Disconnect from the device.

Implements SPACENAV_DRIVER.

Definition at line 64 of file libspnav_driver.cpp.

References m_client_connected, s_connection_count, s_mutex, and s_spnav_connected.

Referenced by ~LIBSPNAV_DRIVER().

◆ Poll()

void LIBSPNAV_DRIVER::Poll ( )
overridevirtual

Poll for pending events and dispatch them to the handler.

Implements SPACENAV_DRIVER.

Definition at line 82 of file libspnav_driver.cpp.

References m_client_connected, SPACENAV_DRIVER::m_handler, s_mutex, and s_spnav_connected.

◆ SetHandler()

void SPACENAV_DRIVER::SetHandler ( SPACEMOUSE_HANDLER * aHandler)
inlineinherited

Definition at line 54 of file spacenav_driver.h.

References m_handler.

Member Data Documentation

◆ m_client_connected

bool LIBSPNAV_DRIVER::m_client_connected = false
private

Definition at line 52 of file libspnav_driver.h.

Referenced by Connect(), Disconnect(), and Poll().

◆ m_handler

SPACEMOUSE_HANDLER* SPACENAV_DRIVER::m_handler = nullptr
protectedinherited

Definition at line 57 of file spacenav_driver.h.

Referenced by LIBSPNAV_DRIVER::Poll(), and SetHandler().

◆ s_connection_count

int LIBSPNAV_DRIVER::s_connection_count = 0
staticprivate

Definition at line 49 of file libspnav_driver.h.

Referenced by Connect(), and Disconnect().

◆ s_mutex

std::mutex LIBSPNAV_DRIVER::s_mutex
staticprivate

Definition at line 48 of file libspnav_driver.h.

Referenced by Connect(), Disconnect(), and Poll().

◆ s_spnav_connected

bool LIBSPNAV_DRIVER::s_spnav_connected = false
staticprivate

Definition at line 50 of file libspnav_driver.h.

Referenced by Connect(), Disconnect(), and Poll().


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