]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/eventqueue.h
Mac OS changes and switched to c++11.
[evaf] / src / libs / Common / eventqueue.h
index b02937692129f83c74fc3151d392e7c70e180718..730801bae2d5b7fe2a9deff41d53e393f206f1da 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Event queue interface implementation
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -26,7 +26,6 @@
 #include <QString>
 #include <QHash>
 #include <QVector>
-#include <QWeakPointer>
 
 
 namespace eVaf {
@@ -72,10 +71,19 @@ private: // Members
     uint mNextEventId;
 
     /// List of registered events
-    QHash<uint, QString> mEvents;
+    typedef QHash<uint, QString> Events;
+    Events mEvents;
 
     /// List of subscribers
-    QHash<uint, QVector<QWeakPointer<QObject> > > mSubscribers;
+    typedef QHash<uint, QVector<QObject *> > Subscribers;
+    Subscribers mSubscribers;
+
+
+private slots:
+
+    /// One of the subscribers is destroyed
+    /// We need to remove it from the list of subscribers.
+    void subscriberDestroyed(QObject * obj = nullptr);
 
 };