diff --git a/main/common/system_context.h b/main/common/system_context.h new file mode 100644 index 0000000..d44eba8 --- /dev/null +++ b/main/common/system_context.h @@ -0,0 +1,30 @@ +#pragma once + +class NetworkHandler; +class WifiHandler; + +/** + * @brief System context providing access to global system components + */ +class SystemContext { +public: + static SystemContext& instance() { + static SystemContext context; + return context; + } + + void set_network_handler(NetworkHandler* handler) { + network_handler_ = handler; + } + + NetworkHandler* get_network_handler() const { + return network_handler_; + } + +private: + SystemContext() = default; + SystemContext(const SystemContext&) = delete; + SystemContext& operator=(const SystemContext&) = delete; + + NetworkHandler* network_handler_ = nullptr; +};