CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
worker_builder.h
Go to the documentation of this file.
1
20#pragma once
21
22#include "workers/worker_type.h"
24
25#include <memory>
26#include <unordered_map>
27#include <functional>
28
29namespace CaptureMoment::Core {
30
31namespace Workers {
32
38public:
46 using CreatorFunc = std::function<std::unique_ptr<IWorkerRequest>()>;
47
59 [[nodiscard]] static std::unique_ptr<IWorkerRequest> build(WorkerType type);
60
71 static void registerCreator(WorkerType type, CreatorFunc creator);
72
73private:
78 static std::unordered_map<WorkerType, CreatorFunc>& getRegistry();
79};
80
81} // namespace Workers
82
83} // namespace CaptureMoment::Core
Static registry for creating IWorkerRequest instances based on type.
std::function< std::unique_ptr< IWorkerRequest >()> CreatorFunc
Definition of the creator function signature.
static std::unique_ptr< IWorkerRequest > build(WorkerType type)
Retrieves an instance of the worker for the specified type.
static void registerCreator(WorkerType type, CreatorFunc creator)
Registers a creator function for a specific worker type.
Abstract interface for asynchronous image processing workers.
WorkerType
Identifies the specific technology or strategy used for a processing worker.
Definition worker_type.h:32
Manages the lifecycle of a single IWorkingImage instance.
Enumeration defining supported worker types.
CaptureMoment — footer