| 86 | } |
| 87 | |
| 88 | void ToolboxRuntimeHost::onNotifyDataChanged(void* ctx) noexcept { |
| 89 | auto* self = static_cast<ToolboxRuntimeHost*>(ctx); |
| 90 | if (self == nullptr) { |
| 91 | return; |
| 92 | } |
| 93 | try { |
| 94 | // Marshal to the host thread (AutoConnection: direct when already there, |
| 95 | // queued from a worker thread). Seal buffered writes so the freshly written |
| 96 | // rows/objects are visible before the host rebuilds its catalog — flush and |
| 97 | // rebuild then always run together on the GUI thread. |
| 98 | QMetaObject::invokeMethod( |
| 99 | &self->marshaller_, |
| 100 | [self]() { |
| 101 | try { |
| 102 | self->write_host_.flushPending(); |
| 103 | // Drain the datasets that received parser-ingest contexts since |
| 104 | // the previous notify; drained here (GUI thread) so the set and |
| 105 | // the callback observing it stay ordered. |
| 106 | std::vector<DatasetId> ingested; |
| 107 | { |
| 108 | std::lock_guard lock(self->parser_ingest_mu_); |
| 109 | ingested.swap(self->pending_ingest_datasets_); |
| 110 | } |
| 111 | if (self->callbacks_.on_data_changed) { |
| 112 | self->callbacks_.on_data_changed(std::move(ingested)); |
| 113 | } |
| 114 | } catch (...) {} |
| 115 | }, |
| 116 | Qt::AutoConnection); |
| 117 | } catch (...) { |
| 118 | // noexcept C-ABI boundary. |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | namespace { |
| 123 | // Same error taxonomy as DataSourceRuntimeHost::fail (the sibling ingest |
nothing calls this directly
no test coverage detected