summaryrefslogtreecommitdiff
path: root/src/events_ds.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-18 11:53:40 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-23 13:46:28 +0100
commit7623de94e9566392ad69b2ca31dcf6453f816571 (patch)
tree9868e5b0f20cab29c11362e5a611662d30d77cfc /src/events_ds.cc
parent3184ffc5792bf24523a896961e197d8203cbca56 (diff)
Add two get(event_id) function to EventsDS.
Still needs testing and review.
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];