Common: Move NonCopyable to its own header

This commit is contained in:
Lioncash
2015-09-26 16:13:54 -04:00
parent bb927ad738
commit 1d42db2439
18 changed files with 39 additions and 16 deletions

View File

@ -6,6 +6,7 @@
#include "Common/Common.h"
#include "Common/MemoryUtil.h"
#include "Common/NonCopyable.h"
// Everything that needs to generate code should inherit from this.
// You get memory management for free, plus, you can use all emitter functions without

View File

@ -30,18 +30,6 @@ extern const char *netplay_dolphin_ver;
#define UNUSED
#endif
// An inheritable class to disallow the copy constructor and operator= functions
class NonCopyable
{
protected:
constexpr NonCopyable() = default;
~NonCopyable() = default;
private:
NonCopyable(NonCopyable&) = delete;
NonCopyable& operator=(NonCopyable&) = delete;
};
#if defined _WIN32
// Memory leak checks

View File

@ -106,6 +106,7 @@
<ClInclude Include="MsgHandler.h" />
<ClInclude Include="NandPaths.h" />
<ClInclude Include="Network.h" />
<ClInclude Include="NonCopyable.h" />
<ClInclude Include="PcapFile.h" />
<ClInclude Include="Profiler.h" />
<ClInclude Include="SDCardUtil.h" />

View File

@ -11,6 +11,7 @@
#include <vector>
#include "Common/Common.h"
#include "Common/NonCopyable.h"
#ifdef _WIN32
#include "Common/StringUtil.h"

View File

@ -11,6 +11,7 @@
#include <string>
#include "Common/Common.h"
#include "Common/NonCopyable.h"
#define MAX_MESSAGES 8000
#define MAX_MSGLEN 1024

View File

@ -0,0 +1,17 @@
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
// An inheritable class to disallow the copy constructor and operator= functions
class NonCopyable
{
protected:
constexpr NonCopyable() = default;
~NonCopyable() = default;
private:
NonCopyable(NonCopyable&) = delete;
NonCopyable& operator=(NonCopyable&) = delete;
};

View File

@ -18,6 +18,7 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/NonCopyable.h"
class PCAP final : public NonCopyable
{