From da3d7a913c0b10b4aa776b97def10a3727e07bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 11 Apr 2021 20:23:04 +0200 Subject: Add clear member function to EventsDS. --- src/events_ds.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/events_ds.cc') diff --git a/src/events_ds.cc b/src/events_ds.cc index ee21f93..0195a89 100644 --- a/src/events_ds.cc +++ b/src/events_ds.cc @@ -99,6 +99,25 @@ void EventsDS::startAddingNewGroup(InstrumentID instrument_id) } } +void EventsDS::clear() +{ + // *this = EventsDS(); + + id_to_info.clear(); + id_to_group_data.clear(); + for (auto& channel_data: channel_data_array) + { + channel_data.sample_events.clear(); + } + for (auto& event_group_ids: instruments_sample_event_group_ids) + { + event_group_ids.clear(); + } + + current_group_id.invalidate(); + current_groups_instrument_id.invalidate(); +} + void EventsDS::removeGroup(EventGroupID group_id, InstrumentID instrument_id) { // if we remove the current group, then invalidate it -- cgit v1.2.3