10#include <spdlog/spdlog.h>
15std::unordered_map<PipelineType, PipelineBuilder::CreatorFunc>& PipelineBuilder::getRegistry()
19 static std::unordered_map<PipelineType, CreatorFunc> registry;
26 getRegistry()[type] = std::move(creator);
31 auto& registry = getRegistry();
32 auto it = registry.find(type);
35 if (it == registry.end())
37 spdlog::error(
"[PipelineBuilder] No creator registered for pipeline type: {}",
static_cast<int>(type));
47 catch (
const std::exception& e)
49 spdlog::critical(
"[PipelineBuilder] Exception during instantiation of pipeline type {}: {}",
50 static_cast<int>(type), e.what());
std::function< std::unique_ptr< IPipelineExecutor >()> CreatorFunc
Definition of the creator function signature.
static void registerCreator(PipelineType type, CreatorFunc creator)
Registers a creator function for a specific pipeline type.
static std::unique_ptr< IPipelineExecutor > build(PipelineType type)
Retrieves an instance of the executor for the specified type.
PipelineType
Identifies the specific technology or strategy used for image processing.
Central Registry and Factory for IPipelineExecutor instances.