MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / clearDataset

Method clearDataset

pj_datastore/src/object_store.cpp:724–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724void ObjectStore::clearDataset(DatasetId dataset_id) {
725 // Exclusive store lock blocks new readers/writers; for each series in the
726 // dataset, drain any reader holding only the series lock (an EntryTimestampsView)
727 // before emptying its timestamp vector, then clear it in place — keeping the
728 // ObjectTopicId registered (never removeTopic+re-register). Unknown dataset_id
729 // matches no series -> no-op; clearing an empty series is a no-op (idempotent).
730 std::unique_lock lock(store_mutex_);
731 for (auto& [tid, series] : topics_) {
732 if (series->descriptor.dataset_id != dataset_id) {
733 continue;
734 }
735 drainSeriesReaders(*series);
736 clearEntriesLocked(*series);
737 }
738}
739
740ObjectStore::ObjectDatasetSnapshot ObjectStore::detachDataset(DatasetId dataset_id) {
741 // Same discipline as clearDataset, but MOVE each series' entries aside instead of

Callers 1

TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64