Skip to content

Commit

Permalink
COMP: Moved ITK_DISALLOW_COPY_AND_ASSIGN calls to public section
Browse files Browse the repository at this point in the history
Moved ITK_DISALLOW_COPY_AND_ASSIGN macro calls to public section of
class definitions.

Traditionally (C++03, ITK <= 4.13) a ITK_DISALLOW_COPY_AND_ASSIGN
call was placed either in the protected or private section of a class
definition. Now with ITKv5 the macro does C++11 '= delete', and it is
recommended to declare 'deleted' member functions public, in order to
get better compilation error messages. As Scott Meyers wrote in
Effective Modern C++ (2014), Item 11, page 75: "By convention,
deleted functions are declared public, not private..."

Change-Id: I314c2c26cafca7b9776d1e9f9c202523dce1386b
  • Loading branch information
N-Dekker committed Mar 25, 2018
1 parent 9b46375 commit b0f183b
Show file tree
Hide file tree
Showing 1,276 changed files with 2,475 additions and 3,170 deletions.
5 changes: 2 additions & 3 deletions Examples/IO/XML/itkParticleSwarmOptimizerDOMReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ namespace itk
class ParticleSwarmOptimizerDOMReader : public DOMReader<ParticleSwarmOptimizer>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMReader);

/** Standard class type aliases. */
using Self = ParticleSwarmOptimizerDOMReader;
using Superclass = DOMReader<ParticleSwarmOptimizer>;
Expand All @@ -58,9 +60,6 @@ class ParticleSwarmOptimizerDOMReader : public DOMReader<ParticleSwarmOptimizer>
* It should fill the contents of the output object by pulling information from the intermediate DOM object.
*/
void GenerateData( const DOMNodeType* inputdom, const void* ) override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMReader);
};

} // namespace itk
Expand Down
5 changes: 2 additions & 3 deletions Examples/IO/XML/itkParticleSwarmOptimizerDOMWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ namespace itk
class ParticleSwarmOptimizerDOMWriter : public DOMWriter<ParticleSwarmOptimizer>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMWriter);

/** Standard class type aliases. */
using Self = ParticleSwarmOptimizerDOMWriter;
using Superclass = DOMWriter<ParticleSwarmOptimizer>;
Expand All @@ -58,9 +60,6 @@ class ParticleSwarmOptimizerDOMWriter : public DOMWriter<ParticleSwarmOptimizer>
* It should fill the contents of the intermediate DOM object by pulling information from the input object.
*/
void GenerateData( DOMNodeType* outputdom, const void* ) const override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMWriter);
};

} // namespace itk
Expand Down
5 changes: 2 additions & 3 deletions Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace itk
class ParticleSwarmOptimizerSAXReader : public XMLReader<ParticleSwarmOptimizer>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXReader);

/** Standard class type aliases */
using Self = ParticleSwarmOptimizerSAXReader;
using Superclass = XMLReader<ParticleSwarmOptimizer>;
Expand Down Expand Up @@ -102,9 +104,6 @@ class ParticleSwarmOptimizerSAXReader : public XMLReader<ParticleSwarmOptimizer>
std::vector<double> m_LowerBound;
std::vector<double> m_UpperBound;
Array<double> m_ParametersConvergenceTolerance;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXReader);
};

} // namespace itk
Expand Down
5 changes: 2 additions & 3 deletions Examples/IO/XML/itkParticleSwarmOptimizerSAXWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace itk
class ParticleSwarmOptimizerSAXWriter : public XMLWriterBase<ParticleSwarmOptimizer>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXWriter);

/** Standard class type aliases. */
using Self = ParticleSwarmOptimizerSAXWriter;
using Superclass = XMLWriterBase<ParticleSwarmOptimizer>;
Expand All @@ -61,9 +63,6 @@ class ParticleSwarmOptimizerSAXWriter : public XMLWriterBase<ParticleSwarmOptimi

protected:
ParticleSwarmOptimizerSAXWriter() {}

private:
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXWriter);
};

} // namespace itk
Expand Down
4 changes: 2 additions & 2 deletions Modules/Bridge/VTK/include/itkVTKImageExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ template< typename TInputImage >
class ITK_TEMPLATE_EXPORT VTKImageExport:public VTKImageExportBase
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageExport);

/** Standard class type aliases. */
using Self = VTKImageExport;
using Superclass = VTKImageExportBase;
Expand Down Expand Up @@ -111,8 +113,6 @@ class ITK_TEMPLATE_EXPORT VTKImageExport:public VTKImageExportBase
void * BufferPointerCallback() override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageExport);

std::string m_ScalarTypeName;
int m_WholeExtent[6];
int m_DataExtent[6];
Expand Down
4 changes: 2 additions & 2 deletions Modules/Bridge/VTK/include/itkVTKImageImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ template< typename TOutputImage >
class ITK_TEMPLATE_EXPORT VTKImageImport:public ImageSource< TOutputImage >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageImport);

