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

Method stopDatasetAndWait

pj_app/src/StreamingSourceManager.cpp:116–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116bool StreamingSourceManager::stopDatasetAndWait(DatasetId dataset_id, const QString& reason) {
117 auto it = sessions_.find(dataset_id);
118 if (it == sessions_.end()) {
119 return false;
120 }
121
122 StreamingSession* sess = it->second.get();
123 if (sess->runtime_host != nullptr) {
124 sess->runtime_host->requestStop(reason.toStdString());
125 }
126 if (sess->worker != nullptr) {
127 sess->worker->wait();
128 }
129
130 QString stopped_reason = reason;
131 if (sess->runtime_host != nullptr && !sess->runtime_host->lastError().empty()) {
132 stopped_reason = QString::fromStdString(sess->runtime_host->lastError());
133 }
134
135 sessions_.erase(it);
136 for (const ObjectTopicId topic_id : secondary_object_store_->listTopics(dataset_id)) {
137 secondary_object_store_->removeTopic(topic_id);
138 }
139 secondary_data_engine_->removeDataset(dataset_id);
140 emit streamStopped(dataset_id, stopped_reason);
141 return true;
142}
143
144void StreamingSourceManager::stopAllAndWait(const QString& reason) {
145 std::vector<DatasetId> dataset_ids;

Callers 1

removeDatasetDataMethod · 0.80

Calls 10

getMethod · 0.80
requestStopMethod · 0.80
lastErrorMethod · 0.80
eraseMethod · 0.80
removeTopicMethod · 0.80
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
listTopicsMethod · 0.45
removeDatasetMethod · 0.45

Tested by

no test coverage detected