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

Function sourceObjectPushOwned

pj_datastore/src/plugin_data_host.cpp:1650–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1648}
1649
1650bool sourceObjectPushOwned(
1651 void* ctx, PJ_object_topic_handle_t topic, int64_t timestamp_ns, const uint8_t* data, uint64_t size,
1652 PJ_error_t* out_error) noexcept {
1653 auto* impl = static_cast<DatastoreSourceObjectWriteHostState*>(ctx);
1654 auto* target = impl->target.load(std::memory_order_acquire);
1655 try {
1656 std::vector<uint8_t> bytes;
1657 if (data != nullptr && size > 0) {
1658 bytes.assign(data, data + size);
1659 }
1660 auto result = target->pushOwned(ObjectTopicId{topic.id}, timestamp_ns, std::move(bytes));
1661 if (!result) {
1662 impl->setError(result.error());
1663 propagateError(out_error, impl->last_error.c_str());
1664 return false;
1665 }
1666 impl->last_error.clear();
1667 return true;
1668 } catch (const std::exception& e) {
1669 impl->setError(e.what());
1670 propagateError(out_error, impl->last_error.c_str());
1671 return false;
1672 } catch (...) {
1673 impl->setError("pushOwned: unknown exception");
1674 propagateError(out_error, impl->last_error.c_str());
1675 return false;
1676 }
1677}
1678
1679bool sourceObjectPushLazy(
1680 void* ctx, PJ_object_topic_handle_t topic, int64_t timestamp_ns, PJ_lazy_fetch_fn_t fetch_fn, void* fetch_ctx,

Callers

nothing calls this directly

Calls 5

propagateErrorFunction · 0.85
pushOwnedMethod · 0.80
loadMethod · 0.45
setErrorMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected