Skip to content

Commit

Permalink
Replace boost::noncopyable.
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Oct 17, 2017
1 parent 05da8f8 commit a25a3fb
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 28 deletions.
2 changes: 1 addition & 1 deletion include/precompiled_boost.h
Expand Up @@ -11,4 +11,4 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
4 changes: 2 additions & 2 deletions libs/RGBAImage.h
Expand Up @@ -4,7 +4,7 @@
#include "iimage.h"
#include "BasicTexture2D.h"
#include <memory>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

struct RGBAPixel
{
Expand All @@ -18,7 +18,7 @@ struct RGBAPixel
*/
class RGBAImage :
public Image,
public boost::noncopyable
public util::Noncopyable
{
public:
RGBAPixel* pixels;
Expand Down
4 changes: 2 additions & 2 deletions libs/SurfaceShader.h
Expand Up @@ -3,7 +3,7 @@
#include <string>
#include "debugging/debugging.h"
#include "moduleobservers.h"
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
#include "irender.h"
#include "shaderlib.h"

Expand All @@ -15,7 +15,7 @@
*/
class SurfaceShader :
public ModuleObserver,
public boost::noncopyable
public util::Noncopyable
{
public:
// Observer classes can be attached to SurfaceShader to get notified
Expand Down
4 changes: 2 additions & 2 deletions libs/registry/registry.h
Expand Up @@ -3,7 +3,7 @@
#include "iregistry.h"
#include "string/convert.h"

#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

/// Convenience methods and types for interacting with the XML registry
namespace registry
Expand Down Expand Up @@ -47,7 +47,7 @@ template<typename T> T getValue(const std::string& key, T defaultVal = T())
*/
template<typename T>
class ScopedKeyChanger
: boost::noncopyable
: util::Noncopyable
{
std::string _key;
T _origVal;
Expand Down
4 changes: 2 additions & 2 deletions libs/scene/TraversableNodeSet.h
Expand Up @@ -3,7 +3,7 @@
#include "inode.h"
#include "iundo.h"
#include <list>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
#include <sigc++/connection.h>
#include <sigc++/trackable.h>

Expand All @@ -25,7 +25,7 @@ class Node;
*/
class TraversableNodeSet :
public IUndoable,
public boost::noncopyable,
public util::Noncopyable,
public sigc::trackable
{
public:
Expand Down
21 changes: 21 additions & 0 deletions libs/util/Noncopyable.h
@@ -0,0 +1,21 @@
#pragma once

namespace util
{

/**
* Classes deriving from this one will end up as noncopyable
* since the copy-constructor and assignment operators are marked
* as deleted. Modeled after boost::noncopyable.
*/
class Noncopyable
{
public:
constexpr Noncopyable() = default;

protected:
Noncopyable(const Noncopyable&) = delete;
Noncopyable& operator=(const Noncopyable&) = delete;
};

}
2 changes: 1 addition & 1 deletion libs/wxutil/TreeModel.cpp
Expand Up @@ -27,7 +27,7 @@ wxString TreeModel::Column::getWxType() const

// TreeModel nodes form a directed acyclic graph
class TreeModel::Node :
public boost::noncopyable
public util::Noncopyable
{
public:
Node* parent; // NULL for the root node
Expand Down
4 changes: 2 additions & 2 deletions libs/wxutil/TreeModel.h
Expand Up @@ -4,7 +4,7 @@
#include <functional>
#include <vector>
#include <memory>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

namespace wxutil
{
Expand Down Expand Up @@ -79,7 +79,7 @@ class TreeModel :
* Subclasses should call Add() for each of their Column members.
*/
class ColumnRecord :
public boost::noncopyable
public util::Noncopyable
{
public:
// A list of column references, these point to members of subclasses
Expand Down
2 changes: 1 addition & 1 deletion libs/wxutil/menu/PopupMenu.h
Expand Up @@ -4,7 +4,7 @@

#include <functional>
#include <memory>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
#include <list>

#include <wx/menu.h>
Expand Down
4 changes: 2 additions & 2 deletions plugins/dm.gui/gui/GuiManager.h
@@ -1,6 +1,6 @@
#pragma once

#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
#include <memory>
#include <map>
#include "ifilesystem.h"
Expand Down Expand Up @@ -36,7 +36,7 @@ typedef std::shared_ptr<Gui> GuiPtr;
* including parsing the .gui files on demand.
*/
class GuiManager :
public boost::noncopyable
public util::Noncopyable
{
public:
typedef std::vector<std::string> StringList;
Expand Down
4 changes: 2 additions & 2 deletions plugins/dm.gui/gui/GuiRenderer.h
Expand Up @@ -2,7 +2,7 @@
#define GuiRenderer_h__

#include "math/Vector2.h"
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

#include "Gui.h"
#include <vector>
Expand All @@ -11,7 +11,7 @@ namespace gui
{

class GuiRenderer :
public boost::noncopyable
public util::Noncopyable
{
private:
GuiPtr _gui;
Expand Down
4 changes: 2 additions & 2 deletions plugins/entity/NamespaceManager.h
Expand Up @@ -10,14 +10,14 @@
#include "NameKeyObserver.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

namespace entity {

class NamespaceManager :
public Entity::Observer,
public Namespaced,
public boost::noncopyable
public util::Noncopyable
{
INamespace* _namespace;

Expand Down
4 changes: 2 additions & 2 deletions plugins/image/DDSImage.h
Expand Up @@ -4,11 +4,11 @@
#include "igl.h"

#include "RGBAImage.h"
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

class DDSImage :
public Image,
public boost::noncopyable
public util::Noncopyable
{
public:

Expand Down
4 changes: 2 additions & 2 deletions radiant/brush/Brush.h
Expand Up @@ -8,7 +8,7 @@
#include "Translatable.h"

#include <sigc++/signal.h>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"

class RenderableCollector;
class Ray;
Expand Down Expand Up @@ -88,7 +88,7 @@ class Brush :
public Snappable,
public IUndoable,
public Translatable,
public boost::noncopyable
public util::Noncopyable
{
private:
BrushNode& _owner;
Expand Down
4 changes: 2 additions & 2 deletions radiant/brush/Face.h
Expand Up @@ -12,7 +12,7 @@
#include "PlanePoints.h"
#include "FacePlane.h"
#include <memory>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
#include <sigc++/signal.h>
#include "selection/algorithm/Shader.h"

Expand All @@ -27,7 +27,7 @@ class Face :
public IFace,
public IUndoable,
public SurfaceShader::Observer,
public boost::noncopyable
public util::Noncopyable
{
private:
// The structure which is saved to the undo stack
Expand Down
4 changes: 2 additions & 2 deletions radiant/camera/CamWnd.h
Expand Up @@ -21,7 +21,7 @@

#include "selection/Rectangle.h"
#include <memory>
#include <boost/noncopyable.hpp>
#include "util/Noncopyable.h"
#include <sigc++/connection.h>
#include "tools/CameraMouseToolEvent.h"

Expand All @@ -36,7 +36,7 @@ namespace ui
class CamWnd :
public ICameraView,
public scene::Graph::Observer,
public boost::noncopyable,
public util::Noncopyable,
public sigc::trackable,
private wxutil::XmlResourceBasedWidget,
public wxEvtHandler,
Expand Down
2 changes: 1 addition & 1 deletion radiant/map/MapResource.h
Expand Up @@ -14,7 +14,7 @@ namespace map

class MapResource :
public IMapResource,
public boost::noncopyable
public util::Noncopyable
{
private:
RootNodePtr _mapRoot;
Expand Down
1 change: 1 addition & 0 deletions tools/msvc/libs.vcxproj
Expand Up @@ -207,6 +207,7 @@
<ClInclude Include="..\..\libs\Transformable.h" />
<ClInclude Include="..\..\libs\transformlib.h" />
<ClInclude Include="..\..\libs\UndoFileChangeTracker.h" />
<ClInclude Include="..\..\libs\util\Noncopyable.h" />
<ClInclude Include="..\..\libs\util\ScopedBoolLock.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
3 changes: 3 additions & 0 deletions tools/msvc/libs.vcxproj.filters
Expand Up @@ -157,6 +157,9 @@
<ClInclude Include="..\..\libs\stream\utils.h">
<Filter>stream</Filter>
</ClInclude>
<ClInclude Include="..\..\libs\util\Noncopyable.h">
<Filter>util</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="util">
Expand Down

0 comments on commit a25a3fb

Please sign in to comment.