iScanEngineDeviceList.h
1 #pragma once
2 
3 #include <boost/system/error_code.hpp>
4 #include <list>
5 
6 #include "iScanEngineDevice.h"
7 
8 namespace dpyImagerscanengine {
9 
10 typedef enum
11 {
12  ADDED = 0,
13  REMOVED = 1,
14 } ListEvent;
15 
16 struct UsbDevice
17 {
18  int devNumber;
19  uint16_t idVendor;
20  uint16_t idProduct;
21 
22  bool operator<(const UsbDevice &rhs) const
23  {
24  return devNumber < rhs.devNumber;
25  }
26 };
27 
28 }
29 
36 {
37 public:
43  virtual void listEvent(boost::shared_ptr<IScanEngineDevice> scanner, dpyImagerscanengine::ListEvent event) = 0;
44 
49  {
50  }
51 };
52 
58 {
59 private:
60  std::vector<ScanEngineDeviceListObserver*> mObserversList;
61 
62 protected:
63  virtual ~IScanEngineDeviceList();
64  boost::system::error_code subscribe(ScanEngineDeviceListObserver* observer);
65  boost::system::error_code unsubscribe(ScanEngineDeviceListObserver* observer);
66 
67  virtual boost::system::error_code getScanners(std::list<boost::shared_ptr<IScanEngineDevice>>& list) = 0;
68 };
Definition: iScanEngineDeviceList.h:35
ADDED.
Definition: iScanEngineDeviceList.h:12
int devNumber
Device address.
Definition: iScanEngineDeviceList.h:18
uint16_t idProduct
USB product ID.
Definition: iScanEngineDeviceList.h:20
Definition: iScanEngineDeviceList.h:16
uint16_t idVendor
USB vendor ID.
Definition: iScanEngineDeviceList.h:19
Deepsy Imagerscanengine namespace that includes the different enums, structs or method signatures tha...
ListEvent
Definition: iScanEngineDeviceList.h:10
REMOVED.
Definition: iScanEngineDeviceList.h:13
virtual ~ScanEngineDeviceListObserver()
Destructor.
Definition: iScanEngineDeviceList.h:48
Definition: iScanEngineDeviceList.h:57