Skip to content

Commit

Permalink
event helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Aug 18, 2024
1 parent 38e20b8 commit 6da5597
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/root/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ class Event {
signal_data.reserve(MAX_POINTS * MAX_POINTS);
}

void clear() {
timestamp = 0;
id = 0;
signal_ids.clear();
signal_data.clear();
}

void shrink_to_fit() {
signal_ids.shrink_to_fit();
signal_data.shrink_to_fit();
}

size_t size() const {
return signal_ids.size();
}
Expand All @@ -51,10 +63,8 @@ class StorageManager {
void Initialize(const std::string& filename);

void Clear() {
event.timestamp = 0;
event.id = 0;
event.signal_ids.clear();
event.signal_data.clear();
// we don't create a new event, so we don't have to allocate memory again
event.clear();
}

Long64_t GetNumberOfEntries() const {
Expand Down

0 comments on commit 6da5597

Please sign in to comment.