FlightGear next
FGInputDevice Class Referenceabstract

#include <FGEventInput.hxx>

Inherits SGReferenced.

Inherited by FGLinuxInputDevice.

Public Member Functions

 FGInputDevice ()
 
 FGInputDevice (std::string aName, std::string aSerial={})
 
virtual ~FGInputDevice ()
 
virtual bool Open ()=0
 
virtual void Close ()=0
 
virtual void Send (const char *eventName, double value)=0
 
void Send (const std::string &eventName, double value)
 
virtual void SendFeatureReport (unsigned int reportId, const std::string &data)
 
virtual const char * TranslateEventName (FGEventData &eventData)=0
 
void SetName (std::string name)
 
std::string & GetName ()
 
void SetUniqueName (const std::string &name)
 
const std::string GetUniqueName () const
 
void SetSerialNumber (std::string serial)
 
std::string & GetSerialNumber ()
 
void HandleEvent (FGEventData &eventData)
 
virtual void AddHandledEvent (FGInputEvent_ptr handledEvent)
 
virtual void Configure (SGPropertyNode_ptr deviceNode)
 
virtual void update (double dt)
 
bool GetDebugEvents () const
 
bool GetGrab () const
 
const std::string & GetNasalModule () const
 

Public Attributes

std::string class_id = "FGInputDevice"
 

Protected Attributes

std::map< std::string, FGInputEvent_ptrhandledEvents
 
std::string name
 
std::string serialNumber
 
bool debugEvents = false
 
bool grab = false
 
SGPropertyNode_ptr deviceNode
 
SGPropertyNode_ptr lastEventName
 
SGPropertyNode_ptr lastEventValue
 
std::string nasalModule
 
report_setting_list_t reportSettings
 
std::string _uniqueName
 name, but with suffix / serial appended.
 

Detailed Description

Definition at line 213 of file FGEventInput.hxx.

Constructor & Destructor Documentation

◆ FGInputDevice() [1/2]

FGInputDevice::FGInputDevice ( )
inline

Definition at line 216 of file FGEventInput.hxx.

◆ FGInputDevice() [2/2]

FGInputDevice::FGInputDevice ( std::string aName,
std::string aSerial = {} )
inline

Definition at line 217 of file FGEventInput.hxx.

◆ ~FGInputDevice()

FGInputDevice::~FGInputDevice ( )
virtual

Definition at line 254 of file FGEventInput.cxx.

Member Function Documentation

◆ AddHandledEvent()

void FGInputDevice::AddHandledEvent ( FGInputEvent_ptr handledEvent)
virtual

Definition at line 313 of file FGEventInput.cxx.

◆ Close()

virtual void FGInputDevice::Close ( )
pure virtual

Implemented in FGLinuxInputDevice.

◆ Configure()

void FGInputDevice::Configure ( SGPropertyNode_ptr deviceNode)
virtual

Definition at line 270 of file FGEventInput.cxx.

◆ GetDebugEvents()

bool FGInputDevice::GetDebugEvents ( ) const
inline

Definition at line 253 of file FGEventInput.hxx.

◆ GetGrab()

bool FGInputDevice::GetGrab ( ) const
inline

Definition at line 255 of file FGEventInput.hxx.

◆ GetName()

std::string & FGInputDevice::GetName ( )
inline

Definition at line 237 of file FGEventInput.hxx.

◆ GetNasalModule()

const std::string & FGInputDevice::GetNasalModule ( ) const
inline

Definition at line 257 of file FGEventInput.hxx.

◆ GetSerialNumber()

std::string & FGInputDevice::GetSerialNumber ( )
inline

Definition at line 243 of file FGEventInput.hxx.

◆ GetUniqueName()

const std::string FGInputDevice::GetUniqueName ( ) const
inline

Definition at line 240 of file FGEventInput.hxx.

◆ HandleEvent()

void FGInputDevice::HandleEvent ( FGEventData & eventData)

Definition at line 335 of file FGEventInput.cxx.

◆ Open()

virtual bool FGInputDevice::Open ( )
pure virtual

Implemented in FGLinuxInputDevice.

◆ Send() [1/2]

virtual void FGInputDevice::Send ( const char * eventName,
double value )
pure virtual

Implemented in FGLinuxInputDevice.

◆ Send() [2/2]

void FGInputDevice::Send ( const std::string & eventName,
double value )
inline

Definition at line 227 of file FGEventInput.hxx.

◆ SendFeatureReport()

void FGInputDevice::SendFeatureReport ( unsigned int reportId,
const std::string & data )
virtual

Definition at line 364 of file FGEventInput.cxx.

◆ SetName()

void FGInputDevice::SetName ( std::string name)

Definition at line 349 of file FGEventInput.cxx.

◆ SetSerialNumber()

void FGInputDevice::SetSerialNumber ( std::string serial)

Definition at line 359 of file FGEventInput.cxx.

◆ SetUniqueName()

void FGInputDevice::SetUniqueName ( const std::string & name)

Definition at line 354 of file FGEventInput.cxx.

◆ TranslateEventName()

virtual const char * FGInputDevice::TranslateEventName ( FGEventData & eventData)
pure virtual

Implemented in FGLinuxInputDevice.

◆ update()

void FGInputDevice::update ( double dt)
virtual

Definition at line 321 of file FGEventInput.cxx.

Member Data Documentation

◆ _uniqueName

std::string FGInputDevice::_uniqueName
protected

name, but with suffix / serial appended.

This is important when loading the device multiple times, to ensure the Nasal module is unique

Definition at line 290 of file FGEventInput.hxx.

◆ class_id

std::string FGInputDevice::class_id = "FGInputDevice"

Definition at line 258 of file FGEventInput.hxx.

◆ debugEvents

bool FGInputDevice::debugEvents = false
protected

Definition at line 272 of file FGEventInput.hxx.

◆ deviceNode

SGPropertyNode_ptr FGInputDevice::deviceNode
protected

Definition at line 279 of file FGEventInput.hxx.

◆ grab

bool FGInputDevice::grab = false
protected

Definition at line 276 of file FGEventInput.hxx.

◆ handledEvents

std::map<std::string,FGInputEvent_ptr> FGInputDevice::handledEvents
protected

Definition at line 261 of file FGEventInput.hxx.

◆ lastEventName

SGPropertyNode_ptr FGInputDevice::lastEventName
protected

Definition at line 280 of file FGEventInput.hxx.

◆ lastEventValue

SGPropertyNode_ptr FGInputDevice::lastEventValue
protected

Definition at line 281 of file FGEventInput.hxx.

◆ name

std::string FGInputDevice::name
protected

Definition at line 264 of file FGEventInput.hxx.

◆ nasalModule

std::string FGInputDevice::nasalModule
protected

Definition at line 283 of file FGEventInput.hxx.

◆ reportSettings

report_setting_list_t FGInputDevice::reportSettings
protected

Definition at line 285 of file FGEventInput.hxx.

◆ serialNumber

std::string FGInputDevice::serialNumber
protected

Definition at line 268 of file FGEventInput.hxx.


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