/** Standard class type aliases. */
using Self = VTKImageImport;
using Superclass = ImageSource< TOutputImage >;
Expand Down Expand Up @@ -166,8 +168,6 @@ class ITK_TEMPLATE_EXPORT VTKImageImport:public ImageSource< TOutputImage >
void GenerateOutputInformation() override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageImport);

void * m_CallbackUserData;
UpdateInformationCallbackType m_UpdateInformationCallback;
PipelineModifiedCallbackType m_PipelineModifiedCallback;
Expand Down
4 changes: 2 additions & 2 deletions Modules/Bridge/VtkGlue/include/itkImageToVTKImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ template <typename TInputImage >
class ITK_TEMPLATE_EXPORT ImageToVTKImageFilter : public ProcessObject
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ImageToVTKImageFilter);

/** Standard class type aliases. */
using Self = ImageToVTKImageFilter;
using Superclass = ProcessObject;
Expand Down Expand Up @@ -95,8 +97,6 @@ class ITK_TEMPLATE_EXPORT ImageToVTKImageFilter : public ProcessObject
~ImageToVTKImageFilter() override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(ImageToVTKImageFilter);

ExporterFilterPointer m_Exporter;
vtkImageImport * m_Importer;
};
Expand Down
4 changes: 2 additions & 2 deletions Modules/Bridge/VtkGlue/include/itkVTKImageToImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ template <typename TOutputImage >
class ITK_TEMPLATE_EXPORT VTKImageToImageFilter : public VTKImageImport< TOutputImage >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageToImageFilter);

/** Standard class type aliases. */
using Self = VTKImageToImageFilter;
using Superclass = VTKImageImport< TOutputImage >;
Expand Down Expand Up @@ -83,8 +85,6 @@ class ITK_TEMPLATE_EXPORT VTKImageToImageFilter : public VTKImageImport< TOutput
~VTKImageToImageFilter() override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageToImageFilter);

using ImageExportPointer = vtkSmartPointer<vtkImageExport>;
ImageExportPointer m_Exporter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class ITK_TEMPLATE_EXPORT AtanRegularizedHeavisideStepFunction:
public RegularizedHeavisideStepFunction< TInput, TOutput >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(AtanRegularizedHeavisideStepFunction);

using Self = AtanRegularizedHeavisideStepFunction;
using Superclass = RegularizedHeavisideStepFunction< TInput, TOutput >;
using Pointer = SmartPointer< Self >;
Expand All @@ -77,9 +79,6 @@ class ITK_TEMPLATE_EXPORT AtanRegularizedHeavisideStepFunction:

AtanRegularizedHeavisideStepFunction();
~AtanRegularizedHeavisideStepFunction() override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(AtanRegularizedHeavisideStepFunction);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ template< typename T >
class ITK_TEMPLATE_EXPORT AutoPointerDataObjectDecorator:public DataObject
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(AutoPointerDataObjectDecorator);

/** Standard type alias */
using Self = AutoPointerDataObjectDecorator;
using Superclass = DataObject;
Expand Down Expand Up @@ -92,8 +94,6 @@ class ITK_TEMPLATE_EXPORT AutoPointerDataObjectDecorator:public DataObject
protected:

private:
ITK_DISALLOW_COPY_AND_ASSIGN(AutoPointerDataObjectDecorator);

ComponentPointer m_Component;
};
} // end namespace itk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ template< unsigned int VSplineOrder = 3, typename TRealValueType = double >
class BSplineDerivativeKernelFunction:public KernelFunctionBase<TRealValueType>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineDerivativeKernelFunction);

/** Standard class type aliases. */
using Self = BSplineDerivativeKernelFunction;
using Superclass = KernelFunctionBase<TRealValueType>;
Expand Down Expand Up @@ -75,8 +77,6 @@ class BSplineDerivativeKernelFunction:public KernelFunctionBase<TRealValueType>
}

private:
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineDerivativeKernelFunction);

/** Structures to control overloaded versions of Evaluate */
struct DispatchBase {};
template< unsigned int >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction:
Array< double > >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineInterpolationWeightFunction);

/** Standard class type aliases. */
using Self = BSplineInterpolationWeightFunction;
using Superclass = FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >,
Expand Down Expand Up @@ -110,8 +112,6 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction:
void PrintSelf(std::ostream & os, Indent indent) const override;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineInterpolationWeightFunction);

/** Number of weights. */
unsigned int m_NumberOfWeights;

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkBSplineKernelFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ template< unsigned int VSplineOrder = 3, typename TRealValueType = double >
class ITK_TEMPLATE_EXPORT BSplineKernelFunction:public KernelFunctionBase<TRealValueType>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineKernelFunction);

/** Standard class type aliases. */
using Self = BSplineKernelFunction;
using Superclass = KernelFunctionBase<TRealValueType>;
Expand Down Expand Up @@ -74,8 +76,6 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction:public KernelFunctionBase<TRealV
}

private:
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineKernelFunction);

