Skip to content

Commit

Permalink
[Imaging] Remove unnecessary boost::noncopyable
Browse files Browse the repository at this point in the history
  • Loading branch information
superfunc committed Sep 5, 2018
1 parent 420469c commit 88fa590
Show file tree
Hide file tree
Showing 28 changed files with 122 additions and 57 deletions.
1 change: 0 additions & 1 deletion pxr/imaging/lib/cameraUtil/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
#include <boost/mpl/pop_front.hpp>
#include <boost/mpl/remove.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/noncopyable.hpp>
#include <boost/operators.hpp>
#include <boost/optional.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
Expand Down
12 changes: 8 additions & 4 deletions pxr/imaging/lib/glf/baseTextureData.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,25 @@
#include "pxr/base/tf/refPtr.h"
#include "pxr/base/tf/weakPtr.h"

#include <boost/noncopyable.hpp>

PXR_NAMESPACE_OPEN_SCOPE


TF_DECLARE_WEAK_AND_REF_PTRS(GlfBaseTextureData);

class GlfBaseTextureData : public TfRefBase,
public TfWeakBase,
boost::noncopyable
public TfWeakBase
{
public:
GLF_API
virtual ~GlfBaseTextureData();

GLF_API
GlfBaseTextureData() = default;

// Disallow copies
GlfBaseTextureData(const GlfBaseTextureData&) = delete;
GlfBaseTextureData& operator=(const GlfBaseTextureData&) = delete;

struct WrapInfo {
WrapInfo() :
hasWrapModeS(false), hasWrapModeT(false),
Expand Down
8 changes: 5 additions & 3 deletions pxr/imaging/lib/glf/contextCaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include "pxr/imaging/glf/api.h"
#include "pxr/base/tf/singleton.h"

#include <boost/noncopyable.hpp>

PXR_NAMESPACE_OPEN_SCOPE


Expand All @@ -51,12 +49,16 @@ PXR_NAMESPACE_OPEN_SCOPE
/// subscribe to when the caps changes, so they can
/// update and invalidate.
///
class GlfContextCaps : boost::noncopyable {
class GlfContextCaps {
public:

GLF_API
static GlfContextCaps &GetInstance();

// Disallow copies
GlfContextCaps(const GlfContextCaps&) = delete;
GlfContextCaps& operator=(const GlfContextCaps&) = delete;

// GL version
int glVersion; // 400 (4.0), 410 (4.1), ...

Expand Down
21 changes: 17 additions & 4 deletions pxr/imaging/lib/glf/glContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "pxr/pxr.h"
#include "pxr/imaging/glf/api.h"
#include "pxr/base/arch/threads.h"
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>

PXR_NAMESPACE_OPEN_SCOPE
Expand All @@ -49,11 +48,15 @@ typedef boost::shared_ptr<class GlfGLContext> GlfGLContextSharedPtr;
/// This mechanism depends on the application code registering callbacks to
/// provide access to its GL contexts.
///
class GlfGLContext : public boost::noncopyable {
class GlfGLContext {
public:
GLF_API
virtual ~GlfGLContext();

// Disallow copies
GlfGLContext(const GlfGLContext&) = delete;
GlfGLContext& operator=(const GlfGLContext&) = delete;

/// Returns an instance for the current GL context.
GLF_API
static GlfGLContextSharedPtr GetCurrentGLContext();
Expand Down Expand Up @@ -162,13 +165,17 @@ class GlfGLContext : public boost::noncopyable {
/// The underlying calls to make GL contexts current can be moderately
/// expensive. So, this mechanism should be used carefully.
///
class GlfGLContextScopeHolder : boost::noncopyable {
class GlfGLContextScopeHolder {
public:
/// Make the given context current and restore the current context
/// when this object is destroyed.
GLF_API
explicit GlfGLContextScopeHolder(const GlfGLContextSharedPtr& newContext);

// Disallow copies
GlfGLContextScopeHolder(const GlfGLContextScopeHolder&) = delete;
GlfGLContextScopeHolder& operator=(const GlfGLContextScopeHolder&) = delete;

GLF_API
~GlfGLContextScopeHolder();

Expand Down Expand Up @@ -249,11 +256,17 @@ class GlfSharedGLContextScopeHolder : private GlfGLContextScopeHolder {
/// If you subclass GlfGLContext you should subclass this type and
/// instantiate an instance on the heap. It will be cleaned up
/// automatically.
class GlfGLContextRegistrationInterface : boost::noncopyable {
class GlfGLContextRegistrationInterface {
public:
GLF_API
virtual ~GlfGLContextRegistrationInterface();

// Disallow copies
GlfGLContextRegistrationInterface(
const GlfGLContextRegistrationInterface&) = delete;
GlfGLContextRegistrationInterface& operator=(
const GlfGLContextRegistrationInterface&) = delete;

/// If this GLContext system supports a shared context this should
/// return it. This will be called at most once.
virtual GlfGLContextSharedPtr GetShared() = 0;
Expand Down
7 changes: 5 additions & 2 deletions pxr/imaging/lib/glf/glContextRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "pxr/pxr.h"
#include "pxr/imaging/glf/glContext.h"
#include "pxr/base/tf/singleton.h"
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/scoped_ptr.hpp>
Expand All @@ -46,8 +45,12 @@ typedef boost::shared_ptr<class GlfGLContext> GlfGLContextSharedPtr;
///
/// Registry of GlfGLContexts.
///
class GlfGLContextRegistry : boost::noncopyable {
class GlfGLContextRegistry {
public:
// Disallow copies
GlfGLContextRegistry(const GlfGLContextRegistry&) = delete;
GlfGLContextRegistry& operator=(const GlfGLContextRegistry&) = delete;

static GlfGLContextRegistry& GetInstance()
{
return TfSingleton<GlfGLContextRegistry>::GetInstance();
Expand Down
16 changes: 10 additions & 6 deletions pxr/imaging/lib/glf/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "pxr/base/vt/dictionary.h"
#include "pxr/base/vt/value.h"

#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>

#include <string>
Expand All @@ -51,18 +50,23 @@ typedef boost::shared_ptr<class GlfImage> GlfImageSharedPtr;
///
/// The class allows basic access to texture image file data.
///
class GlfImage : public boost::noncopyable {

class GlfImage {
public:
GLF_API
GlfImage() = default;

// Disallow copies
GlfImage(const GlfImage&) = delete;
GlfImage& operator=(const GlfImage&) = delete;

/// Specifies whether to treat the image origin as the upper-left corner
/// or the lower left
enum ImageOriginLocation
{
OriginUpperLeft,
OriginUpperLeft,
OriginLowerLeft
};
};

/// \class StorageSpec
///
/// Describes the memory layout and storage of a texture image
Expand Down
8 changes: 5 additions & 3 deletions pxr/imaging/lib/glf/simpleShadowArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@
#include "pxr/base/gf/vec4d.h"
#include "pxr/imaging/garch/gl.h"

#include <boost/noncopyable.hpp>
#include <vector>

PXR_NAMESPACE_OPEN_SCOPE


class GlfSimpleShadowArray : public TfRefBase,
public TfWeakBase,
boost::noncopyable {
public TfWeakBase {
public:
GLF_API
GlfSimpleShadowArray(GfVec2i const & size, size_t numLayers);
GLF_API
virtual ~GlfSimpleShadowArray();

// Disallow copies
GlfSimpleShadowArray(const GlfSimpleShadowArray&) = delete;
GlfSimpleShadowArray& operator=(const GlfSimpleShadowArray&) = delete;

GLF_API
GfVec2i GetSize() const;
GLF_API
Expand Down
7 changes: 5 additions & 2 deletions pxr/imaging/lib/glf/texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <map>
#include <string>
#include <vector>
#include <boost/noncopyable.hpp>

PXR_NAMESPACE_OPEN_SCOPE

Expand All @@ -60,7 +59,7 @@ TF_DECLARE_WEAK_AND_REF_PTRS(GlfTexture);
/// A texture is typically defined by reading texture image data from an image
/// file but a texture might also represent an attachment of a draw target.
///
class GlfTexture : public TfRefBase, public TfWeakBase, boost::noncopyable {
class GlfTexture : public TfRefBase, public TfWeakBase {
public:
/// \class Binding
///
Expand Down Expand Up @@ -90,6 +89,10 @@ class GlfTexture : public TfRefBase, public TfWeakBase, boost::noncopyable {
GLF_API
virtual ~GlfTexture() = 0;

// Disallow copies
GlfTexture(const GlfTexture&) = delete;
GlfTexture& operator=(const GlfTexture&) = delete;

/// Returns the bindings to use this texture for the shader resource
/// named \a identifier. If \a samplerId is specified, the bindings
/// returned will use this samplerId for resources which can be sampled.
Expand Down
7 changes: 5 additions & 2 deletions pxr/imaging/lib/glf/textureRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "pxr/base/tf/weakPtr.h"
#include "pxr/base/vt/dictionary.h"

#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <map>

Expand All @@ -51,8 +50,12 @@ class GlfTextureFactoryBase;

/// \class GlfTextureRegistry
///
class GlfTextureRegistry : boost::noncopyable {
class GlfTextureRegistry {
public:
// Disallow copies
GlfTextureRegistry(const GlfTextureRegistry&) = delete;
GlfTextureRegistry& operator=(const GlfTextureRegistry&) = delete;

GLF_API
static GlfTextureRegistry & GetInstance();

Expand Down
8 changes: 5 additions & 3 deletions pxr/imaging/lib/hd/bufferArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "pxr/base/tf/token.h"
#include "pxr/base/vt/value.h"

#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>

Expand All @@ -55,8 +54,7 @@ typedef boost::shared_ptr<class HdBufferSource> HdBufferSourceSharedPtr;
/// can be shared across multiple HdRprims, in the context of buffer
/// aggregation.
///
class HdBufferArray : public boost::enable_shared_from_this<HdBufferArray>,
boost::noncopyable {
class HdBufferArray : public boost::enable_shared_from_this<HdBufferArray> {
public:
HD_API
HdBufferArray(TfToken const &role,
Expand All @@ -66,6 +64,10 @@ class HdBufferArray : public boost::enable_shared_from_this<HdBufferArray>,
HD_API
virtual ~HdBufferArray();

// Disallow copies
HdBufferArray(const HdBufferArray&) = delete;
HdBufferArray& operator=(const HdBufferArray&) = delete;

/// Returns the role of the GPU data in this bufferArray.
TfToken const& GetRole() const {return _role;}

Expand Down
10 changes: 8 additions & 2 deletions pxr/imaging/lib/hd/bufferArrayRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "pxr/base/vt/value.h"
#include "pxr/imaging/hd/bufferResource.h"

#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>

PXR_NAMESPACE_OPEN_SCOPE
Expand All @@ -51,7 +50,7 @@ typedef boost::shared_ptr<class HdBufferArrayRange> HdBufferArrayRangeSharedPtr;
/// inherited of this interface so that client (drawItem) can be agnostic about
/// the implementation detail of aggregation.
///
class HdBufferArrayRange : boost::noncopyable {
class HdBufferArrayRange {
public:
/// Destructor (do nothing).
/// The specialized range class may want to do something for garbage
Expand All @@ -61,6 +60,13 @@ class HdBufferArrayRange : boost::noncopyable {
HD_API
virtual ~HdBufferArrayRange();

/// Default constructor
HdBufferArrayRange() = default;

/// Disallow copies
HdBufferArrayRange(const HdBufferArrayRange&) = delete;
HdBufferArrayRange& operator=(const HdBufferArrayRange&) = delete;

/// Returns true if this range is valid
virtual bool IsValid() const = 0;

Expand Down
6 changes: 4 additions & 2 deletions pxr/imaging/lib/hd/bufferArrayRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "pxr/base/vt/dictionary.h"
#include "pxr/base/tf/token.h"

#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <tbb/concurrent_unordered_map.h>

Expand All @@ -54,14 +53,17 @@ typedef boost::shared_ptr<class HdBufferArray> HdBufferArraySharedPtr;
///
/// Manages the pool of buffer arrays.
///
class HdBufferArrayRegistry : public boost::noncopyable {
class HdBufferArrayRegistry {
public:
HF_MALLOC_TAG_NEW("new HdBufferArrayRegistry");

HD_API
HdBufferArrayRegistry();
~HdBufferArrayRegistry() = default;

HdBufferArrayRegistry(const HdBufferArrayRegistry&) = delete;
HdBufferArrayRegistry& operator=(const HdBufferArrayRegistry&) = delete;

/// Allocate new buffer array range using strategy
/// Thread-Safe
HD_API
Expand Down
7 changes: 5 additions & 2 deletions pxr/imaging/lib/hd/bufferSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#include <atomic>
#include <vector>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>

Expand All @@ -57,10 +56,14 @@ typedef boost::weak_ptr<HdBufferSource> HdBufferSourceWeakPtr;
/// The public interface provided is intended to be convenient for OpenGL API
/// calls.
///
class HdBufferSource : public boost::noncopyable {
class HdBufferSource {
public:
HdBufferSource() : _state(UNRESOLVED) { }

// Disallow copies
HdBufferSource(const HdBufferSource&) = delete;
HdBufferSource& operator=(const HdBufferSource&) = delete;

HD_API
virtual ~HdBufferSource();

Expand Down
Loading

0 comments on commit 88fa590

Please sign in to comment.