| 1898 | // --------------------------------------------------------------------------- |
| 1899 | |
| 1900 | bool 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 | |
| 1928 | bool parserObjectPushLazy( |
| 1929 | void* ctx, int64_t timestamp_ns, PJ_lazy_fetch_fn_t fetch_fn, void* fetch_ctx, void (*fetch_ctx_destroy)(void*), |
nothing calls this directly
no test coverage detected