|
CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
|
Central Registry and Factory for IWorkerRequest instances.
More...
#include "workers/worker_type.h"#include "workers/interfaces/i_worker_request.h"#include <memory>#include <unordered_map>#include <functional>
Include dependency graph for worker_builder.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | CaptureMoment::Core::Workers::WorkerBuilder |
Static registry for creating IWorkerRequest instances based on type. More... | |
Namespaces | |
| namespace | CaptureMoment |
| namespace | CaptureMoment::Core |
| Manages the lifecycle of a single IWorkingImage instance. | |
| namespace | CaptureMoment::Core::Workers |
Central Registry and Factory for IWorkerRequest instances.
This class implements a Registry pattern. It maintains a static map of creator functions indexed by WorkerType. This decouples the high-level managers from concrete worker implementations, allowing for easy extension (e.g., adding OpenCV or AI workers) without modifying existing manager code.
Usage:
WorkerBuilder::registerCreator(Type, []{ return std::make_unique<ConcreteWorker>(); });auto worker = WorkerBuilder::build(Type);worker->execute(context, image);Definition in file worker_builder.h.