Object Detection  5.0
Image Processing Using Qt and Opencv
observer.h
1 #ifndef OBSERVER_H
2 #define OBSERVER_H
3 
4 #include <QObject>
5 #include <memory>
6 #include "devicehandler_global.h"
7 
8 namespace Devices {
9  class DECLARE_LIB Observer;
10 }
11 #include "subject.h"
12 #include "observabledata.h"
13 using namespace Devices;
14 
15 class Devices::Observer : public QObject
16 {
17  Q_OBJECT
18 private:
19  class _ObserverImpl;
20  std::unique_ptr<_ObserverImpl> _pimpl;
21 public:
22  virtual ~Observer();
23  Observer(const Observer&) = default;
24 protected:
25  explicit Observer(QObject *parent = nullptr);
26 signals:
27 
28 public slots:
29  void observe(Subject *sub);
30  void stopObserving(Subject *sub);
31  virtual void onNotified(const ObservableData& dt) = 0;
32 };
33 
34 #endif // OBSERVER_H