summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2010-11-15 05:29:10 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2010-11-15 05:29:10 +0000
commit73ed235fd19c4c19c3b6d56ce6d9631980487b0d (patch)
tree65ae6f7d314b3adf857fa5a8754a777e4435197d /Source
parentb4ffd640b7a5f66309bcf22e9008e0059f66ca98 (diff)
Changed macro for disallowing copy-ctor and =operator into an inheritable class. Removed IrPointer.ini (no longer used)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6421 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Common/Src/Common.h14
-rw-r--r--Source/Core/Common/Src/LogManager.h3
-rw-r--r--Source/Core/Core/Src/ConfigManager.h4
-rw-r--r--Source/Core/Core/Src/PluginManager.h4
-rw-r--r--Source/Core/DSPCore/Src/DSPEmitter.h4
-rw-r--r--Source/Core/VideoCommon/Src/NativeVertexFormat.h5
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.h4
-rw-r--r--Source/Plugins/Plugin_DSP_HLE/Src/DSPHandler.h3
-rw-r--r--Source/Plugins/Plugin_VideoSoftware/Src/VideoConfig.h5
9 files changed, 17 insertions, 29 deletions
diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h
index 842230ed66..6cc7cf0581 100644
--- a/Source/Core/Common/Src/Common.h
+++ b/Source/Core/Common/Src/Common.h
@@ -38,11 +38,15 @@ extern const char *netplay_dolphin_ver;
#define STACKALIGN
-// A macro to disallow the copy constructor and operator= functions
-// This should be used in the private: declarations for a class
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
+// An inheritable class to disallow the copy constructor and operator= functions
+class NonCopyable
+{
+protected:
+ NonCopyable() {}
+private:
+ NonCopyable(const NonCopyable&);
+ void operator=(const NonCopyable&);
+};
#include "Log.h"
#include "CommonTypes.h"
diff --git a/Source/Core/Common/Src/LogManager.h b/Source/Core/Common/Src/LogManager.h
index e0157b246d..7e247925c4 100644
--- a/Source/Core/Common/Src/LogManager.h
+++ b/Source/Core/Common/Src/LogManager.h
@@ -106,7 +106,7 @@ namespace Common {
class CriticalSection;
}
-class LogManager
+class LogManager : NonCopyable
{
private:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
@@ -117,7 +117,6 @@ private:
LogManager();
~LogManager();
- DISALLOW_COPY_AND_ASSIGN(LogManager);
public:
static u32 GetMaxLevel() { return MAX_LOGLEVEL; }
diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h
index 70cc5dc5c9..fee8b6a95e 100644
--- a/Source/Core/Core/Src/ConfigManager.h
+++ b/Source/Core/Core/Src/ConfigManager.h
@@ -39,7 +39,7 @@ enum INTERFACE_LANGUAGE
INTERFACE_OTHER,
};
-struct SConfig
+struct SConfig : NonCopyable
{
// Wii Devices
bool m_WiiSDCard;
@@ -111,8 +111,6 @@ private:
~SConfig();
static SConfig* m_Instance;
-
- DISALLOW_COPY_AND_ASSIGN(SConfig);
};
#endif // endif config manager
diff --git a/Source/Core/Core/Src/PluginManager.h b/Source/Core/Core/Src/PluginManager.h
index 8262f40753..b300f85075 100644
--- a/Source/Core/Core/Src/PluginManager.h
+++ b/Source/Core/Core/Src/PluginManager.h
@@ -40,7 +40,7 @@ private:
typedef std::vector<CPluginInfo>CPluginInfos;
-class CPluginManager
+class CPluginManager : NonCopyable
{
public:
static CPluginManager& GetInstance() {return(*m_Instance);}
@@ -78,8 +78,6 @@ private:
~CPluginManager();
void GetPluginInfo(CPluginInfo *&info, std::string Filename);
void *LoadPlugin(const char *_rFilename);
-
- DISALLOW_COPY_AND_ASSIGN(CPluginManager);
};
diff --git a/Source/Core/DSPCore/Src/DSPEmitter.h b/Source/Core/DSPCore/Src/DSPEmitter.h
index c703157c43..d37448d6fc 100644
--- a/Source/Core/DSPCore/Src/DSPEmitter.h
+++ b/Source/Core/DSPCore/Src/DSPEmitter.h
@@ -27,7 +27,7 @@
typedef u32 (*CompiledCode)();
-class DSPEmitter : public Gen::XCodeBlock
+class DSPEmitter : public Gen::XCodeBlock, NonCopyable
{
public:
DSPEmitter();
@@ -117,8 +117,6 @@ private:
// Counts down.
// int cycles;
- DISALLOW_COPY_AND_ASSIGN(DSPEmitter);
-
void ToMask(Gen::X64Reg value_reg = Gen::EDI, Gen::X64Reg temp_reg = Gen::ESI);
void dsp_increment_one(Gen::X64Reg ar = Gen::EAX, Gen::X64Reg wr = Gen::EDX, Gen::X64Reg wr_pow = Gen::EDI, Gen::X64Reg temp_reg = Gen::ESI);
void dsp_decrement_one(Gen::X64Reg ar = Gen::EAX, Gen::X64Reg wr = Gen::EDX, Gen::X64Reg wr_pow = Gen::EDI, Gen::X64Reg temp_reg = Gen::ESI);
diff --git a/Source/Core/VideoCommon/Src/NativeVertexFormat.h b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
index 499a1b451d..bff59b572a 100644
--- a/Source/Core/VideoCommon/Src/NativeVertexFormat.h
+++ b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
@@ -88,7 +88,7 @@ struct PortableVertexDeclaration
// Note that this class can't just invent arbitrary vertex formats out of its input -
// all the data loading code must always be made compatible.
-class NativeVertexFormat
+class NativeVertexFormat : NonCopyable
{
public:
virtual ~NativeVertexFormat() {}
@@ -108,9 +108,6 @@ public:
protected:
// Let subclasses construct.
NativeVertexFormat() {}
-
-private:
- DISALLOW_COPY_AND_ASSIGN(NativeVertexFormat);
};
#endif // _NATIVEVERTEXFORMAT_H
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.h b/Source/Core/VideoCommon/Src/VertexLoader.h
index 4ec3c5f64a..98a57cb9ff 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.h
+++ b/Source/Core/VideoCommon/Src/VertexLoader.h
@@ -76,7 +76,7 @@ private:
}
};
-class VertexLoader : public Gen::XCodeBlock
+class VertexLoader : public Gen::XCodeBlock, NonCopyable
{
public:
VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr);
@@ -124,8 +124,6 @@ private:
void WriteGetVariable(int bits, Gen::OpArg dest, void *address);
void WriteSetVariable(int bits, void *address, Gen::OpArg dest);
-
- DISALLOW_COPY_AND_ASSIGN(VertexLoader);
};
#endif
diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/DSPHandler.h b/Source/Plugins/Plugin_DSP_HLE/Src/DSPHandler.h
index 569f20f001..e3d28cebce 100644
--- a/Source/Plugins/Plugin_DSP_HLE/Src/DSPHandler.h
+++ b/Source/Plugins/Plugin_DSP_HLE/Src/DSPHandler.h
@@ -23,7 +23,7 @@
#include "MailHandler.h"
#include "UCodes/UCodes.h"
-class CDSPHandler
+class CDSPHandler : NonCopyable
{
public:
void Update(int cycles);
@@ -58,7 +58,6 @@ public:
private:
CDSPHandler();
~CDSPHandler();
- DISALLOW_COPY_AND_ASSIGN(CDSPHandler);
// singleton instance
static CDSPHandler* m_pInstance;
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfig.h b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfig.h
index 806a14ba40..e6c88e6180 100644
--- a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfig.h
+++ b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfig.h
@@ -23,7 +23,7 @@
#define STATISTICS 1
// NEVER inherit from this class.
-struct Config
+struct Config : NonCopyable
{
Config();
void Load();
@@ -44,9 +44,6 @@ struct Config
u32 drawStart;
u32 drawEnd;
-
-private:
- DISALLOW_COPY_AND_ASSIGN(Config);
};
extern Config g_Config;