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

Function sourceEnsureTopic

pj_datastore/src/plugin_data_host.cpp:1267–1279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1265}
1266
1267bool sourceEnsureTopic(void* ctx, PJ_string_view_t topic_name, TopicHandle* out_topic, PJ_error_t* out_error) noexcept {
1268 return guardHostCallback(out_error, [&] {
1269 auto* impl = static_cast<DatastoreSourceWriteHostState*>(ctx);
1270 // Pin the current WriteCore for the whole call so a concurrent setTarget()
1271 // swap can't destroy it under us (and so the op + its error read the SAME core).
1272 auto core = impl->core.load(std::memory_order_acquire);
1273 if (!core->ensureTopic(impl->source, toStringView(topic_name), out_topic)) {
1274 propagateError(out_error, core->lastError());
1275 return false;
1276 }
1277 return true;
1278 });
1279}
1280
1281bool sourceEnsureField(
1282 void* ctx, TopicHandle topic, PJ_string_view_t field_name, PJ_primitive_type_t type, FieldHandle* out_field,

Callers

nothing calls this directly

Calls 6

guardHostCallbackFunction · 0.85
propagateErrorFunction · 0.85
ensureTopicMethod · 0.80
lastErrorMethod · 0.80
toStringViewFunction · 0.70
loadMethod · 0.45

Tested by

no test coverage detected