From 94c57085e9964001182136f2f1f8fae9a39fa21b Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Wed, 22 May 2013 21:40:56 +0000 Subject: [PATCH] Makes some classes NONCOPYABLE, based on patch by Markus, refs #1852 This was SVN commit r13419. --- source/graphics/ColladaManager.h | 4 +++- source/graphics/MapGenerator.h | 3 ++- source/graphics/TextureManager.h | 4 +++- source/gui/CGUI.h | 2 ++ source/maths/Noise.h | 6 +++++- source/maths/scripting/JSInterface_Vector3D.h | 5 ++++- source/ps/CConsole.h | 2 ++ source/ps/Profile.h | 4 +++- source/renderer/OverlayRenderer.h | 4 +++- source/renderer/ParticleRenderer.h | 4 +++- source/renderer/VertexBuffer.h | 4 +++- source/scriptinterface/ThreadDebugger.cpp | 3 +++ source/soundmanager/SoundManager.cpp | 2 ++ source/soundmanager/SoundManager.h | 4 +++- .../tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/Tools.h | 6 +++++- 15 files changed, 46 insertions(+), 11 deletions(-) diff --git a/source/graphics/ColladaManager.h b/source/graphics/ColladaManager.h index 61678b8a3e..38cc8f8e6b 100644 --- a/source/graphics/ColladaManager.h +++ b/source/graphics/ColladaManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,6 +26,8 @@ class MD5; class CColladaManager { + NONCOPYABLE(CColladaManager); + public: enum FileType { PMD, PSA }; diff --git a/source/graphics/MapGenerator.h b/source/graphics/MapGenerator.h index 38839d3a1d..3c69cc084c 100644 --- a/source/graphics/MapGenerator.h +++ b/source/graphics/MapGenerator.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -36,6 +36,7 @@ class CMapGeneratorWorker; */ class CMapGenerator { + NONCOPYABLE(CMapGenerator); public: CMapGenerator(); diff --git a/source/graphics/TextureManager.h b/source/graphics/TextureManager.h index 0435aa41f8..aec058d379 100644 --- a/source/graphics/TextureManager.h +++ b/source/graphics/TextureManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -70,6 +70,8 @@ class CTextureManagerImpl; */ class CTextureManager { + NONCOPYABLE(CTextureManager); + public: /** * Construct texture manager. vfs must be the VFS instance used for all textures diff --git a/source/gui/CGUI.h b/source/gui/CGUI.h index b60b7da89a..a6abab3d7f 100644 --- a/source/gui/CGUI.h +++ b/source/gui/CGUI.h @@ -96,6 +96,8 @@ class GUITooltip; */ class CGUI { + NONCOPYABLE(CGUI); + friend class IGUIObject; friend class IGUIScrollBarOwner; friend class CInternalCGUIAccessorBase; diff --git a/source/maths/Noise.h b/source/maths/Noise.h index 8d62ec4fe2..478966089f 100644 --- a/source/maths/Noise.h +++ b/source/maths/Noise.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -32,6 +32,8 @@ class Noise2D { + NONCOPYABLE(Noise2D); + /// Frequency in X and Y int freq; @@ -47,6 +49,8 @@ public: class Noise3D { + NONCOPYABLE(Noise3D); + /// Frequency in X and Y int freq; diff --git a/source/maths/scripting/JSInterface_Vector3D.h b/source/maths/scripting/JSInterface_Vector3D.h index 32d39ffae9..29a6d8c70b 100644 --- a/source/maths/scripting/JSInterface_Vector3D.h +++ b/source/maths/scripting/JSInterface_Vector3D.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -40,6 +40,9 @@ namespace JSI_Vector3D struct Vector3D_Info { + NONCOPYABLE(Vector3D_Info); + public: + IPropertyOwner* owner; void (IPropertyOwner::*updateFn)(); void (IPropertyOwner::*freshenFn)(); diff --git a/source/ps/CConsole.h b/source/ps/CConsole.h index 8289657a73..7e17dc2ef2 100644 --- a/source/ps/CConsole.h +++ b/source/ps/CConsole.h @@ -51,6 +51,8 @@ class CTextRenderer; */ class CConsole { + NONCOPYABLE(CConsole); + public: CConsole(); ~CConsole(); diff --git a/source/ps/Profile.h b/source/ps/Profile.h index 5d57454b91..9d57372af1 100644 --- a/source/ps/Profile.h +++ b/source/ps/Profile.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -40,6 +40,8 @@ class CStrW; class CProfileNode { + NONCOPYABLE(CProfileNode); + friend class CProfileManager; friend class CProfileNodeTable; diff --git a/source/renderer/OverlayRenderer.h b/source/renderer/OverlayRenderer.h index 8030ad69ac..63e97c405a 100644 --- a/source/renderer/OverlayRenderer.h +++ b/source/renderer/OverlayRenderer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -34,6 +34,8 @@ struct OverlayRendererInternals; */ class OverlayRenderer { + NONCOPYABLE(OverlayRenderer); + public: OverlayRenderer(); ~OverlayRenderer(); diff --git a/source/renderer/ParticleRenderer.h b/source/renderer/ParticleRenderer.h index ab56086fa8..2b6fea2167 100644 --- a/source/renderer/ParticleRenderer.h +++ b/source/renderer/ParticleRenderer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -29,6 +29,8 @@ struct ParticleRendererInternals; */ class ParticleRenderer { + NONCOPYABLE(ParticleRenderer); + public: ParticleRenderer(); ~ParticleRenderer(); diff --git a/source/renderer/VertexBuffer.h b/source/renderer/VertexBuffer.h index b26cab4375..6cce511429 100644 --- a/source/renderer/VertexBuffer.h +++ b/source/renderer/VertexBuffer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -39,6 +39,8 @@ */ class CVertexBuffer { + NONCOPYABLE(CVertexBuffer); + public: /// VBChunk: describes a portion of this vertex buffer diff --git a/source/scriptinterface/ThreadDebugger.cpp b/source/scriptinterface/ThreadDebugger.cpp index f93b090b07..cc377811fb 100644 --- a/source/scriptinterface/ThreadDebugger.cpp +++ b/source/scriptinterface/ThreadDebugger.cpp @@ -129,6 +129,9 @@ struct trapLocation struct ThreadDebugger_impl { + NONCOPYABLE(ThreadDebugger_impl); +public: + ThreadDebugger_impl(); ~ThreadDebugger_impl(); diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp index b89ec6b66c..eca68d78e6 100644 --- a/source/soundmanager/SoundManager.cpp +++ b/source/soundmanager/SoundManager.cpp @@ -41,6 +41,8 @@ CSoundManager* g_SoundManager = NULL; class CSoundManagerWorker { + NONCOPYABLE(CSoundManagerWorker); + public: CSoundManagerWorker() { diff --git a/source/soundmanager/SoundManager.h b/source/soundmanager/SoundManager.h index 240c61f944..810eb43b14 100644 --- a/source/soundmanager/SoundManager.h +++ b/source/soundmanager/SoundManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -50,6 +50,8 @@ struct ALSourceHolder class CSoundManager { + NONCOPYABLE(CSoundManager); + protected: ALuint m_ALEnvironment; diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/Tools.h b/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/Tools.h index 59be5299b4..de338f4c14 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/Tools.h +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/Tools.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -42,6 +42,10 @@ public: struct ToolManagerImpl; class ToolManager { +private: // NONCOPYABLE + ToolManager(const ToolManager&); + const ToolManager& operator=(const ToolManager&); + public: ToolManager(ScenarioEditor* scenarioEditor); ~ToolManager();