From 3077316782c6ba9601b21e07a06c0a66273931bb Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 23 May 2018 23:35:27 +0200 Subject: [PATCH] general: use proper deleted funcs instead of stubs with asserts This gives better compile-time diagnostics and saves on code, while also better communicating intent. --- panda/src/display/displayRegion.I | 16 -------- panda/src/display/displayRegion.cxx | 19 ---------- panda/src/display/displayRegion.h | 11 ++---- panda/src/display/graphicsDevice.cxx | 16 -------- panda/src/display/graphicsDevice.h | 6 +-- panda/src/display/graphicsOutput.cxx | 19 ---------- panda/src/display/graphicsOutput.h | 6 +-- panda/src/express/multifile.cxx | 19 ---------- panda/src/express/multifile.h | 5 +-- panda/src/ffmpeg/ffmpegVirtualFile.cxx | 16 -------- panda/src/ffmpeg/ffmpegVirtualFile.h | 7 ++-- panda/src/gobj/geomVertexArrayData.I | 17 --------- panda/src/gobj/geomVertexArrayData.h | 6 ++- panda/src/grutil/movieTexture.cxx | 11 ------ panda/src/grutil/movieTexture.h | 4 +- .../src/grutil/pipeOcclusionCullTraverser.cxx | 10 ----- panda/src/grutil/pipeOcclusionCullTraverser.h | 2 +- panda/src/pgraph/nodePathComponent.I | 17 --------- panda/src/pgraph/nodePathComponent.h | 6 ++- panda/src/pgraph/pandaNode.cxx | 9 ----- panda/src/pgraph/pandaNode.h | 4 +- panda/src/pgraph/renderAttrib.cxx | 16 -------- panda/src/pgraph/renderAttrib.h | 6 +-- panda/src/pgraph/renderEffect.cxx | 16 -------- panda/src/pgraph/renderEffect.h | 6 +-- panda/src/pgraph/renderEffects.cxx | 16 -------- panda/src/pgraph/renderEffects.h | 7 ++-- panda/src/pgraph/renderState.cxx | 8 ---- panda/src/pgraph/renderState.h | 3 +- panda/src/pgraph/transformState.cxx | 16 -------- panda/src/pgraph/transformState.h | 7 ++-- panda/src/pipeline/conditionVar.I | 38 ------------------- panda/src/pipeline/conditionVar.h | 17 ++++----- panda/src/pipeline/conditionVarDebug.I | 19 ---------- panda/src/pipeline/conditionVarDebug.h | 6 +-- panda/src/pipeline/conditionVarDirect.I | 26 ------------- panda/src/pipeline/conditionVarDirect.h | 8 ++-- panda/src/pipeline/conditionVarFull.I | 29 -------------- panda/src/pipeline/conditionVarFull.h | 9 ++--- panda/src/pipeline/conditionVarFullDebug.I | 19 ---------- panda/src/pipeline/conditionVarFullDebug.h | 6 +-- panda/src/pipeline/conditionVarFullDirect.I | 26 ------------- panda/src/pipeline/conditionVarFullDirect.h | 8 ++-- panda/src/pipeline/cyclerHolder.I | 16 -------- panda/src/pipeline/cyclerHolder.h | 6 +-- panda/src/pipeline/lightMutex.h | 2 +- panda/src/pipeline/lightMutexHolder.I | 16 -------- panda/src/pipeline/lightMutexHolder.h | 6 +-- panda/src/pipeline/lightReMutex.I | 15 -------- panda/src/pipeline/lightReMutex.h | 8 ++-- panda/src/pipeline/lightReMutexHolder.I | 16 -------- panda/src/pipeline/lightReMutexHolder.h | 6 +-- panda/src/pipeline/mutexHolder.I | 16 -------- panda/src/pipeline/mutexHolder.h | 6 +-- .../src/pipeline/pipelineCyclerTrivialImpl.I | 29 -------------- .../src/pipeline/pipelineCyclerTrivialImpl.h | 9 ++--- panda/src/pipeline/psemaphore.I | 25 ------------ panda/src/pipeline/psemaphore.h | 8 ++-- panda/src/pipeline/reMutexHolder.I | 16 -------- panda/src/pipeline/reMutexHolder.h | 6 +-- panda/src/pipeline/thread.I | 16 -------- panda/src/pipeline/thread.h | 7 ++-- panda/src/speedtree/stTree.cxx | 9 ----- panda/src/speedtree/stTree.h | 3 +- panda/src/text/dynamicTextGlyph.I | 19 ---------- panda/src/text/dynamicTextGlyph.h | 6 +-- panda/src/vision/openCVTexture.cxx | 12 ------ panda/src/vision/openCVTexture.h | 4 +- 68 files changed, 101 insertions(+), 719 deletions(-) diff --git a/panda/src/display/displayRegion.I b/panda/src/display/displayRegion.I index e402e0ad7b..a1f55f5e7f 100644 --- a/panda/src/display/displayRegion.I +++ b/panda/src/display/displayRegion.I @@ -567,22 +567,6 @@ DisplayRegionPipelineReader(DisplayRegion *object, Thread *current_thread) : #endif // _DEBUG } -/** - * Don't attempt to copy these objects. - */ -INLINE DisplayRegionPipelineReader:: -DisplayRegionPipelineReader(const DisplayRegionPipelineReader &) { - nassertv(false); -} - -/** - * Don't attempt to copy these objects. - */ -INLINE void DisplayRegionPipelineReader:: -operator = (const DisplayRegionPipelineReader &) { - nassertv(false); -} - /** * */ diff --git a/panda/src/display/displayRegion.cxx b/panda/src/display/displayRegion.cxx index 99aea51477..a84a8728e8 100644 --- a/panda/src/display/displayRegion.cxx +++ b/panda/src/display/displayRegion.cxx @@ -46,25 +46,6 @@ DisplayRegion(GraphicsOutput *window, const LVecBase4 &dimensions) : _window->add_display_region(this); } -/** - * - */ -DisplayRegion:: -DisplayRegion(const DisplayRegion ©) : - _window(NULL), - _cull_region_pcollector("Cull:Invalid"), - _draw_region_pcollector("Draw:Invalid") -{ -} - -/** - * - */ -void DisplayRegion:: -operator = (const DisplayRegion&) { - nassertv(false); -} - /** * */ diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 091f17e13f..7599f17c9d 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -57,10 +57,8 @@ class CullTraverser; class EXPCL_PANDA_DISPLAY DisplayRegion : public TypedReferenceCount, public DrawableRegion { protected: DisplayRegion(GraphicsOutput *window, const LVecBase4 &dimensions); - -private: - DisplayRegion(const DisplayRegion ©); - void operator = (const DisplayRegion ©); + DisplayRegion(const DisplayRegion ©) = delete; + void operator = (const DisplayRegion ©) = delete; public: virtual ~DisplayRegion(); @@ -310,9 +308,8 @@ private: class EXPCL_PANDA_DISPLAY DisplayRegionPipelineReader { public: INLINE DisplayRegionPipelineReader(DisplayRegion *object, Thread *current_thread); -private: - INLINE DisplayRegionPipelineReader(const DisplayRegionPipelineReader ©); - INLINE void operator = (const DisplayRegionPipelineReader ©); + DisplayRegionPipelineReader(const DisplayRegionPipelineReader ©) = delete; + void operator = (const DisplayRegionPipelineReader ©) = delete; public: INLINE ~DisplayRegionPipelineReader(); diff --git a/panda/src/display/graphicsDevice.cxx b/panda/src/display/graphicsDevice.cxx index fb74bca7d8..665e12534e 100644 --- a/panda/src/display/graphicsDevice.cxx +++ b/panda/src/display/graphicsDevice.cxx @@ -34,22 +34,6 @@ GraphicsDevice(GraphicsPipe *pipe) { } } -/** - * - */ -GraphicsDevice:: -GraphicsDevice(const GraphicsDevice &) { - nassertv(false); -} - -/** - * - */ -void GraphicsDevice:: -operator = (const GraphicsDevice &) { - nassertv(false); -} - /** * */ diff --git a/panda/src/display/graphicsDevice.h b/panda/src/display/graphicsDevice.h index afb1edb697..532024642a 100644 --- a/panda/src/display/graphicsDevice.h +++ b/panda/src/display/graphicsDevice.h @@ -30,10 +30,8 @@ class GraphicsPipe; class EXPCL_PANDA_DISPLAY GraphicsDevice : public TypedReferenceCount { public: GraphicsDevice(GraphicsPipe *pipe); - -private: - GraphicsDevice(const GraphicsDevice ©); - void operator = (const GraphicsDevice ©); + GraphicsDevice(const GraphicsDevice ©) = delete; + GraphicsDevice &operator = (const GraphicsDevice ©) = delete; PUBLISHED: virtual ~GraphicsDevice(); diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 4d8a1e27a1..cb2f69ff6c 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -159,25 +159,6 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe, set_clear_color(background_color.get_value()); } -/** - * - */ -GraphicsOutput:: -GraphicsOutput(const GraphicsOutput &) : - _cull_window_pcollector(_cull_pcollector, "Invalid"), - _draw_window_pcollector(_draw_pcollector, "Invalid") -{ - nassertv(false); -} - -/** - * - */ -void GraphicsOutput:: -operator = (const GraphicsOutput &) { - nassertv(false); -} - /** * */ diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index 2f9eff8683..93db287a74 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -70,10 +70,8 @@ protected: GraphicsStateGuardian *gsg, GraphicsOutput *host, bool default_stereo_flags); - -private: - GraphicsOutput(const GraphicsOutput ©); - void operator = (const GraphicsOutput ©); + GraphicsOutput(const GraphicsOutput ©) = delete; + GraphicsOutput &operator = (const GraphicsOutput ©) = delete; PUBLISHED: enum RenderTextureMode { diff --git a/panda/src/express/multifile.cxx b/panda/src/express/multifile.cxx index 5a7d86f17b..0bedba8909 100644 --- a/panda/src/express/multifile.cxx +++ b/panda/src/express/multifile.cxx @@ -136,25 +136,6 @@ Multifile:: close(); } -/** - * Don't try to copy Multifiles. - */ -Multifile:: -Multifile(const Multifile ©) : - _read_filew(_read_file), - _read_write_filew(_read_write_file) -{ - nassertv(false); -} - -/** - * Don't try to copy Multifiles. - */ -void Multifile:: -operator = (const Multifile ©) { - nassertv(false); -} - /** * Opens the named Multifile on disk for reading. The Multifile index is read * in, and the list of subfiles becomes available; individual subfiles may diff --git a/panda/src/express/multifile.h b/panda/src/express/multifile.h index d9f7217dfd..ad0296055c 100644 --- a/panda/src/express/multifile.h +++ b/panda/src/express/multifile.h @@ -37,11 +37,10 @@ typedef struct evp_pkey_st EVP_PKEY; class EXPCL_PANDAEXPRESS Multifile : public ReferenceCount { PUBLISHED: Multifile(); + Multifile(const Multifile ©) = delete; ~Multifile(); -private: - Multifile(const Multifile ©); - void operator = (const Multifile ©); + Multifile &operator = (const Multifile ©) = delete; PUBLISHED: BLOCKING bool open_read(const Filename &multifile_name, const streampos &offset = 0); diff --git a/panda/src/ffmpeg/ffmpegVirtualFile.cxx b/panda/src/ffmpeg/ffmpegVirtualFile.cxx index 8819db74bc..0d97f0b5f4 100644 --- a/panda/src/ffmpeg/ffmpegVirtualFile.cxx +++ b/panda/src/ffmpeg/ffmpegVirtualFile.cxx @@ -47,22 +47,6 @@ FfmpegVirtualFile:: close(); } -/** - * These objects are not meant to be copied. - */ -FfmpegVirtualFile:: -FfmpegVirtualFile(const FfmpegVirtualFile ©) { - nassertv(false); -} - -/** - * These objects are not meant to be copied. - */ -void FfmpegVirtualFile:: -operator = (const FfmpegVirtualFile ©) { - nassertv(false); -} - /** * Opens the movie file via Panda's VFS. Returns true on success, false on * failure. If successful, use get_format_context() to get the open file diff --git a/panda/src/ffmpeg/ffmpegVirtualFile.h b/panda/src/ffmpeg/ffmpegVirtualFile.h index 746fec67a0..197320d4dc 100644 --- a/panda/src/ffmpeg/ffmpegVirtualFile.h +++ b/panda/src/ffmpeg/ffmpegVirtualFile.h @@ -34,12 +34,11 @@ struct AVFormatContext; class EXPCL_FFMPEG FfmpegVirtualFile { public: FfmpegVirtualFile(); + FfmpegVirtualFile(const FfmpegVirtualFile ©) = delete; ~FfmpegVirtualFile(); -private: - FfmpegVirtualFile(const FfmpegVirtualFile ©); - void operator = (const FfmpegVirtualFile ©); -public: + FfmpegVirtualFile &operator = (const FfmpegVirtualFile ©) = delete; + bool open_vfs(const Filename &filename); bool open_subfile(const SubfileInfo &info); void close(); diff --git a/panda/src/gobj/geomVertexArrayData.I b/panda/src/gobj/geomVertexArrayData.I index 97811498a4..a9005fde12 100644 --- a/panda/src/gobj/geomVertexArrayData.I +++ b/panda/src/gobj/geomVertexArrayData.I @@ -371,23 +371,6 @@ GeomVertexArrayDataHandle(GeomVertexArrayData *object, #endif } -/** - * Don't attempt to copy these objects. - */ -INLINE GeomVertexArrayDataHandle:: -GeomVertexArrayDataHandle(const GeomVertexArrayDataHandle ©) - : _current_thread(copy._current_thread) { - nassertv(false); -} - -/** - * Don't attempt to copy these objects. - */ -INLINE void GeomVertexArrayDataHandle:: -operator = (const GeomVertexArrayDataHandle &) { - nassertv(false); -} - /** * */ diff --git a/panda/src/gobj/geomVertexArrayData.h b/panda/src/gobj/geomVertexArrayData.h index 7047358adc..264c9a1971 100644 --- a/panda/src/gobj/geomVertexArrayData.h +++ b/panda/src/gobj/geomVertexArrayData.h @@ -257,15 +257,17 @@ private: Thread *current_thread); INLINE GeomVertexArrayDataHandle(GeomVertexArrayData *object, Thread *current_thread); - INLINE GeomVertexArrayDataHandle(const GeomVertexArrayDataHandle &); - INLINE void operator = (const GeomVertexArrayDataHandle &); PUBLISHED: INLINE ~GeomVertexArrayDataHandle(); public: + GeomVertexArrayDataHandle(const GeomVertexArrayDataHandle &) = delete; + ALLOC_DELETED_CHAIN_DECL(GeomVertexArrayDataHandle); + GeomVertexArrayDataHandle &operator = (const GeomVertexArrayDataHandle &) = delete; + INLINE Thread *get_current_thread() const; INLINE const unsigned char *get_read_pointer(bool force) const RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT); diff --git a/panda/src/grutil/movieTexture.cxx b/panda/src/grutil/movieTexture.cxx index a2d8d3bc3a..8f2850380b 100644 --- a/panda/src/grutil/movieTexture.cxx +++ b/panda/src/grutil/movieTexture.cxx @@ -92,17 +92,6 @@ make_copy() const { return new CData(*this); } -/** - * Use MovieTexture::make_copy() to make a duplicate copy of an existing - * MovieTexture. - */ -MovieTexture:: -MovieTexture(const MovieTexture ©) : - Texture(copy) -{ - nassertv(false); -} - /** * xxx */ diff --git a/panda/src/grutil/movieTexture.h b/panda/src/grutil/movieTexture.h index d719f21d87..0881552036 100644 --- a/panda/src/grutil/movieTexture.h +++ b/panda/src/grutil/movieTexture.h @@ -34,9 +34,7 @@ class EXPCL_PANDA_GRUTIL MovieTexture : public Texture { PUBLISHED: explicit MovieTexture(const string &name); explicit MovieTexture(MovieVideo *video); -private: - MovieTexture(const MovieTexture ©); -PUBLISHED: + MovieTexture(const MovieTexture ©) = delete; virtual ~MovieTexture(); INLINE double get_video_length() const; diff --git a/panda/src/grutil/pipeOcclusionCullTraverser.cxx b/panda/src/grutil/pipeOcclusionCullTraverser.cxx index 1052d5ace5..d257611767 100644 --- a/panda/src/grutil/pipeOcclusionCullTraverser.cxx +++ b/panda/src/grutil/pipeOcclusionCullTraverser.cxx @@ -119,16 +119,6 @@ PipeOcclusionCullTraverser(GraphicsOutput *host) { _live = true; } -/** - * - */ -PipeOcclusionCullTraverser:: -PipeOcclusionCullTraverser(const PipeOcclusionCullTraverser ©) : - CullTraverser(copy) -{ - nassertv(false); -} - /** * */ diff --git a/panda/src/grutil/pipeOcclusionCullTraverser.h b/panda/src/grutil/pipeOcclusionCullTraverser.h index 55d2a795ce..d41c5acff4 100644 --- a/panda/src/grutil/pipeOcclusionCullTraverser.h +++ b/panda/src/grutil/pipeOcclusionCullTraverser.h @@ -42,7 +42,7 @@ class EXPCL_PANDA_GRUTIL PipeOcclusionCullTraverser : public CullTraverser, public CullHandler { PUBLISHED: explicit PipeOcclusionCullTraverser(GraphicsOutput *host); - PipeOcclusionCullTraverser(const PipeOcclusionCullTraverser ©); + PipeOcclusionCullTraverser(const PipeOcclusionCullTraverser ©) = delete; virtual void set_scene(SceneSetup *scene_setup, GraphicsStateGuardianBase *gsg, diff --git a/panda/src/pgraph/nodePathComponent.I b/panda/src/pgraph/nodePathComponent.I index d3abe36c07..b54d4cfc7d 100644 --- a/panda/src/pgraph/nodePathComponent.I +++ b/panda/src/pgraph/nodePathComponent.I @@ -29,23 +29,6 @@ CData(const NodePathComponent::CData ©) : { } -/** - * NodePathComponents should not be copied. - */ -INLINE NodePathComponent:: -NodePathComponent(const NodePathComponent ©) { - nassertv(false); -} - -/** - * NodePathComponents should not be copied. - */ -INLINE void NodePathComponent:: -operator = (const NodePathComponent ©) { - nassertv(false); -} - - /** * */ diff --git a/panda/src/pgraph/nodePathComponent.h b/panda/src/pgraph/nodePathComponent.h index 3752d7e834..b6957ffd9a 100644 --- a/panda/src/pgraph/nodePathComponent.h +++ b/panda/src/pgraph/nodePathComponent.h @@ -43,13 +43,15 @@ class EXPCL_PANDA_PGRAPH NodePathComponent final : public ReferenceCount { private: NodePathComponent(PandaNode *node, NodePathComponent *next, int pipeline_stage, Thread *current_thread); - INLINE NodePathComponent(const NodePathComponent ©); - INLINE void operator = (const NodePathComponent ©); public: + NodePathComponent(const NodePathComponent ©) = delete; INLINE ~NodePathComponent(); + ALLOC_DELETED_CHAIN(NodePathComponent); + NodePathComponent &operator = (const NodePathComponent ©) = delete; + INLINE PandaNode *get_node() const; INLINE bool has_key() const; int get_key() const; diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 96b94dd0c2..91afd2f768 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -175,15 +175,6 @@ PandaNode(const PandaNode ©) : } } -/** - * Do not call the copy assignment operator at all. Use make_copy() or - * copy_subgraph() to make a copy of a node. - */ -void PandaNode:: -operator = (const PandaNode ©) { - nassertv(false); -} - /** * This is similar to make_copy(), but it makes a copy for the specific * purpose of flatten. Typically, this will be a new PandaNode with a new diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 74d362113e..f5cc0fee78 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -71,8 +71,8 @@ PUBLISHED: protected: PandaNode(const PandaNode ©); -private: - void operator = (const PandaNode ©); + + PandaNode &operator = (const PandaNode ©) = delete; public: virtual PandaNode *dupe_for_flatten() const; diff --git a/panda/src/pgraph/renderAttrib.cxx b/panda/src/pgraph/renderAttrib.cxx index 385d7ee740..45f8ea2fb9 100644 --- a/panda/src/pgraph/renderAttrib.cxx +++ b/panda/src/pgraph/renderAttrib.cxx @@ -37,22 +37,6 @@ RenderAttrib() { _saved_entry = -1; } -/** - * RenderAttribs are not meant to be copied. - */ -RenderAttrib:: -RenderAttrib(const RenderAttrib &) { - nassertv(false); -} - -/** - * RenderAttribs are not meant to be copied. - */ -void RenderAttrib:: -operator = (const RenderAttrib &) { - nassertv(false); -} - /** * The destructor is responsible for removing the RenderAttrib from the global * set if it is there. diff --git a/panda/src/pgraph/renderAttrib.h b/panda/src/pgraph/renderAttrib.h index fe364d8ea4..b506d64841 100644 --- a/panda/src/pgraph/renderAttrib.h +++ b/panda/src/pgraph/renderAttrib.h @@ -51,13 +51,13 @@ class RenderState; class EXPCL_PANDA_PGRAPH RenderAttrib : public TypedWritableReferenceCount { protected: RenderAttrib(); -private: - RenderAttrib(const RenderAttrib ©); - void operator = (const RenderAttrib ©); public: + RenderAttrib(const RenderAttrib ©) = delete; virtual ~RenderAttrib(); + RenderAttrib &operator = (const RenderAttrib ©) = delete; + PUBLISHED: INLINE CPT(RenderAttrib) compose(const RenderAttrib *other) const; INLINE CPT(RenderAttrib) invert_compose(const RenderAttrib *other) const; diff --git a/panda/src/pgraph/renderEffect.cxx b/panda/src/pgraph/renderEffect.cxx index 09572cc445..585db7db26 100644 --- a/panda/src/pgraph/renderEffect.cxx +++ b/panda/src/pgraph/renderEffect.cxx @@ -35,22 +35,6 @@ RenderEffect() { _saved_entry = _effects->end(); } -/** - * RenderEffects are not meant to be copied. - */ -RenderEffect:: -RenderEffect(const RenderEffect &) { - nassertv(false); -} - -/** - * RenderEffects are not meant to be copied. - */ -void RenderEffect:: -operator = (const RenderEffect &) { - nassertv(false); -} - /** * The destructor is responsible for removing the RenderEffect from the global * set if it is there. diff --git a/panda/src/pgraph/renderEffect.h b/panda/src/pgraph/renderEffect.h index d739f5cee7..65a9942fa7 100644 --- a/panda/src/pgraph/renderEffect.h +++ b/panda/src/pgraph/renderEffect.h @@ -48,13 +48,13 @@ class PandaNode; class EXPCL_PANDA_PGRAPH RenderEffect : public TypedWritableReferenceCount { protected: RenderEffect(); -private: - RenderEffect(const RenderEffect ©); - void operator = (const RenderEffect ©); public: + RenderEffect(const RenderEffect ©) = delete; virtual ~RenderEffect(); + RenderEffect &operator = (const RenderEffect ©) = delete; + virtual bool safe_to_transform() const; virtual CPT(TransformState) prepare_flatten_transform(const TransformState *net_transform) const; virtual bool safe_to_combine() const; diff --git a/panda/src/pgraph/renderEffects.cxx b/panda/src/pgraph/renderEffects.cxx index 639f11be9b..aaa81773ce 100644 --- a/panda/src/pgraph/renderEffects.cxx +++ b/panda/src/pgraph/renderEffects.cxx @@ -48,22 +48,6 @@ RenderEffects() : _lock("RenderEffects") { _flags = 0; } -/** - * RenderEffects are not meant to be copied. - */ -RenderEffects:: -RenderEffects(const RenderEffects &) { - nassertv(false); -} - -/** - * RenderEffects are not meant to be copied. - */ -void RenderEffects:: -operator = (const RenderEffects &) { - nassertv(false); -} - /** * The destructor is responsible for removing the RenderEffects from the * global set if it is there. diff --git a/panda/src/pgraph/renderEffects.h b/panda/src/pgraph/renderEffects.h index 1e54c30533..7a8f18aed3 100644 --- a/panda/src/pgraph/renderEffects.h +++ b/panda/src/pgraph/renderEffects.h @@ -42,13 +42,12 @@ class EXPCL_PANDA_PGRAPH RenderEffects : public TypedWritableReferenceCount { protected: RenderEffects(); -private: - RenderEffects(const RenderEffects ©); - void operator = (const RenderEffects ©); - public: + RenderEffects(const RenderEffects ©) = delete; virtual ~RenderEffects(); + RenderEffects &operator = (const RenderEffects ©) = delete; + bool safe_to_transform() const; virtual CPT(TransformState) prepare_flatten_transform(const TransformState *net_transform) const; bool safe_to_combine() const; diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index 6f035a6557..a4d2952e50 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/panda/src/pgraph/renderState.cxx @@ -105,14 +105,6 @@ RenderState(const RenderState ©) : #endif } -/** - * RenderStates are not meant to be copied. - */ -void RenderState:: -operator = (const RenderState &) { - nassertv(false); -} - /** * The destructor is responsible for removing the RenderState from the global * set if it is there. diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index 1052687314..433582fd2c 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -50,12 +50,13 @@ protected: private: RenderState(const RenderState ©); - void operator = (const RenderState ©); public: virtual ~RenderState(); ALLOC_DELETED_CHAIN(RenderState); + RenderState &operator = (const RenderState ©) = delete; + typedef RenderAttribRegistry::SlotMask SlotMask; PUBLISHED: diff --git a/panda/src/pgraph/transformState.cxx b/panda/src/pgraph/transformState.cxx index bff497298e..c66bd3a281 100644 --- a/panda/src/pgraph/transformState.cxx +++ b/panda/src/pgraph/transformState.cxx @@ -68,22 +68,6 @@ TransformState() : _lock("TransformState") { #endif } -/** - * TransformStates are not meant to be copied. - */ -TransformState:: -TransformState(const TransformState &) { - nassertv(false); -} - -/** - * TransformStates are not meant to be copied. - */ -void TransformState:: -operator = (const TransformState &) { - nassertv(false); -} - /** * The destructor is responsible for removing the TransformState from the * global set if it is there. diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index 2313ea136f..5edd8985d6 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -55,14 +55,13 @@ class EXPCL_PANDA_PGRAPH TransformState final : public NodeCachedReferenceCount protected: TransformState(); -private: - TransformState(const TransformState ©); - void operator = (const TransformState ©); - public: + TransformState(const TransformState ©) = delete; virtual ~TransformState(); ALLOC_DELETED_CHAIN(TransformState); + TransformState &operator = (const TransformState ©) = delete; + PUBLISHED: INLINE bool operator != (const TransformState &other) const; INLINE int compare_to(const TransformState &other) const; diff --git a/panda/src/pipeline/conditionVar.I b/panda/src/pipeline/conditionVar.I index d797ab2390..196e4283d0 100644 --- a/panda/src/pipeline/conditionVar.I +++ b/panda/src/pipeline/conditionVar.I @@ -27,44 +27,6 @@ ConditionVar(Mutex &mutex) : { } -/** - * - */ -INLINE ConditionVar:: -~ConditionVar() { -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE ConditionVar:: -ConditionVar(const ConditionVar ©) : -#ifdef DEBUG_THREADS - ConditionVarDebug(copy.get_mutex()) -#else - ConditionVarDirect(copy.get_mutex()) -#endif // DEBUG_THREADS -{ - nassertv(false); -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE void ConditionVar:: -operator = (const ConditionVar ©) { - nassertv(false); -} - -/** - * The notify_all() method is specifically *not* provided by ConditionVar. - * Use ConditionVarFull if you need to call this method. - */ -INLINE void ConditionVar:: -notify_all() { - nassertv(false); -} - /** * Returns the mutex associated with this condition variable. */ diff --git a/panda/src/pipeline/conditionVar.h b/panda/src/pipeline/conditionVar.h index 3c94e03a34..fe90e22063 100644 --- a/panda/src/pipeline/conditionVar.h +++ b/panda/src/pipeline/conditionVar.h @@ -43,20 +43,19 @@ class EXPCL_PANDA_PIPELINE ConditionVar : public ConditionVarDirect { PUBLISHED: INLINE explicit ConditionVar(Mutex &mutex); - INLINE ~ConditionVar(); -private: - INLINE ConditionVar(const ConditionVar ©); - INLINE void operator = (const ConditionVar ©); + ConditionVar(const ConditionVar ©) = delete; + ~ConditionVar() = default; - // These methods are inherited from the base class. INLINE void wait(); - // INLINE void notify(); + ConditionVar &operator = (const ConditionVar ©) = delete; + + // These methods are inherited from the base class. + //INLINE void wait(); + //INLINE void notify(); -private: // The notify_all() method is specifically *not* provided by ConditionVar. // Use ConditionVarFull if you need to call this method. - INLINE void notify_all(); + void notify_all() = delete; -PUBLISHED: INLINE Mutex &get_mutex() const; }; diff --git a/panda/src/pipeline/conditionVarDebug.I b/panda/src/pipeline/conditionVarDebug.I index 6b16125a0e..f7804b22b2 100644 --- a/panda/src/pipeline/conditionVarDebug.I +++ b/panda/src/pipeline/conditionVarDebug.I @@ -11,25 +11,6 @@ * @date 2006-02-13 */ -/** - * Do not attempt to copy condition variables. - */ -INLINE ConditionVarDebug:: -ConditionVarDebug(const ConditionVarDebug ©) : - _mutex(copy._mutex), - _impl(*_mutex._global_lock) -{ - nassertv(false); -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE void ConditionVarDebug:: -operator = (const ConditionVarDebug ©) { - nassertv(false); -} - /** * Returns the mutex associated with this condition variable. */ diff --git a/panda/src/pipeline/conditionVarDebug.h b/panda/src/pipeline/conditionVarDebug.h index 7cbacbaf0d..b8243438c9 100644 --- a/panda/src/pipeline/conditionVarDebug.h +++ b/panda/src/pipeline/conditionVarDebug.h @@ -32,10 +32,10 @@ class EXPCL_PANDA_PIPELINE ConditionVarDebug { public: explicit ConditionVarDebug(MutexDebug &mutex); + ConditionVarDebug(const ConditionVarDebug ©) = delete; virtual ~ConditionVarDebug(); -private: - INLINE ConditionVarDebug(const ConditionVarDebug ©); - INLINE void operator = (const ConditionVarDebug ©); + + ConditionVarDebug &operator = (const ConditionVarDebug ©) = delete; PUBLISHED: INLINE MutexDebug &get_mutex() const; diff --git a/panda/src/pipeline/conditionVarDirect.I b/panda/src/pipeline/conditionVarDirect.I index 6b9d0351bf..bf8e42aea5 100644 --- a/panda/src/pipeline/conditionVarDirect.I +++ b/panda/src/pipeline/conditionVarDirect.I @@ -24,32 +24,6 @@ ConditionVarDirect(MutexDirect &mutex) : { } -/** - * - */ -INLINE ConditionVarDirect:: -~ConditionVarDirect() { -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE ConditionVarDirect:: -ConditionVarDirect(const ConditionVarDirect ©) : - _mutex(copy._mutex), - _impl(_mutex._impl) -{ - nassertv(false); -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE void ConditionVarDirect:: -operator = (const ConditionVarDirect ©) { - nassertv(false); -} - /** * Returns the mutex associated with this condition variable. */ diff --git a/panda/src/pipeline/conditionVarDirect.h b/panda/src/pipeline/conditionVarDirect.h index 116f22b899..7315c0b0bb 100644 --- a/panda/src/pipeline/conditionVarDirect.h +++ b/panda/src/pipeline/conditionVarDirect.h @@ -32,10 +32,10 @@ class EXPCL_PANDA_PIPELINE ConditionVarDirect { public: INLINE explicit ConditionVarDirect(MutexDirect &mutex); - INLINE ~ConditionVarDirect(); -private: - INLINE ConditionVarDirect(const ConditionVarDirect ©); - INLINE void operator = (const ConditionVarDirect ©); + ConditionVarDirect(const ConditionVarDirect ©) = delete; + ~ConditionVarDirect() = default; + + ConditionVarDirect &operator = (const ConditionVarDirect ©) = delete; PUBLISHED: INLINE MutexDirect &get_mutex() const; diff --git a/panda/src/pipeline/conditionVarFull.I b/panda/src/pipeline/conditionVarFull.I index 21b93b5ec6..b796e7aed2 100644 --- a/panda/src/pipeline/conditionVarFull.I +++ b/panda/src/pipeline/conditionVarFull.I @@ -27,35 +27,6 @@ ConditionVarFull(Mutex &mutex) : { } -/** - * - */ -INLINE ConditionVarFull:: -~ConditionVarFull() { -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE ConditionVarFull:: -ConditionVarFull(const ConditionVarFull ©) : -#ifdef DEBUG_THREADS - ConditionVarFullDebug(copy.get_mutex()) -#else - ConditionVarFullDirect(copy.get_mutex()) -#endif // DEBUG_THREADS -{ - nassertv(false); -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE void ConditionVarFull:: -operator = (const ConditionVarFull ©) { - nassertv(false); -} - /** * Returns the mutex associated with this condition variable. */ diff --git a/panda/src/pipeline/conditionVarFull.h b/panda/src/pipeline/conditionVarFull.h index 5f8b7ea731..37a9af1e11 100644 --- a/panda/src/pipeline/conditionVarFull.h +++ b/panda/src/pipeline/conditionVarFull.h @@ -46,12 +46,11 @@ class EXPCL_PANDA_PIPELINE ConditionVarFull : public ConditionVarFullDirect { PUBLISHED: INLINE explicit ConditionVarFull(Mutex &mutex); - INLINE ~ConditionVarFull(); -private: - INLINE ConditionVarFull(const ConditionVarFull ©); - INLINE void operator = (const ConditionVarFull ©); + ConditionVarFull(const ConditionVarFull ©) = delete; + ~ConditionVarFull() = default; + + ConditionVarFull &operator = (const ConditionVarFull ©) = delete; -PUBLISHED: INLINE Mutex &get_mutex() const; }; diff --git a/panda/src/pipeline/conditionVarFullDebug.I b/panda/src/pipeline/conditionVarFullDebug.I index bbf60f603d..5a09f03a3d 100644 --- a/panda/src/pipeline/conditionVarFullDebug.I +++ b/panda/src/pipeline/conditionVarFullDebug.I @@ -11,25 +11,6 @@ * @date 2006-08-28 */ -/** - * Do not attempt to copy condition variables. - */ -INLINE ConditionVarFullDebug:: -ConditionVarFullDebug(const ConditionVarFullDebug ©) : - _mutex(copy._mutex), - _impl(*_mutex._global_lock) -{ - nassertv(false); -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE void ConditionVarFullDebug:: -operator = (const ConditionVarFullDebug ©) { - nassertv(false); -} - /** * Returns the mutex associated with this condition variable. */ diff --git a/panda/src/pipeline/conditionVarFullDebug.h b/panda/src/pipeline/conditionVarFullDebug.h index 02c5957f72..696a57e2cf 100644 --- a/panda/src/pipeline/conditionVarFullDebug.h +++ b/panda/src/pipeline/conditionVarFullDebug.h @@ -32,10 +32,10 @@ class EXPCL_PANDA_PIPELINE ConditionVarFullDebug { public: explicit ConditionVarFullDebug(MutexDebug &mutex); + ConditionVarFullDebug(const ConditionVarFullDebug ©) = delete; virtual ~ConditionVarFullDebug(); -private: - INLINE ConditionVarFullDebug(const ConditionVarFullDebug ©); - INLINE void operator = (const ConditionVarFullDebug ©); + + ConditionVarFullDebug &operator = (const ConditionVarFullDebug ©) = delete; PUBLISHED: INLINE MutexDebug &get_mutex() const; diff --git a/panda/src/pipeline/conditionVarFullDirect.I b/panda/src/pipeline/conditionVarFullDirect.I index fa0da2b3c6..207cb01538 100644 --- a/panda/src/pipeline/conditionVarFullDirect.I +++ b/panda/src/pipeline/conditionVarFullDirect.I @@ -24,32 +24,6 @@ ConditionVarFullDirect(MutexDirect &mutex) : { } -/** - * - */ -INLINE ConditionVarFullDirect:: -~ConditionVarFullDirect() { -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE ConditionVarFullDirect:: -ConditionVarFullDirect(const ConditionVarFullDirect ©) : - _mutex(copy._mutex), - _impl(_mutex._impl) -{ - nassertv(false); -} - -/** - * Do not attempt to copy condition variables. - */ -INLINE void ConditionVarFullDirect:: -operator = (const ConditionVarFullDirect ©) { - nassertv(false); -} - /** * Returns the mutex associated with this condition variable. */ diff --git a/panda/src/pipeline/conditionVarFullDirect.h b/panda/src/pipeline/conditionVarFullDirect.h index 45cd0ac3f4..e2db984ab9 100644 --- a/panda/src/pipeline/conditionVarFullDirect.h +++ b/panda/src/pipeline/conditionVarFullDirect.h @@ -32,10 +32,10 @@ class EXPCL_PANDA_PIPELINE ConditionVarFullDirect { public: INLINE explicit ConditionVarFullDirect(MutexDirect &mutex); - INLINE ~ConditionVarFullDirect(); -private: - INLINE ConditionVarFullDirect(const ConditionVarFullDirect ©); - INLINE void operator = (const ConditionVarFullDirect ©); + ConditionVarFullDirect(const ConditionVarFullDirect ©) = delete; + ~ConditionVarFullDirect() = default; + + ConditionVarFullDirect &operator = (const ConditionVarFullDirect ©) = delete; PUBLISHED: INLINE MutexDirect &get_mutex() const; diff --git a/panda/src/pipeline/cyclerHolder.I b/panda/src/pipeline/cyclerHolder.I index d9d2782373..f30ca75751 100644 --- a/panda/src/pipeline/cyclerHolder.I +++ b/panda/src/pipeline/cyclerHolder.I @@ -31,19 +31,3 @@ INLINE CyclerHolder:: _cycler->release(); #endif } - -/** - * Do not attempt to copy CyclerHolders. - */ -INLINE CyclerHolder:: -CyclerHolder(const CyclerHolder ©) { - nassertv(false); -} - -/** - * Do not attempt to copy CyclerHolders. - */ -INLINE void CyclerHolder:: -operator = (const CyclerHolder ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/cyclerHolder.h b/panda/src/pipeline/cyclerHolder.h index fa5b81a30f..f1888345be 100644 --- a/panda/src/pipeline/cyclerHolder.h +++ b/panda/src/pipeline/cyclerHolder.h @@ -25,10 +25,10 @@ class EXPCL_PANDA_PIPELINE CyclerHolder { public: INLINE CyclerHolder(PipelineCyclerBase &cycler); + CyclerHolder(const CyclerHolder ©) = delete; INLINE ~CyclerHolder(); -private: - INLINE CyclerHolder(const CyclerHolder ©); - INLINE void operator = (const CyclerHolder ©); + + CyclerHolder &operator = (const CyclerHolder ©) = delete; private: #ifdef DO_PIPELINING diff --git a/panda/src/pipeline/lightMutex.h b/panda/src/pipeline/lightMutex.h index 164db7195e..4e2d1fa67b 100644 --- a/panda/src/pipeline/lightMutex.h +++ b/panda/src/pipeline/lightMutex.h @@ -48,7 +48,7 @@ PUBLISHED: LightMutex(const LightMutex ©) = delete; ~LightMutex() = default; - void operator = (const LightMutex ©) = delete; + LightMutex &operator = (const LightMutex ©) = delete; }; #include "lightMutex.I" diff --git a/panda/src/pipeline/lightMutexHolder.I b/panda/src/pipeline/lightMutexHolder.I index 392a234b29..fb8a8951e4 100644 --- a/panda/src/pipeline/lightMutexHolder.I +++ b/panda/src/pipeline/lightMutexHolder.I @@ -50,19 +50,3 @@ INLINE LightMutexHolder:: _mutex->release(); #endif } - -/** - * Do not attempt to copy LightMutexHolders. - */ -INLINE LightMutexHolder:: -LightMutexHolder(const LightMutexHolder ©) { - nassertv(false); -} - -/** - * Do not attempt to copy LightMutexHolders. - */ -INLINE void LightMutexHolder:: -operator = (const LightMutexHolder ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/lightMutexHolder.h b/panda/src/pipeline/lightMutexHolder.h index 778ac69722..fde6a4ba9a 100644 --- a/panda/src/pipeline/lightMutexHolder.h +++ b/panda/src/pipeline/lightMutexHolder.h @@ -26,10 +26,10 @@ class EXPCL_PANDA_PIPELINE LightMutexHolder { public: INLINE LightMutexHolder(const LightMutex &mutex); INLINE LightMutexHolder(LightMutex *&mutex); + LightMutexHolder(const LightMutexHolder ©) = delete; INLINE ~LightMutexHolder(); -private: - INLINE LightMutexHolder(const LightMutexHolder ©); - INLINE void operator = (const LightMutexHolder ©); + + LightMutexHolder &operator = (const LightMutexHolder ©) = delete; private: #if defined(HAVE_THREADS) || defined(DEBUG_THREADS) diff --git a/panda/src/pipeline/lightReMutex.I b/panda/src/pipeline/lightReMutex.I index e1993f5dee..c0cb459c87 100644 --- a/panda/src/pipeline/lightReMutex.I +++ b/panda/src/pipeline/lightReMutex.I @@ -46,18 +46,3 @@ LightReMutex(const string &) #endif // DEBUG_THREADS { } - -/** - * - */ -INLINE LightReMutex:: -~LightReMutex() { -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE void LightReMutex:: -operator = (const LightReMutex ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/lightReMutex.h b/panda/src/pipeline/lightReMutex.h index 6959c4ab17..2fff13a1ee 100644 --- a/panda/src/pipeline/lightReMutex.h +++ b/panda/src/pipeline/lightReMutex.h @@ -36,10 +36,10 @@ public: INLINE explicit LightReMutex(const char *name); PUBLISHED: INLINE explicit LightReMutex(const string &name); - INLINE ~LightReMutex(); -private: - INLINE LightReMutex(const LightReMutex ©); - INLINE void operator = (const LightReMutex ©); + LightReMutex(const LightReMutex ©) = delete; + ~LightReMutex() = default; + + LightReMutex &operator = (const LightReMutex ©) = delete; }; #include "lightReMutex.I" diff --git a/panda/src/pipeline/lightReMutexHolder.I b/panda/src/pipeline/lightReMutexHolder.I index 96141251d7..4158d92c26 100644 --- a/panda/src/pipeline/lightReMutexHolder.I +++ b/panda/src/pipeline/lightReMutexHolder.I @@ -62,19 +62,3 @@ INLINE LightReMutexHolder:: _mutex->release(); #endif } - -/** - * Do not attempt to copy LightReMutexHolders. - */ -INLINE LightReMutexHolder:: -LightReMutexHolder(const LightReMutexHolder ©) { - nassertv(false); -} - -/** - * Do not attempt to copy LightReMutexHolders. - */ -INLINE void LightReMutexHolder:: -operator = (const LightReMutexHolder ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/lightReMutexHolder.h b/panda/src/pipeline/lightReMutexHolder.h index 462b22180b..019206fbac 100644 --- a/panda/src/pipeline/lightReMutexHolder.h +++ b/panda/src/pipeline/lightReMutexHolder.h @@ -27,10 +27,10 @@ public: INLINE LightReMutexHolder(const LightReMutex &mutex); INLINE LightReMutexHolder(const LightReMutex &mutex, Thread *current_thread); INLINE LightReMutexHolder(LightReMutex *&mutex); + LightReMutexHolder(const LightReMutexHolder ©) = delete; INLINE ~LightReMutexHolder(); -private: - INLINE LightReMutexHolder(const LightReMutexHolder ©); - INLINE void operator = (const LightReMutexHolder ©); + + LightReMutexHolder &operator = (const LightReMutexHolder ©) = delete; private: #if defined(HAVE_THREADS) || defined(DEBUG_THREADS) diff --git a/panda/src/pipeline/mutexHolder.I b/panda/src/pipeline/mutexHolder.I index 9b1b99d6b6..c2b6204e5a 100644 --- a/panda/src/pipeline/mutexHolder.I +++ b/panda/src/pipeline/mutexHolder.I @@ -64,19 +64,3 @@ INLINE MutexHolder:: _mutex->release(); #endif } - -/** - * Do not attempt to copy MutexHolders. - */ -INLINE MutexHolder:: -MutexHolder(const MutexHolder ©) { - nassertv(false); -} - -/** - * Do not attempt to copy MutexHolders. - */ -INLINE void MutexHolder:: -operator = (const MutexHolder ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/mutexHolder.h b/panda/src/pipeline/mutexHolder.h index 26f1af5d9d..ccd7b321a8 100644 --- a/panda/src/pipeline/mutexHolder.h +++ b/panda/src/pipeline/mutexHolder.h @@ -27,10 +27,10 @@ public: INLINE MutexHolder(const Mutex &mutex); INLINE MutexHolder(const Mutex &mutex, Thread *current_thread); INLINE MutexHolder(Mutex *&mutex); + MutexHolder(const MutexHolder ©) = delete; INLINE ~MutexHolder(); -private: - INLINE MutexHolder(const MutexHolder ©); - INLINE void operator = (const MutexHolder ©); + + MutexHolder &operator = (const MutexHolder ©) = delete; private: // If HAVE_THREADS is defined, the Mutex class implements an actual mutex diff --git a/panda/src/pipeline/pipelineCyclerTrivialImpl.I b/panda/src/pipeline/pipelineCyclerTrivialImpl.I index 5cc1eecf39..316cadae30 100644 --- a/panda/src/pipeline/pipelineCyclerTrivialImpl.I +++ b/panda/src/pipeline/pipelineCyclerTrivialImpl.I @@ -30,35 +30,6 @@ PipelineCyclerTrivialImpl(CycleData *initial_data, Pipeline *) { #endif // SIMPLE_STRUCT_POINTERS } -/** - * - */ -INLINE PipelineCyclerTrivialImpl:: -PipelineCyclerTrivialImpl(const PipelineCyclerTrivialImpl &) { - // The copy constructor for the PipelineCyclerTrivialImpl case doesn't work. - // Don't try to use it. The PipelineCycler template class is ifdeffed - // appropriately to call the normal constructor instead. - nassertv(false); -} - -/** - * - */ -INLINE void PipelineCyclerTrivialImpl:: -operator = (const PipelineCyclerTrivialImpl &) { - // The copy assignment operator for the PipelineCyclerTrivialImpl case - // doesn't work. Don't try to use it. The PipelineCycler template class is - // ifdeffed appropriately not to call this method. - nassertv(false); -} - -/** - * - */ -INLINE PipelineCyclerTrivialImpl:: -~PipelineCyclerTrivialImpl() { -} - /** * Grabs an overall lock on the cycler. Release it with a call to release(). * This lock should be held while walking the list of stages. diff --git a/panda/src/pipeline/pipelineCyclerTrivialImpl.h b/panda/src/pipeline/pipelineCyclerTrivialImpl.h index ea0593ba24..9bcc9f12c9 100644 --- a/panda/src/pipeline/pipelineCyclerTrivialImpl.h +++ b/panda/src/pipeline/pipelineCyclerTrivialImpl.h @@ -41,11 +41,10 @@ class Pipeline; struct EXPCL_PANDA_PIPELINE PipelineCyclerTrivialImpl { public: INLINE PipelineCyclerTrivialImpl(CycleData *initial_data, Pipeline *pipeline = NULL); -private: - INLINE PipelineCyclerTrivialImpl(const PipelineCyclerTrivialImpl ©); - INLINE void operator = (const PipelineCyclerTrivialImpl ©); -public: - INLINE ~PipelineCyclerTrivialImpl(); + PipelineCyclerTrivialImpl(const PipelineCyclerTrivialImpl ©) = delete; + ~PipelineCyclerTrivialImpl() = default; + + PipelineCyclerTrivialImpl &operator = (const PipelineCyclerTrivialImpl ©) = delete; INLINE void acquire(Thread *current_thread = NULL); INLINE void release(); diff --git a/panda/src/pipeline/psemaphore.I b/panda/src/pipeline/psemaphore.I index 1111e01857..0d1fe57bdf 100644 --- a/panda/src/pipeline/psemaphore.I +++ b/panda/src/pipeline/psemaphore.I @@ -23,31 +23,6 @@ Semaphore(int initial_count) : nassertv(_count >= 0); } -/** - * - */ -INLINE Semaphore:: -~Semaphore() { -} - -/** - * Do not attempt to copy semaphores. - */ -INLINE Semaphore:: -Semaphore(const Semaphore ©) : - _cvar(_lock) -{ - nassertv(false); -} - -/** - * Do not attempt to copy semaphores. - */ -INLINE void Semaphore:: -operator = (const Semaphore ©) { - nassertv(false); -} - /** * Decrements the internal count. If the count was already at zero, blocks * until the count is nonzero, then decrements it. diff --git a/panda/src/pipeline/psemaphore.h b/panda/src/pipeline/psemaphore.h index 6fd9162cc2..9c724a94c1 100644 --- a/panda/src/pipeline/psemaphore.h +++ b/panda/src/pipeline/psemaphore.h @@ -30,10 +30,10 @@ class EXPCL_PANDA_PIPELINE Semaphore { PUBLISHED: INLINE explicit Semaphore(int initial_count = 1); - INLINE ~Semaphore(); -private: - INLINE Semaphore(const Semaphore ©); - INLINE void operator = (const Semaphore ©); + Semaphore(const Semaphore ©) = delete; + ~Semaphore() = default; + + Semaphore &operator = (const Semaphore ©) = delete; PUBLISHED: BLOCKING INLINE void acquire(); diff --git a/panda/src/pipeline/reMutexHolder.I b/panda/src/pipeline/reMutexHolder.I index 25a0032b4e..00cd980e01 100644 --- a/panda/src/pipeline/reMutexHolder.I +++ b/panda/src/pipeline/reMutexHolder.I @@ -61,19 +61,3 @@ INLINE ReMutexHolder:: _mutex->release(); #endif } - -/** - * Do not attempt to copy ReMutexHolders. - */ -INLINE ReMutexHolder:: -ReMutexHolder(const ReMutexHolder ©) { - nassertv(false); -} - -/** - * Do not attempt to copy ReMutexHolders. - */ -INLINE void ReMutexHolder:: -operator = (const ReMutexHolder ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/reMutexHolder.h b/panda/src/pipeline/reMutexHolder.h index f0830803fb..3411f7e3f8 100644 --- a/panda/src/pipeline/reMutexHolder.h +++ b/panda/src/pipeline/reMutexHolder.h @@ -27,10 +27,10 @@ public: INLINE ReMutexHolder(const ReMutex &mutex); INLINE ReMutexHolder(const ReMutex &mutex, Thread *current_thread); INLINE ReMutexHolder(ReMutex *&mutex); + ReMutexHolder(const ReMutexHolder ©) = delete; INLINE ~ReMutexHolder(); -private: - INLINE ReMutexHolder(const ReMutexHolder ©); - INLINE void operator = (const ReMutexHolder ©); + + ReMutexHolder &operator = (const ReMutexHolder ©) = delete; private: #if defined(HAVE_THREADS) || defined(DEBUG_THREADS) diff --git a/panda/src/pipeline/thread.I b/panda/src/pipeline/thread.I index 10d7b6e44f..d108f025dd 100644 --- a/panda/src/pipeline/thread.I +++ b/panda/src/pipeline/thread.I @@ -11,22 +11,6 @@ * @date 2002-08-08 */ -/** - * Do not attempt to copy threads. - */ -INLINE Thread:: -Thread(const Thread ©) : _impl(this) { - nassertv(false); -} - -/** - * Do not attempt to copy threads. - */ -INLINE void Thread:: -operator = (const Thread ©) { - nassertv(false); -} - /** * Returns the sync name of the thread. This name collects threads into "sync * groups", which are expected to run synchronously. This is mainly used for diff --git a/panda/src/pipeline/thread.h b/panda/src/pipeline/thread.h index 730deb5872..6749883fb6 100644 --- a/panda/src/pipeline/thread.h +++ b/panda/src/pipeline/thread.h @@ -46,15 +46,14 @@ class AsyncTask; class EXPCL_PANDA_PIPELINE Thread : public TypedReferenceCount, public Namable { protected: Thread(const string &name, const string &sync_name); + Thread(const Thread ©) = delete; PUBLISHED: virtual ~Thread(); -private: - INLINE Thread(const Thread ©); - INLINE void operator = (const Thread ©); - protected: + Thread &operator = (const Thread ©) = delete; + virtual void thread_main()=0; PUBLISHED: diff --git a/panda/src/speedtree/stTree.cxx b/panda/src/speedtree/stTree.cxx index fb00fc1bea..7a09205d6e 100644 --- a/panda/src/speedtree/stTree.cxx +++ b/panda/src/speedtree/stTree.cxx @@ -61,15 +61,6 @@ STTree(const Filename &fullpath) : _is_valid = true; } - -/** - * An STTree copy constructor is not supported. - */ -STTree:: -STTree(const STTree ©) { - nassertv(false); -} - /** * */ diff --git a/panda/src/speedtree/stTree.h b/panda/src/speedtree/stTree.h index 55c4dacbb7..379223aa97 100644 --- a/panda/src/speedtree/stTree.h +++ b/panda/src/speedtree/stTree.h @@ -28,8 +28,7 @@ class SpeedTreeNode; class EXPCL_PANDASPEEDTREE STTree : public TypedReferenceCount, public Namable { PUBLISHED: STTree(const Filename &fullpath); -private: - STTree(const STTree ©); + STTree(const STTree ©) = delete; PUBLISHED: INLINE const Filename &get_fullpath() const; diff --git a/panda/src/text/dynamicTextGlyph.I b/panda/src/text/dynamicTextGlyph.I index e6406e0d0d..23e44ee8ce 100644 --- a/panda/src/text/dynamicTextGlyph.I +++ b/panda/src/text/dynamicTextGlyph.I @@ -39,25 +39,6 @@ DynamicTextGlyph(int character, PN_stdfloat advance) : { } -/** - * Copying DynamicTextGlyph objects is not allowed. - */ -INLINE DynamicTextGlyph:: -DynamicTextGlyph(const DynamicTextGlyph &) : - TextGlyph(0) -{ - nassertv(false); -} - -/** - * Copying DynamicTextGlyph objects is not allowed. - */ -INLINE void DynamicTextGlyph:: -operator = (const DynamicTextGlyph &) { - nassertv(false); -} - - /** * Returns the DynamicTextPage that this glyph is on. */ diff --git a/panda/src/text/dynamicTextGlyph.h b/panda/src/text/dynamicTextGlyph.h index a90308977c..73ec2835a8 100644 --- a/panda/src/text/dynamicTextGlyph.h +++ b/panda/src/text/dynamicTextGlyph.h @@ -34,9 +34,9 @@ public: int x, int y, int x_size, int y_size, int margin, PN_stdfloat advance); INLINE DynamicTextGlyph(int character, PN_stdfloat advance); -private: - INLINE DynamicTextGlyph(const DynamicTextGlyph ©); - INLINE void operator = (const DynamicTextGlyph ©); + DynamicTextGlyph(const DynamicTextGlyph ©) = delete; + + DynamicTextGlyph &operator = (const DynamicTextGlyph ©) = delete; PUBLISHED: virtual ~DynamicTextGlyph(); diff --git a/panda/src/vision/openCVTexture.cxx b/panda/src/vision/openCVTexture.cxx index 7d09636b0c..5990e77321 100644 --- a/panda/src/vision/openCVTexture.cxx +++ b/panda/src/vision/openCVTexture.cxx @@ -48,18 +48,6 @@ OpenCVTexture(const string &name) : { } -/** - * Use OpenCVTexture::make_copy() to make a duplicate copy of an existing - * OpenCVTexture. - */ -OpenCVTexture:: -OpenCVTexture(const OpenCVTexture ©) : - VideoTexture(copy), - _pages(copy._pages) -{ - nassertv(false); -} - /** * */ diff --git a/panda/src/vision/openCVTexture.h b/panda/src/vision/openCVTexture.h index 1ad8e11a7a..7226202a7f 100644 --- a/panda/src/vision/openCVTexture.h +++ b/panda/src/vision/openCVTexture.h @@ -29,9 +29,7 @@ struct CvCapture; class EXPCL_VISION OpenCVTexture : public VideoTexture { PUBLISHED: OpenCVTexture(const string &name = string()); -protected: - OpenCVTexture(const OpenCVTexture ©); -PUBLISHED: + OpenCVTexture(const OpenCVTexture ©) = delete; virtual ~OpenCVTexture(); bool from_camera(int camera_index = -1, int z = 0,