Merge pull request #9342 from lioncash/system

Core: Add initial System class
This commit is contained in:
JosJuice 2020-12-20 13:57:15 +01:00 committed by GitHub
commit c582fb098d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 0 deletions

View File

@ -41,6 +41,8 @@ add_library(core
SyncIdentifier.h
SysConf.cpp
SysConf.h
System.cpp
System.h
TitleDatabase.cpp
TitleDatabase.h
WiiRoot.cpp

View File

@ -371,6 +371,7 @@
<ClCompile Include="PowerPC\SignatureDB\SignatureDB.cpp" />
<ClCompile Include="State.cpp" />
<ClCompile Include="SysConf.cpp" />
<ClCompile Include="System.cpp" />
<ClCompile Include="TitleDatabase.cpp" />
<ClCompile Include="WiiRoot.cpp" />
<ClCompile Include="WiiUtils.cpp" />
@ -678,6 +679,7 @@
<ClInclude Include="State.h" />
<ClInclude Include="SyncIdentifier.h" />
<ClInclude Include="SysConf.h" />
<ClInclude Include="System.h" />
<ClInclude Include="Titles.h" />
<ClInclude Include="TitleDatabase.h" />
<ClInclude Include="WiiRoot.h" />

View File

@ -187,6 +187,7 @@
<ClCompile Include="PatchEngine.cpp" />
<ClCompile Include="State.cpp" />
<ClCompile Include="SysConf.cpp" />
<ClCompile Include="System.cpp" />
<ClCompile Include="TitleDatabase.cpp" />
<ClCompile Include="WiiRoot.cpp" />
<ClCompile Include="WiiUtils.cpp" />
@ -1022,6 +1023,7 @@
<ClInclude Include="PatchEngine.h" />
<ClInclude Include="State.h" />
<ClInclude Include="SysConf.h" />
<ClInclude Include="System.h" />
<ClInclude Include="Titles.h" />
<ClInclude Include="TitleDatabase.h" />
<ClInclude Include="WiiRoot.h" />

View File

@ -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<Impl>()}
{
}
System::~System() = default;
} // namespace Core

36
Source/Core/Core/System.h Normal file
View File

@ -0,0 +1,36 @@
// Copyright 2020 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
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<Impl> m_impl;
};
} // namespace Core