Skip to content

Commit

Permalink
COMP: Use and move ITK_DISALLOW_COPY_AND_ASSIGN calls to public section.
Browse files Browse the repository at this point in the history
Use the `ITK_DISALLOW_COPY_AND_ASSIGN` macro to enhance consistency across
the the toolkit when disallowing the copy constructor and the assign
operator.

Move the `ITK_DISALLOW_COPY_AND_ASSIGN` calls to public section following
the discussion in
https://discourse.itk.org/t/itk-disallow-copy-and-assign/648
  • Loading branch information
jhlegarreta committed Mar 19, 2019
1 parent a827c83 commit fcf9e06
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions include/itkMetamorphosisImageRegistrationMethodv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class ConstantImageFilter:
public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(MetamorphosisImageRegistrationMethodv4);

/** Standard class type alias. */
using Self = ConstantImageFilter;
using Superclass = ImageToImageFilter< TInputImage, TOutputImage >;
Expand Down Expand Up @@ -84,8 +86,6 @@ public ImageToImageFilter<TInputImage, TOutputImage>
}

private:
ConstantImageFilter(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented

OutputPixelType m_Constant;
};
Expand All @@ -104,6 +104,8 @@ class MetamorphosisImageRegistrationMethodv4:
public TimeVaryingVelocityFieldImageRegistrationMethodv4<TFixedImage, TMovingImage, TimeVaryingVelocityFieldSemiLagrangianTransform<double, TFixedImage::ImageDimension> >
{
public:
DISALLOW_COPY_AND_ASSIGN(MetamorphosisImageRegistrationMethodv4);

/** Standard class type alias. */
using Self = MetamorphosisImageRegistrationMethodv4;
using Superclass = TimeVaryingVelocityFieldImageRegistrationMethodv4<TFixedImage, TMovingImage, TimeVaryingVelocityFieldSemiLagrangianTransform<double, TFixedImage::ImageDimension> >;
Expand Down Expand Up @@ -228,8 +230,6 @@ public TimeVaryingVelocityFieldImageRegistrationMethodv4<TFixedImage, TMovingIma
void PrintSelf(std::ostream& os, Indent indent) const override;

private:
MetamorphosisImageRegistrationMethodv4(const Self&); // Intentionally not implemened
void operator=(const Self&); //Intentionally not implemented

double m_Scale;
double m_RegistrationSmoothness;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef itkTimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter_h
#define itkTimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter_h

#include "itkMacro.h"
#include "itkExtrapolateImageFunction.h"
#include "itkWrapExtrapolateImageFunction.h"
#include "itkTimeVaryingVelocityFieldIntegrationImageFilter.h"
Expand All @@ -41,6 +42,8 @@ class TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter :
public TimeVaryingVelocityFieldIntegrationImageFilter<TTimeVaryingVelocityField, TDisplacementField>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter);

using Self = TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter;
using Superclass = TimeVaryingVelocityFieldIntegrationImageFilter
<TTimeVaryingVelocityField, TDisplacementField>;
Expand Down Expand Up @@ -111,8 +114,6 @@ class TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter :
DisplacementFieldExtrapolatorPointer m_DisplacementFieldExtrapolator;

private:
TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter( const Self & ) ITK_DELETE_FUNCTION;
void operator=( const Self & ) ITK_DELETE_FUNCTION;

VelocityFieldInterpolatorPointer m_VelocityFieldInterpolator;
VelocityFieldExtrapolatorPointer m_VelocityFieldExtrapolator;
Expand Down
5 changes: 3 additions & 2 deletions include/itkTimeVaryingVelocityFieldSemiLagrangianTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class TimeVaryingVelocityFieldSemiLagrangianTransform :
public TimeVaryingVelocityFieldTransform<TParametersValueType, NDimensions>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(TimeVaryingVelocityFieldSemiLagrangianTransform);

/** Standard class type alias. */
using Self = TimeVaryingVelocityFieldSemiLagrangianTransform;
using Superclass = TimeVaryingVelocityFieldTransform<TParametersValueType, NDimensions>;
Expand Down Expand Up @@ -87,8 +89,7 @@ class TimeVaryingVelocityFieldSemiLagrangianTransform :
virtual ~TimeVaryingVelocityFieldSemiLagrangianTransform(){};

private:
TimeVaryingVelocityFieldSemiLagrangianTransform( const Self& ) ITK_DELETE_FUNCTION;
void operator=( const Self& ) ITK_DELETE_FUNCTION;

bool m_UseInverse;
};

Expand Down
5 changes: 3 additions & 2 deletions include/itkWrapExtrapolateImageFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef itkWrapExtrapolateImageFunction_h
#define itkWrapExtrapolateImageFunction_h

#include "itkMacro.h"
#include "itkExtrapolateImageFunction.h"
#include "itkLinearInterpolateImageFunction.h"
namespace itk
Expand All @@ -40,6 +41,8 @@ class WrapExtrapolateImageFunction:
public ExtrapolateImageFunction< TInputImage, TCoordRep >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(WrapExtrapolateImageFunction);

/** Standard class type alias. */
using Self = WrapExtrapolateImageFunction;
using Superclass = ExtrapolateImageFunction< TInputImage, TCoordRep >;
Expand Down Expand Up @@ -163,8 +166,6 @@ class WrapExtrapolateImageFunction:
}

private:
WrapExtrapolateImageFunction(const Self &) ITK_DELETE_FUNCTION;
void operator=(const Self &) ITK_DELETE_FUNCTION;

InterpolatorPointerType m_Interpolator;
};
Expand Down

0 comments on commit fcf9e06

Please sign in to comment.