feat: add SystemContext class for global system component access

This commit is contained in:
GW_MC
2026-02-02 20:46:46 +08:00
parent 06e81301b2
commit bcbde510e0

View File

@@ -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;
};