21 #ifndef PLUGINS_USBDMX_WIDGETFACTORY_H_
22 #define PLUGINS_USBDMX_WIDGETFACTORY_H_
164 libusb_device *usb_device,
165 const struct libusb_device_descriptor &descriptor) = 0;
174 libusb_device *usb_device) = 0;
183 template <
typename W
idgetType>
189 libusb_device *device);
213 typedef std::map<libusb_device*, WidgetType*> WidgetMap;
215 WidgetMap m_widget_map;
220 template <
typename W
idgetType>
222 libusb_device *usb_device,
223 WidgetType *widget) {
224 if (!widget->Init()) {
234 WidgetType *old_widget =
STLReplacePtr(&m_widget_map, usb_device, widget);
237 OLA_WARN <<
"Widget conflict for " << usb_device;
244 template <
typename W
idgetType>
246 libusb_device *usb_device) {
247 OLA_INFO <<
"Removing device " << usb_device;
257 #endif // PLUGINS_USBDMX_WIDGETFACTORY_H_