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

Function parserObjectPushOwned

pj_datastore/src/plugin_data_host.cpp:1900–1926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1898// ---------------------------------------------------------------------------
1899
1900bool parserObjectPushOwned(
1901 void* ctx, int64_t timestamp_ns, const uint8_t* data, uint64_t size, PJ_error_t* out_error) noexcept {
1902 auto* impl = static_cast<DatastoreParserObjectWriteHostState*>(ctx);
1903 auto* target = impl->target.load(std::memory_order_acquire);
1904 try {
1905 std::vector<uint8_t> bytes;
1906 if (data != nullptr && size > 0) {
1907 bytes.assign(data, data + size);
1908 }
1909 auto result = target->pushOwned(impl->bound_topic, timestamp_ns, std::move(bytes));
1910 if (!result) {
1911 impl->setError(result.error());
1912 propagateError(out_error, impl->last_error.c_str());
1913 return false;
1914 }
1915 impl->last_error.clear();
1916 return true;
1917 } catch (const std::exception& e) {
1918 impl->setError(e.what());
1919 propagateError(out_error, impl->last_error.c_str());
1920 return false;
1921 } catch (...) {
1922 impl->setError("parser pushOwned: unknown exception");
1923 propagateError(out_error, impl->last_error.c_str());
1924 return false;
1925 }
1926}
1927
1928bool parserObjectPushLazy(
1929 void* ctx, int64_t timestamp_ns, PJ_lazy_fetch_fn_t fetch_fn, void* fetch_ctx, void (*fetch_ctx_destroy)(void*),

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