/** Structures to control overloaded versions of Evaluate */
struct DispatchBase {};
template< unsigned int >
Expand Down
5 changes: 2 additions & 3 deletions Modules/Core/Common/include/itkBackwardDifferenceOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class ITK_TEMPLATE_EXPORT BackwardDifferenceOperator:
public NeighborhoodOperator< TPixel, TDimension, TAllocator >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(BackwardDifferenceOperator);

/** Standard class type aliases. */
using Self = BackwardDifferenceOperator;
using Superclass = NeighborhoodOperator< TPixel, TDimension, TAllocator >;
Expand All @@ -67,9 +69,6 @@ class ITK_TEMPLATE_EXPORT BackwardDifferenceOperator:
/** Arranges coefficients spatially in the memory buffer. */
void Fill(const CoefficientVector & coeff) override
{ this->FillCenteredDirectional(coeff); }

private:
ITK_DISALLOW_COPY_AND_ASSIGN(BackwardDifferenceOperator);
};
} // namespace itk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class ITK_TEMPLATE_EXPORT BinaryThresholdSpatialFunction:
typename TFunction::InputType >
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(BinaryThresholdSpatialFunction);

/** Standard class type aliases. */
using Self = BinaryThresholdSpatialFunction;
using Superclass = SpatialFunction< bool,
Expand Down Expand Up @@ -97,9 +99,6 @@ class ITK_TEMPLATE_EXPORT BinaryThresholdSpatialFunction:
FunctionOutputType m_UpperThreshold;

typename FunctionType::Pointer m_Function;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(BinaryThresholdSpatialFunction);
};
} // end namespace itk

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ template<
class ITK_TEMPLATE_EXPORT BoundingBox:public Object
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(BoundingBox);

/** Standard class type aliases. */
using Self = BoundingBox;
using Superclass = Object;
Expand Down Expand Up @@ -177,8 +179,6 @@ class ITK_TEMPLATE_EXPORT BoundingBox:public Object
using ConstIterator = typename PointsContainer::ConstIterator;

private:
ITK_DISALLOW_COPY_AND_ASSIGN(BoundingBox);

PointsContainerConstPointer m_PointsContainer;
PointsContainerPointer m_CornersContainer;
mutable BoundsArrayType m_Bounds;
Expand Down
5 changes: 2 additions & 3 deletions Modules/Core/Common/include/itkByteSwapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ template< typename T >
class ITK_TEMPLATE_EXPORT ByteSwapper:public Object
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ByteSwapper);

/** Standard class type aliases. */
using Self = ByteSwapper;
using Superclass = Object;
Expand Down Expand Up @@ -158,9 +160,6 @@ class ITK_TEMPLATE_EXPORT ByteSwapper:public Object
/** Swap and write a range of 8-byte words. Num is the number of four-byte
* words to swap and write. */
static void SwapWrite8Range(void *p, BufferSizeType num, OStreamType *fp);

private:
ITK_DISALLOW_COPY_AND_ASSIGN(ByteSwapper);
};
} // end namespace itk

Expand Down
10 changes: 4 additions & 6 deletions Modules/Core/Common/include/itkCellInterfaceVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ template<
class ITK_TEMPLATE_EXPORT CellInterfaceVisitor:public LightObject
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitor);

/** Standard class type aliases. */
using Self = CellInterfaceVisitor;
using Superclass = LightObject;
Expand All @@ -70,9 +72,6 @@ class ITK_TEMPLATE_EXPORT CellInterfaceVisitor:public LightObject
protected:
CellInterfaceVisitor() {}
~CellInterfaceVisitor() override {}

private:
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitor);
};

/** \class CellInterfaceVisitorImplementation
Expand Down Expand Up @@ -111,6 +110,8 @@ class CellInterfaceVisitorImplementation:
public CellInterfaceVisitor< TPixelType, TCellTraits >, public UserVisitor
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitorImplementation);

/** Standard class type aliases. */
using Self = CellInterfaceVisitorImplementation;
using Pointer = SmartPointer< Self >;
Expand All @@ -137,9 +138,6 @@ class CellInterfaceVisitorImplementation:
protected:
CellInterfaceVisitorImplementation() {}
~CellInterfaceVisitorImplementation() override {}

private:
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitorImplementation);
};
} // end namespace itk

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkColorTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ template< typename TPixel >
class ITK_TEMPLATE_EXPORT ColorTable:public Object
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(ColorTable);

/** Standard class type aliases. */
using Self = ColorTable;
using Superclass = Object;
Expand Down Expand Up @@ -114,8 +116,6 @@ class ITK_TEMPLATE_EXPORT ColorTable:public Object
using ColorNameVectorType = std::vector< std::string >;
using ColorVectorType = std::vector< RGBPixel< TPixel > >;

ITK_DISALLOW_COPY_AND_ASSIGN(ColorTable);

void DeleteColors();

unsigned int m_NumberOfColors;
Expand Down
Loading

0 comments on commit b0f183b

Please sign in to comment.