| 1648 | } |
| 1649 | |
| 1650 | bool 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 | |
| 1679 | bool sourceObjectPushLazy( |
| 1680 | void* ctx, PJ_object_topic_handle_t topic, int64_t timestamp_ns, PJ_lazy_fetch_fn_t fetch_fn, void* fetch_ctx, |
nothing calls this directly
no test coverage detected