Open Lighting Architecture  Latest Git
Public Member Functions | Protected Member Functions | List of all members
ola::plugin::usbdmx::BaseWidgetFactory< WidgetType > Class Template Reference

Detailed Description

template<typename WidgetType>
class ola::plugin::usbdmx::BaseWidgetFactory< WidgetType >

A partial implementation of WidgetFactory.

This handles the mapping of libusb_devices to widgets and notifying the observer when widgets are added or removed.

Inheritance diagram for ola::plugin::usbdmx::BaseWidgetFactory< WidgetType >:
Inheritance graph
[legend]
Collaboration diagram for ola::plugin::usbdmx::BaseWidgetFactory< WidgetType >:
Collaboration graph
[legend]

Public Member Functions

 BaseWidgetFactory (const std::string &name)
 
std::string Name () const
 The name of this factory. More...
 
- Public Member Functions inherited from ola::plugin::usbdmx::WidgetFactory
virtual bool DeviceAdded (WidgetObserver *observer, libusb_device *usb_device, const struct libusb_device_descriptor &descriptor)=0
 Called when a new USB device is added. More...
 

Protected Member Functions

bool AddWidget (WidgetObserver *observer, WidgetType *widget)
 Initialize a widget and notify the observer. More...
 

Member Function Documentation

◆ AddWidget()

template<typename WidgetType>
bool ola::plugin::usbdmx::BaseWidgetFactory< WidgetType >::AddWidget ( WidgetObserver observer,
WidgetType *  widget 
)
protected

Initialize a widget and notify the observer.

Parameters
observerThe WidgetObserver to notify of the new widget.
widgetthe new Widget, ownership is transferred.
Returns
True if the widget was added, false otherwise.

◆ Name()

template<typename WidgetType>
std::string ola::plugin::usbdmx::BaseWidgetFactory< WidgetType >::Name ( ) const
inlinevirtual

The name of this factory.

Returns
The name of this factory.

Implements ola::plugin::usbdmx::WidgetFactory.


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