Public Member Functions | Protected Member Functions | List of all members
SurgSim::Input::DeviceInterface Class Referenceabstract

Interface used to communicate with user-interface hardware devices. More...

#include <SurgSim/Input/DeviceInterface.h>

Inheritance diagram for SurgSim::Input::DeviceInterface:
SurgSim::Device::MultiAxisDevice SurgSim::Input::CommonDevice LabJackToPoseFilter SurgSim::Device::ForceScale SurgSim::Device::IdentityPoseDevice SurgSim::Device::KeyboardDevice SurgSim::Device::LabJackDevice SurgSim::Device::MouseDevice SurgSim::Device::NovintCommonDevice SurgSim::Device::PhantomDevice SurgSim::Device::PoseIntegrator SurgSim::Device::PoseTransform SurgSim::Device::RawMultiAxisDevice SurgSim::Device::SixenseDevice SurgSim::Device::TrackIRDevice

Public Member Functions

virtual ~DeviceInterface ()
 Virtual destructor (empty). More...
 
virtual std::string getName () const =0
 Return a (hopefully unique) device name. More...
 
virtual bool initialize ()=0
 Fully initialize the device. More...
 
virtual bool addInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer)=0
 Adds an input consumer that will be notified when the application input state is updated. More...
 
virtual bool removeInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer)=0
 Removes an input consumer previously added via addInputConsumer. More...
 
virtual bool setOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer)=0
 Sets an output producer that will be asked for application output state when the device needs it. More...
 
virtual bool removeOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer)=0
 Removes an output producer previously added via setOutputProducer. More...
 
virtual bool hasOutputProducer ()=0
 Query if this object has output producer. More...
 

Protected Member Functions

virtual bool finalize ()=0
 Finalize (de-initialize) the device. More...
 

Detailed Description

Interface used to communicate with user-interface hardware devices.

Classes that implement communication with a hardware device implement this interface. This includes input/output devices (haptic devices are the most obvious example, but many other devices can, for example, display visual indicators such as LEDs, etc.), as well as input-only and output-only devices.

Derived classes will likely want to hide their constructor and only allow creation through a manager object for that type of device.

Constructor & Destructor Documentation

virtual SurgSim::Input::DeviceInterface::~DeviceInterface ( )
inlinevirtual

Virtual destructor (empty).

Member Function Documentation

virtual bool SurgSim::Input::DeviceInterface::addInputConsumer ( std::shared_ptr< InputConsumerInterface inputConsumer)
pure virtual

Adds an input consumer that will be notified when the application input state is updated.

Parameters
inputConsumerThe input consumer to be added.
Returns
true on success, false on failure.

Implemented in SurgSim::Device::MultiAxisDevice, SurgSim::Input::CommonDevice, and SurgSim::Device::IdentityPoseDevice.

virtual bool SurgSim::Input::DeviceInterface::finalize ( )
protectedpure virtual
virtual std::string SurgSim::Input::DeviceInterface::getName ( ) const
pure virtual

Return a (hopefully unique) device name.

Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.

virtual bool SurgSim::Input::DeviceInterface::hasOutputProducer ( )
pure virtual

Query if this object has output producer.

Returns
true if there is an output producer, false if not.

Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.

virtual bool SurgSim::Input::DeviceInterface::initialize ( )
pure virtual
virtual bool SurgSim::Input::DeviceInterface::removeInputConsumer ( std::shared_ptr< InputConsumerInterface inputConsumer)
pure virtual

Removes an input consumer previously added via addInputConsumer.

Parameters
inputConsumerThe input consumer to be removed.

Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.

virtual bool SurgSim::Input::DeviceInterface::removeOutputProducer ( std::shared_ptr< OutputProducerInterface outputProducer)
pure virtual

Removes an output producer previously added via setOutputProducer.

Parameters
outputProducerThe output producer to be removed.

Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.

virtual bool SurgSim::Input::DeviceInterface::setOutputProducer ( std::shared_ptr< OutputProducerInterface outputProducer)
pure virtual

Sets an output producer that will be asked for application output state when the device needs it.

Any previously set output producer will be removed.

Parameters
outputProducerThe output producer to be added.
Returns
true on success, false on failure.

Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.


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