#ifndef PROCESSOR_FACTORY_H #define PROCESSOR_FACTORY_H #include #include #include #include "processor.h" // Processor Factory Class class ProcessorFactory { public: using Creator = std::function(const ProcessorConfig *, uint32_t)>; // Singleton instance accessor static ProcessorFactory &instance(); // Register a processor type with its creation function void register_processor(ProcessorType type, Creator creator); // Create a processor instance based on configuration std::unique_ptr create_processor(const ProcessorConfig *processor_config, uint32_t vk_device_index) const; private: // Private constructor for Singleton ProcessorFactory() = default; // Map of processor types to their creation functions std::unordered_map creators; // Static initializer for default processors static void init_default_processors(ProcessorFactory &factory); }; #endif // PROCESSOR_FACTORY_H