#pragma once #include "ui/ui_app.h" #include /** * @brief Registry for all available apps * * This singleton class maintains a list of all registered * AppDescriptor instances, allowing the UIHandler or other * components to query available apps. */ class AppRegistry { public: static AppRegistry& instance() { static AppRegistry registry; return registry; } AppRegistry(const AppRegistry&) = delete; void operator=(const AppRegistry&) = delete; AppRegistry(AppRegistry&&) = delete; void operator=(AppRegistry&&) = delete; // Register a new app descriptor // The registry takes ownership of the descriptor pointer. void register_app(AppDescriptor* app_descriptor) { _app_descriptors.push_back(app_descriptor); } const std::vector& get_app_descriptors() const { return _app_descriptors; } private: AppRegistry() = default; ~AppRegistry() = default; std::vector _app_descriptors = {}; };