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

Method onRemove

pj_runtime/src/DataProcessorsRuntimeHost.cpp:107–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107bool DataProcessorsRuntimeHost::onRemove(void* ctx, PJ_string_view_t id, PJ_error_t* out_error) noexcept {
108 auto* self = static_cast<DataProcessorsRuntimeHost*>(ctx);
109 if (self == nullptr) {
110 return false;
111 }
112 try {
113 const std::string key = DataProcessorService::makeTransformKey(self->plugin_id_, sdk::toStringView(id));
114 auto status = self->service_.removeTransform(key);
115 if (!status.has_value()) {
116 sdk::fillError(out_error, kErrorRejected, kDomain, status.error());
117 return false;
118 }
119 return true;
120 } catch (const std::exception& e) {
121 sdk::fillError(out_error, kErrorInternal, kDomain, e.what());
122 return false;
123 } catch (...) {
124 sdk::fillError(out_error, kErrorInternal, kDomain, "unknown error removing data processor");
125 return false;
126 }
127}
128
129bool DataProcessorsRuntimeHost::onList(
130 void* ctx, PJ_string_view_t* out_ids, uint64_t capacity, uint64_t* out_count, PJ_error_t* out_error) noexcept {

Callers

nothing calls this directly

Calls 2

removeTransformMethod · 0.80
toStringViewFunction · 0.50

Tested by

no test coverage detected