Files
MosisService/designer/src/platform_singleton.cpp
2026-01-16 16:34:32 +01:00

24 lines
535 B
C++

// D:\Dev\Mosis\MosisService\designer\src\platform_singleton.cpp
// Platform singleton implementation for desktop
#include "platform.h"
#include <stdexcept>
namespace mosis {
// Platform singleton
static std::unique_ptr<IPlatform> g_platform;
IPlatform& GetPlatform() {
if (!g_platform) {
throw std::runtime_error("Platform not initialized. Call SetPlatform first.");
}
return *g_platform;
}
void SetPlatform(std::unique_ptr<IPlatform> platform) {
g_platform = std::move(platform);
}
} // namespace mosis