Skip to content

Commit ac1d0aa

Browse files
jhlegarretadzenanz
authored andcommitted
COMP: Use and move ITK_DISALLOW_COPY_AND_MOVE calls to public section
Use the `ITK_DISALLOW_COPY_AND_MOVE` macro in the `Watersheds` module to enhance consistency across the toolkit when disallowing the copy constructor and the assign operator. Move the `ITK_DISALLOW_COPY_AND_MOVE` calls to public section following the discussion in https://discourse.itk.org/t/noncopyable Following the changes: b0f183b 10429ae 7d177ca
1 parent ed0f6d3 commit ac1d0aa

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

Modules/Segmentation/Watersheds/include/itkWatershedBoundary.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ template <typename TScalar, unsigned int TDimension>
5454
class ITK_TEMPLATE_EXPORT Boundary : public DataObject
5555
{
5656
public:
57+
ITK_DISALLOW_COPY_AND_MOVE(Boundary);
58+
5759
/** The dimensionality of this boundary. For example, if the boundary
5860
* of a set of planes, it has dimensionality 2. If the boundary is
5961
* a set of lines, it has dimensionality 1. Dimensionality is one less
@@ -257,10 +259,7 @@ class ITK_TEMPLATE_EXPORT Boundary : public DataObject
257259
protected:
258260
Boundary();
259261
~Boundary() override = default;
260-
Boundary(const Self &) {}
261-
void
262-
operator=(const Self &)
263-
{}
262+
264263
void
265264
PrintSelf(std::ostream & os, Indent indent) const override;
266265

Modules/Segmentation/Watersheds/include/itkWatershedBoundaryResolver.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ template <typename TPixelType, unsigned int TDimension>
6565
class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
6666
{
6767
public:
68+
ITK_DISALLOW_COPY_AND_MOVE(BoundaryResolver);
69+
6870
/** Set up smart pointer and object factory definitions. */
6971
using Self = BoundaryResolver;
7072
using Superclass = ProcessObject;
@@ -146,10 +148,7 @@ class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
146148
}
147149

148150
~BoundaryResolver() override = default;
149-
BoundaryResolver(const Self &) {}
150-
void
151-
operator=(const Self &)
152-
{}
151+
153152
void
154153
PrintSelf(std::ostream & os, Indent indent) const override;
155154

Modules/Segmentation/Watersheds/include/itkWatershedEquivalenceRelabeler.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ template <typename TScalar, unsigned int TImageDimension>
5454
class ITK_TEMPLATE_EXPORT EquivalenceRelabeler : public ProcessObject
5555
{
5656
public:
57+
ITK_DISALLOW_COPY_AND_MOVE(EquivalenceRelabeler);
58+
5759
/** Expose templated image dimension parameter at run time */
5860
static constexpr unsigned int ImageDimension = TImageDimension;
5961

@@ -129,10 +131,7 @@ class ITK_TEMPLATE_EXPORT EquivalenceRelabeler : public ProcessObject
129131
}
130132

131133
~EquivalenceRelabeler() override = default;
132-
EquivalenceRelabeler(const Self &) {}
133-
void
134-
operator=(const Self &)
135-
{}
134+
136135
void
137136
PrintSelf(std::ostream & os, Indent indent) const override;
138137

Modules/Segmentation/Watersheds/include/itkWatershedSegmentTree.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ template <typename TScalar>
4848
class ITK_TEMPLATE_EXPORT SegmentTree : public DataObject
4949
{
5050
public:
51+
ITK_DISALLOW_COPY_AND_MOVE(SegmentTree);
52+
5153
/** Define itk Smart Pointers for this object */
5254
using Self = SegmentTree;
5355
using Superclass = DataObject;
@@ -212,10 +214,7 @@ class ITK_TEMPLATE_EXPORT SegmentTree : public DataObject
212214
protected:
213215
SegmentTree() = default;
214216
~SegmentTree() override = default;
215-
SegmentTree(const Self &) {}
216-
void
217-
operator=(const Self &)
218-
{}
217+
219218
void
220219
PrintSelf(std::ostream & os, Indent indent) const override;
221220

Modules/Segmentation/Watersheds/include/itkWatershedSegmentTreeGenerator.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ template <typename TScalar>
7878
class ITK_TEMPLATE_EXPORT SegmentTreeGenerator : public ProcessObject
7979
{
8080
public:
81+
ITK_DISALLOW_COPY_AND_MOVE(SegmentTreeGenerator);
82+
8183
/** Standard itk smart pointer declarations */
8284
using Self = SegmentTreeGenerator;
8385
using Superclass = ProcessObject;
@@ -200,10 +202,7 @@ class ITK_TEMPLATE_EXPORT SegmentTreeGenerator : public ProcessObject
200202
protected:
201203
SegmentTreeGenerator();
202204
~SegmentTreeGenerator() override = default;
203-
SegmentTreeGenerator(const Self &) {}
204-
void
205-
operator=(const Self &)
206-
{}
205+
207206
void
208207
PrintSelf(std::ostream & os, Indent indent) const override;
209208

0 commit comments

Comments
 (0)