| 127 | } |
| 128 | |
| 129 | bool DataProcessorsRuntimeHost::onList( |
| 130 | void* ctx, PJ_string_view_t* out_ids, uint64_t capacity, uint64_t* out_count, PJ_error_t* out_error) noexcept { |
| 131 | auto* self = static_cast<DataProcessorsRuntimeHost*>(ctx); |
| 132 | if (self == nullptr) { |
| 133 | return false; |
| 134 | } |
| 135 | try { |
| 136 | // Owned snapshot in member storage; the returned views point into it and stay |
| 137 | // valid until the next call on this vtable (the ABI contract). |
| 138 | self->list_storage_ = self->service_.transformIdsForPlugin(self->plugin_id_); |
| 139 | if (out_count != nullptr) { |
| 140 | *out_count = self->list_storage_.size(); |
| 141 | } |
| 142 | const uint64_t fill = std::min<uint64_t>(capacity, self->list_storage_.size()); |
| 143 | for (uint64_t i = 0; i < fill; ++i) { |
| 144 | out_ids[i] = sdk::toAbiString(self->list_storage_[i]); |
| 145 | } |
| 146 | return true; |
| 147 | } catch (const std::exception& e) { |
| 148 | sdk::fillError(out_error, kErrorInternal, kDomain, e.what()); |
| 149 | return false; |
| 150 | } catch (...) { |
| 151 | sdk::fillError(out_error, kErrorInternal, kDomain, "unknown error listing data processors"); |
| 152 | return false; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | bool DataProcessorsRuntimeHost::onConfig( |
| 157 | void* ctx, PJ_string_view_t id, PJ_string_view_t* out_recipe_json, PJ_error_t* out_error) noexcept { |
nothing calls this directly
no test coverage detected