Skip to content

Commit

Permalink
COMP: Use and move ITK_DISALLOW_COPY_AND_MOVE calls to public section
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jhlegarreta authored and dzenanz committed Dec 27, 2021
1 parent ed0f6d3 commit ac1d0aa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ template <typename TScalar, unsigned int TDimension>
class ITK_TEMPLATE_EXPORT Boundary : public DataObject
{
public:
ITK_DISALLOW_COPY_AND_MOVE(Boundary);

/** The dimensionality of this boundary. For example, if the boundary
* of a set of planes, it has dimensionality 2. If the boundary is
* a set of lines, it has dimensionality 1. Dimensionality is one less
Expand Down Expand Up @@ -257,10 +259,7 @@ class ITK_TEMPLATE_EXPORT Boundary : public DataObject
protected:
Boundary();
~Boundary() override = default;
Boundary(const Self &) {}
void
operator=(const Self &)
{}

void
PrintSelf(std::ostream & os, Indent indent) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ template <typename TPixelType, unsigned int TDimension>
class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
{
public:
ITK_DISALLOW_COPY_AND_MOVE(BoundaryResolver);

/** Set up smart pointer and object factory definitions. */
using Self = BoundaryResolver;
using Superclass = ProcessObject;
Expand Down Expand Up @@ -146,10 +148,7 @@ class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
}

~BoundaryResolver() override = default;
BoundaryResolver(const Self &) {}
void
operator=(const Self &)
{}

void
PrintSelf(std::ostream & os, Indent indent) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ template <typename TScalar, unsigned int TImageDimension>
class ITK_TEMPLATE_EXPORT EquivalenceRelabeler : public ProcessObject
{
public:
ITK_DISALLOW_COPY_AND_MOVE(EquivalenceRelabeler);

/** Expose templated image dimension parameter at run time */
static constexpr unsigned int ImageDimension = TImageDimension;

Expand Down Expand Up @@ -129,10 +131,7 @@ class ITK_TEMPLATE_EXPORT EquivalenceRelabeler : public ProcessObject
}

~EquivalenceRelabeler() override = default;
EquivalenceRelabeler(const Self &) {}
void
operator=(const Self &)
{}

void
PrintSelf(std::ostream & os, Indent indent) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ template <typename TScalar>
class ITK_TEMPLATE_EXPORT SegmentTree : public DataObject
{
public:
ITK_DISALLOW_COPY_AND_MOVE(SegmentTree);

/** Define itk Smart Pointers for this object */
using Self = SegmentTree;
using Superclass = DataObject;
Expand Down Expand Up @@ -212,10 +214,7 @@ class ITK_TEMPLATE_EXPORT SegmentTree : public DataObject
protected:
SegmentTree() = default;
~SegmentTree() override = default;
SegmentTree(const Self &) {}
void
operator=(const Self &)
{}

void
PrintSelf(std::ostream & os, Indent indent) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ template <typename TScalar>
class ITK_TEMPLATE_EXPORT SegmentTreeGenerator : public ProcessObject
{
public:
ITK_DISALLOW_COPY_AND_MOVE(SegmentTreeGenerator);

/** Standard itk smart pointer declarations */
using Self = SegmentTreeGenerator;
using Superclass = ProcessObject;
Expand Down Expand Up @@ -200,10 +202,7 @@ class ITK_TEMPLATE_EXPORT SegmentTreeGenerator : public ProcessObject
protected:
SegmentTreeGenerator();
~SegmentTreeGenerator() override = default;
SegmentTreeGenerator(const Self &) {}
void
operator=(const Self &)
{}

void
PrintSelf(std::ostream & os, Indent indent) const override;

Expand Down

0 comments on commit ac1d0aa

Please sign in to comment.