CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
worker_builder.h File Reference

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
 

Detailed Description

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:

  1. Register a creator at startup: WorkerBuilder::registerCreator(Type, []{ return std::make_unique<ConcreteWorker>(); });
  2. Build an instance: auto worker = WorkerBuilder::build(Type);
  3. Execute the worker: worker->execute(context, image);
Author
CaptureMoment Team
Date
2026

Definition in file worker_builder.h.

CaptureMoment — footer