mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Common: Move NonCopyable to its own header
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
class WaveFileWriter : NonCopyable
|
class WaveFileWriter : NonCopyable
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Common/MemoryUtil.h"
|
#include "Common/MemoryUtil.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
// Everything that needs to generate code should inherit from this.
|
// Everything that needs to generate code should inherit from this.
|
||||||
// You get memory management for free, plus, you can use all emitter functions without
|
// You get memory management for free, plus, you can use all emitter functions without
|
||||||
|
@ -30,18 +30,6 @@ extern const char *netplay_dolphin_ver;
|
|||||||
#define UNUSED
|
#define UNUSED
|
||||||
#endif
|
#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
|
#if defined _WIN32
|
||||||
|
|
||||||
// Memory leak checks
|
// Memory leak checks
|
||||||
|
@ -106,6 +106,7 @@
|
|||||||
<ClInclude Include="MsgHandler.h" />
|
<ClInclude Include="MsgHandler.h" />
|
||||||
<ClInclude Include="NandPaths.h" />
|
<ClInclude Include="NandPaths.h" />
|
||||||
<ClInclude Include="Network.h" />
|
<ClInclude Include="Network.h" />
|
||||||
|
<ClInclude Include="NonCopyable.h" />
|
||||||
<ClInclude Include="PcapFile.h" />
|
<ClInclude Include="PcapFile.h" />
|
||||||
<ClInclude Include="Profiler.h" />
|
<ClInclude Include="Profiler.h" />
|
||||||
<ClInclude Include="SDCardUtil.h" />
|
<ClInclude Include="SDCardUtil.h" />
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
#define MAX_MESSAGES 8000
|
#define MAX_MESSAGES 8000
|
||||||
#define MAX_MSGLEN 1024
|
#define MAX_MSGLEN 1024
|
||||||
|
17
Source/Core/Common/NonCopyable.h
Normal file
17
Source/Core/Common/NonCopyable.h
Normal 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;
|
||||||
|
};
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
class PCAP final : public NonCopyable
|
class PCAP final : public NonCopyable
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/IniFile.h"
|
#include "Common/IniFile.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
#include "Common/SysConf.h"
|
#include "Common/SysConf.h"
|
||||||
#include "Core/HW/EXI_Device.h"
|
#include "Core/HW/EXI_Device.h"
|
||||||
#include "Core/HW/SI_Device.h"
|
#include "Core/HW/SI_Device.h"
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
class PCAP;
|
class PCAP;
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "Common/CommonPaths.h"
|
#include "Common/CommonPaths.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/NandPaths.h"
|
#include "Common/NandPaths.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
#include "Core/HW/EXI_DeviceIPL.h"
|
#include "Core/HW/EXI_DeviceIPL.h"
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/Event.h"
|
#include "Common/Event.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
#include "Core/HW/GCMemcard.h"
|
#include "Core/HW/GCMemcard.h"
|
||||||
#include "DiscIO/Volume.h"
|
#include "DiscIO/Volume.h"
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
// All the templated and very repetitive MMIO-related code is isolated in this
|
// All the templated and very repetitive MMIO-related code is isolated in this
|
||||||
// file for easier reading. It mostly contains code related to handling methods
|
// file for easier reading. It mostly contains code related to handling methods
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/FifoQueue.h"
|
#include "Common/FifoQueue.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
#include "Common/Timer.h"
|
#include "Common/Timer.h"
|
||||||
#include "Core/HW/Wiimote.h"
|
#include "Core/HW/Wiimote.h"
|
||||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||||
|
@ -47,6 +47,8 @@ typedef struct pollfd pollfd_t;
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
||||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net.h"
|
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net.h"
|
||||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h"
|
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h"
|
||||||
|
@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
#include "Common/GL/GLUtil.h"
|
#include "Common/GL/GLUtil.h"
|
||||||
|
|
||||||
#include "VideoBackends/OGL/Render.h"
|
#include "VideoBackends/OGL/Render.h"
|
||||||
|
|
||||||
namespace OGL
|
namespace OGL
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
#define STATISTICS 1
|
#define STATISTICS 1
|
||||||
|
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <functional> // for hash
|
#include <functional> // for hash
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/Hash.h"
|
#include "Common/Hash.h"
|
||||||
|
#include "Common/NonCopyable.h"
|
||||||
|
|
||||||
// m_components
|
// m_components
|
||||||
enum
|
enum
|
||||||
|
Reference in New Issue
Block a user