diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index de8fd8ac93..03c87e6db3 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -41,6 +41,8 @@ add_library(core SyncIdentifier.h SysConf.cpp SysConf.h + System.cpp + System.h TitleDatabase.cpp TitleDatabase.h WiiRoot.cpp diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index a7ada5b18e..f672f088d1 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -371,6 +371,7 @@ + @@ -678,6 +679,7 @@ + diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters index 749b81b9c2..ae2205c989 100644 --- a/Source/Core/Core/Core.vcxproj.filters +++ b/Source/Core/Core/Core.vcxproj.filters @@ -187,6 +187,7 @@ + @@ -1022,6 +1023,7 @@ + diff --git a/Source/Core/Core/System.cpp b/Source/Core/Core/System.cpp new file mode 100644 index 0000000000..7bc1b50c62 --- /dev/null +++ b/Source/Core/Core/System.cpp @@ -0,0 +1,18 @@ +// Copyright 2020 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "Core/System.h" + +namespace Core +{ +struct System::Impl +{ +}; + +System::System() : m_impl{std::make_unique()} +{ +} + +System::~System() = default; +} // namespace Core diff --git a/Source/Core/Core/System.h b/Source/Core/Core/System.h new file mode 100644 index 0000000000..82b2c8af54 --- /dev/null +++ b/Source/Core/Core/System.h @@ -0,0 +1,36 @@ +// Copyright 2020 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include + +namespace Core +{ +// Central class that encapsulates the running system. +class System +{ +public: + ~System(); + + System(const System&) = delete; + System& operator=(const System&) = delete; + + System(System&&) = delete; + System& operator=(System&&) = delete; + + // Intermediate instance accessor until global state is eliminated. + static System& GetInstance() + { + static System instance; + return instance; + } + +private: + System(); + + struct Impl; + std::unique_ptr m_impl; +}; +} // namespace Core