diff base/Event.h @ 1627:1c21ddac220e single-point

Seems we can do just as well with a vector of events themselves
author Chris Cannam
date Mon, 11 Mar 2019 14:49:13 +0000
parents 895186c43fce
children abc188026a48
line wrap: on
line diff
--- a/base/Event.h	Mon Mar 11 13:44:35 2019 +0000
+++ b/base/Event.h	Mon Mar 11 14:49:13 2019 +0000
@@ -279,27 +279,6 @@
         if (m_haveReferenceFrame) h ^= qHash(m_referenceFrame);
         return h;
     }
-
-    static sv_id_t getId(const Event &ev) {
-        sv_id_t id;
-        if (!m_ids.contains(ev)) {
-            id = m_nextId;
-            ++m_nextId;
-            m_ids[ev] = id;
-            m_rids[id] = ev;
-            return id;
-        } else {
-            return m_ids.value(ev);
-        }
-    }
-
-    static Event getEventForId(sv_id_t id) {
-        if (!m_rids.contains(id)) {
-            throw std::runtime_error("unknown event id");
-        } else {
-            return m_rids.value(id);
-        }
-    }
     
 private:
     // The order of fields here is chosen to minimise overall size of struct.
@@ -314,10 +293,6 @@
     sv_frame_t m_duration;
     sv_frame_t m_referenceFrame;
     QString m_label;
-
-    static sv_id_t m_nextId;
-    static QHash<Event, sv_id_t> m_ids;
-    static QHash<sv_id_t, Event> m_rids;
 };
 
 inline uint qHash(const Event &e, uint seed = 0) {