summaryrefslogtreecommitdiff
path: root/src/events_ds.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/events_ds.cc')
-rw-r--r--src/events_ds.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/events_ds.cc b/src/events_ds.cc
index 097ddc1..3e1573f 100644
--- a/src/events_ds.cc
+++ b/src/events_ds.cc
@@ -56,6 +56,20 @@ void EventsDS::remove(EventID event_id)
id_to_info.remove(event_id);
}
+Event* EventsDS::get(EventID event_id)
+{
+ auto const& info = id_to_info.get(event_id);
+
+ // add new event types here
+ switch (info.type)
+ {
+ case Event::Type::SampleEvent:
+ return &getSample<SampleEvent>(info);
+ default:
+ assert(false);
+ }
+}
+
std::size_t EventsDS::numberOfEvents(channel_t ch) const
{
auto& channel_data = channel_data_array[ch];