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

Method makeRestoredProcessor

pj_runtime/src/DataProcessorService.cpp:250–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250std::unique_ptr<proc::DataProcessor> DataProcessorService::makeRestoredProcessor(
251 const std::string& id, const std::string& params_json, const std::string& source_fallback) const {
252 // 1. Live catalogue by id (the common case — bundled filters always resolve here).
253 if (filter_catalogue_ && filter_catalogue_->find(id) != nullptr) {
254 if (auto made = filter_catalogue_->makeProcessor(id, params_json); made.has_value()) {
255 return std::move(made).value();
256 }
257 }
258 // 2. The layout's embedded source — self-sufficient, so it must restore even with
259 // NO catalogue installed (a layout that carries its own filter source). Compile
260 // it through the installed catalogue's engine when present, else a transient one
261 // (the built LuaSisoTransform shares ownership of the engine, so it outlives the
262 // temporary catalogue).
263 if (!source_fallback.empty()) {
264 auto made = filter_catalogue_ ? filter_catalogue_->makeProcessorFromSource(source_fallback, id, params_json)
265 : scripting::FilterCatalogue(scripting::makeLuauEngine())
266 .makeProcessorFromSource(source_fallback, id, params_json);
267 if (made.has_value()) {
268 return std::move(made).value();
269 }
270 }
271 // Unresolved: the caller logs a skip-with-diagnostic.
272 return nullptr;
273}
274
275// --- Plugin-created transforms (pj.data_processors.v1 host side) ---
276

Callers 2

TESTFunction · 0.80
restoreDataProcessorsMethod · 0.80

Calls 7

makeLuauEngineFunction · 0.85
makeProcessorMethod · 0.80
FilterCatalogueClass · 0.50
findMethod · 0.45
valueMethod · 0.45
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.64