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