Skip to content

Commit b0f183b

Browse files
committed
COMP: Moved ITK_DISALLOW_COPY_AND_ASSIGN calls to public section
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
1 parent 9b46375 commit b0f183b

File tree

1,276 files changed

+2475
-3170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,276 files changed

+2475
-3170
lines changed

Examples/IO/XML/itkParticleSwarmOptimizerDOMReader.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace itk
3838
class ParticleSwarmOptimizerDOMReader : public DOMReader<ParticleSwarmOptimizer>
3939
{
4040
public:
41+
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMReader);
42+
4143
/** Standard class type aliases. */
4244
using Self = ParticleSwarmOptimizerDOMReader;
4345
using Superclass = DOMReader<ParticleSwarmOptimizer>;
@@ -58,9 +60,6 @@ class ParticleSwarmOptimizerDOMReader : public DOMReader<ParticleSwarmOptimizer>
5860
* It should fill the contents of the output object by pulling information from the intermediate DOM object.
5961
*/
6062
void GenerateData( const DOMNodeType* inputdom, const void* ) override;
61-
62-
private:
63-
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMReader);
6463
};
6564

6665
} // namespace itk

Examples/IO/XML/itkParticleSwarmOptimizerDOMWriter.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace itk
3838
class ParticleSwarmOptimizerDOMWriter : public DOMWriter<ParticleSwarmOptimizer>
3939
{
4040
public:
41+
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMWriter);
42+
4143
/** Standard class type aliases. */
4244
using Self = ParticleSwarmOptimizerDOMWriter;
4345
using Superclass = DOMWriter<ParticleSwarmOptimizer>;
@@ -58,9 +60,6 @@ class ParticleSwarmOptimizerDOMWriter : public DOMWriter<ParticleSwarmOptimizer>
5860
* It should fill the contents of the intermediate DOM object by pulling information from the input object.
5961
*/
6062
void GenerateData( DOMNodeType* outputdom, const void* ) const override;
61-
62-
private:
63-
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerDOMWriter);
6463
};
6564

6665
} // namespace itk

Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ namespace itk
3939
class ParticleSwarmOptimizerSAXReader : public XMLReader<ParticleSwarmOptimizer>
4040
{
4141
public:
42+
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXReader);
43+
4244
/** Standard class type aliases */
4345
using Self = ParticleSwarmOptimizerSAXReader;
4446
using Superclass = XMLReader<ParticleSwarmOptimizer>;
@@ -102,9 +104,6 @@ class ParticleSwarmOptimizerSAXReader : public XMLReader<ParticleSwarmOptimizer>
102104
std::vector<double> m_LowerBound;
103105
std::vector<double> m_UpperBound;
104106
Array<double> m_ParametersConvergenceTolerance;
105-
106-
private:
107-
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXReader);
108107
};
109108

110109
} // namespace itk

Examples/IO/XML/itkParticleSwarmOptimizerSAXWriter.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ namespace itk
3636
class ParticleSwarmOptimizerSAXWriter : public XMLWriterBase<ParticleSwarmOptimizer>
3737
{
3838
public:
39+
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXWriter);
40+
3941
/** Standard class type aliases. */
4042
using Self = ParticleSwarmOptimizerSAXWriter;
4143
using Superclass = XMLWriterBase<ParticleSwarmOptimizer>;
@@ -61,9 +63,6 @@ class ParticleSwarmOptimizerSAXWriter : public XMLWriterBase<ParticleSwarmOptimi
6163

6264
protected:
6365
ParticleSwarmOptimizerSAXWriter() {}
64-
65-
private:
66-
ITK_DISALLOW_COPY_AND_ASSIGN(ParticleSwarmOptimizerSAXWriter);
6766
};
6867

6968
} // namespace itk

Modules/Bridge/VTK/include/itkVTKImageExport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ template< typename TInputImage >
5454
class ITK_TEMPLATE_EXPORT VTKImageExport:public VTKImageExportBase
5555
{
5656
public:
57+
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageExport);
58+
5759
/** Standard class type aliases. */
5860
using Self = VTKImageExport;
5961
using Superclass = VTKImageExportBase;
@@ -111,8 +113,6 @@ class ITK_TEMPLATE_EXPORT VTKImageExport:public VTKImageExportBase
111113
void * BufferPointerCallback() override;
112114

113115
private:
114-
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageExport);
115-
116116
std::string m_ScalarTypeName;
117117
int m_WholeExtent[6];
118118
int m_DataExtent[6];

Modules/Bridge/VTK/include/itkVTKImageImport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ template< typename TOutputImage >
5656
class ITK_TEMPLATE_EXPORT VTKImageImport:public ImageSource< TOutputImage >
5757
{
5858
public:
59+
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageImport);
60+
5961
/** Standard class type aliases. */
6062
using Self = VTKImageImport;
6163
using Superclass = ImageSource< TOutputImage >;
@@ -166,8 +168,6 @@ class ITK_TEMPLATE_EXPORT VTKImageImport:public ImageSource< TOutputImage >
166168
void GenerateOutputInformation() override;
167169

168170
private:
169-
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageImport);
170-
171171
void * m_CallbackUserData;
172172
UpdateInformationCallbackType m_UpdateInformationCallback;
173173
PipelineModifiedCallbackType m_PipelineModifiedCallback;

Modules/Bridge/VtkGlue/include/itkImageToVTKImageFilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ template <typename TInputImage >
4646
class ITK_TEMPLATE_EXPORT ImageToVTKImageFilter : public ProcessObject
4747
{
4848
public:
49+
ITK_DISALLOW_COPY_AND_ASSIGN(ImageToVTKImageFilter);
50+
4951
/** Standard class type aliases. */
5052
using Self = ImageToVTKImageFilter;
5153
using Superclass = ProcessObject;
@@ -95,8 +97,6 @@ class ITK_TEMPLATE_EXPORT ImageToVTKImageFilter : public ProcessObject
9597
~ImageToVTKImageFilter() override;
9698

9799
private:
98-
ITK_DISALLOW_COPY_AND_ASSIGN(ImageToVTKImageFilter);
99-
100100
ExporterFilterPointer m_Exporter;
101101
vtkImageImport * m_Importer;
102102
};

Modules/Bridge/VtkGlue/include/itkVTKImageToImageFilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ template <typename TOutputImage >
4747
class ITK_TEMPLATE_EXPORT VTKImageToImageFilter : public VTKImageImport< TOutputImage >
4848
{
4949
public:
50+
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageToImageFilter);
51+
5052
/** Standard class type aliases. */
5153
using Self = VTKImageToImageFilter;
5254
using Superclass = VTKImageImport< TOutputImage >;
@@ -83,8 +85,6 @@ class ITK_TEMPLATE_EXPORT VTKImageToImageFilter : public VTKImageImport< TOutput
8385
~VTKImageToImageFilter() override;
8486

8587
private:
86-
ITK_DISALLOW_COPY_AND_ASSIGN(VTKImageToImageFilter);
87-
8888
using ImageExportPointer = vtkSmartPointer<vtkImageExport>;
8989
ImageExportPointer m_Exporter;
9090

Modules/Core/Common/include/itkAtanRegularizedHeavisideStepFunction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class ITK_TEMPLATE_EXPORT AtanRegularizedHeavisideStepFunction:
5454
public RegularizedHeavisideStepFunction< TInput, TOutput >
5555
{
5656
public:
57+
ITK_DISALLOW_COPY_AND_ASSIGN(AtanRegularizedHeavisideStepFunction);
58+
5759
using Self = AtanRegularizedHeavisideStepFunction;
5860
using Superclass = RegularizedHeavisideStepFunction< TInput, TOutput >;
5961
using Pointer = SmartPointer< Self >;
@@ -77,9 +79,6 @@ class ITK_TEMPLATE_EXPORT AtanRegularizedHeavisideStepFunction:
7779

7880
AtanRegularizedHeavisideStepFunction();
7981
~AtanRegularizedHeavisideStepFunction() override;
80-
81-
private:
82-
ITK_DISALLOW_COPY_AND_ASSIGN(AtanRegularizedHeavisideStepFunction);
8382
};
8483
}
8584

Modules/Core/Common/include/itkAutoPointerDataObjectDecorator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ template< typename T >
6161
class ITK_TEMPLATE_EXPORT AutoPointerDataObjectDecorator:public DataObject
6262
{
6363
public:
64+
ITK_DISALLOW_COPY_AND_ASSIGN(AutoPointerDataObjectDecorator);
65+
6466
/** Standard type alias */
6567
using Self = AutoPointerDataObjectDecorator;
6668
using Superclass = DataObject;
@@ -92,8 +94,6 @@ class ITK_TEMPLATE_EXPORT AutoPointerDataObjectDecorator:public DataObject
9294
protected:
9395

9496
private:
95-
ITK_DISALLOW_COPY_AND_ASSIGN(AutoPointerDataObjectDecorator);
96-
9797
ComponentPointer m_Component;
9898
};
9999
} // end namespace itk

Modules/Core/Common/include/itkBSplineDerivativeKernelFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ template< unsigned int VSplineOrder = 3, typename TRealValueType = double >
4343
class BSplineDerivativeKernelFunction:public KernelFunctionBase<TRealValueType>
4444
{
4545
public:
46+
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineDerivativeKernelFunction);
47+
4648
/** Standard class type aliases. */
4749
using Self = BSplineDerivativeKernelFunction;
4850
using Superclass = KernelFunctionBase<TRealValueType>;
@@ -75,8 +77,6 @@ class BSplineDerivativeKernelFunction:public KernelFunctionBase<TRealValueType>
7577
}
7678

7779
private:
78-
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineDerivativeKernelFunction);
79-
8080
/** Structures to control overloaded versions of Evaluate */
8181
struct DispatchBase {};
8282
template< unsigned int >

Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction:
5353
Array< double > >
5454
{
5555
public:
56+
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineInterpolationWeightFunction);
57+
5658
/** Standard class type aliases. */
5759
using Self = BSplineInterpolationWeightFunction;
5860
using Superclass = FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >,
@@ -110,8 +112,6 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction:
110112
void PrintSelf(std::ostream & os, Indent indent) const override;
111113

112114
private:
113-
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineInterpolationWeightFunction);
114-
115115
/** Number of weights. */
116116
unsigned int m_NumberOfWeights;
117117

Modules/Core/Common/include/itkBSplineKernelFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ template< unsigned int VSplineOrder = 3, typename TRealValueType = double >
4343
class ITK_TEMPLATE_EXPORT BSplineKernelFunction:public KernelFunctionBase<TRealValueType>
4444
{
4545
public:
46+
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineKernelFunction);
47+
4648
/** Standard class type aliases. */
4749
using Self = BSplineKernelFunction;
4850
using Superclass = KernelFunctionBase<TRealValueType>;
@@ -74,8 +76,6 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction:public KernelFunctionBase<TRealV
7476
}
7577

7678
private:
77-
ITK_DISALLOW_COPY_AND_ASSIGN(BSplineKernelFunction);
78-
7979
/** Structures to control overloaded versions of Evaluate */
8080
struct DispatchBase {};
8181
template< unsigned int >

Modules/Core/Common/include/itkBackwardDifferenceOperator.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class ITK_TEMPLATE_EXPORT BackwardDifferenceOperator:
4747
public NeighborhoodOperator< TPixel, TDimension, TAllocator >
4848
{
4949
public:
50+
ITK_DISALLOW_COPY_AND_ASSIGN(BackwardDifferenceOperator);
51+
5052
/** Standard class type aliases. */
5153
using Self = BackwardDifferenceOperator;
5254
using Superclass = NeighborhoodOperator< TPixel, TDimension, TAllocator >;
@@ -67,9 +69,6 @@ class ITK_TEMPLATE_EXPORT BackwardDifferenceOperator:
6769
/** Arranges coefficients spatially in the memory buffer. */
6870
void Fill(const CoefficientVector & coeff) override
6971
{ this->FillCenteredDirectional(coeff); }
70-
71-
private:
72-
ITK_DISALLOW_COPY_AND_ASSIGN(BackwardDifferenceOperator);
7372
};
7473
} // namespace itk
7574

Modules/Core/Common/include/itkBinaryThresholdSpatialFunction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class ITK_TEMPLATE_EXPORT BinaryThresholdSpatialFunction:
4545
typename TFunction::InputType >
4646
{
4747
public:
48+
ITK_DISALLOW_COPY_AND_ASSIGN(BinaryThresholdSpatialFunction);
49+
4850
/** Standard class type aliases. */
4951
using Self = BinaryThresholdSpatialFunction;
5052
using Superclass = SpatialFunction< bool,
@@ -97,9 +99,6 @@ class ITK_TEMPLATE_EXPORT BinaryThresholdSpatialFunction:
9799
FunctionOutputType m_UpperThreshold;
98100

99101
typename FunctionType::Pointer m_Function;
100-
101-
private:
102-
ITK_DISALLOW_COPY_AND_ASSIGN(BinaryThresholdSpatialFunction);
103102
};
104103
} // end namespace itk
105104

Modules/Core/Common/include/itkBoundingBox.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ template<
7777
class ITK_TEMPLATE_EXPORT BoundingBox:public Object
7878
{
7979
public:
80+
ITK_DISALLOW_COPY_AND_ASSIGN(BoundingBox);
81+
8082
/** Standard class type aliases. */
8183
using Self = BoundingBox;
8284
using Superclass = Object;
@@ -177,8 +179,6 @@ class ITK_TEMPLATE_EXPORT BoundingBox:public Object
177179
using ConstIterator = typename PointsContainer::ConstIterator;
178180

179181
private:
180-
ITK_DISALLOW_COPY_AND_ASSIGN(BoundingBox);
181-
182182
PointsContainerConstPointer m_PointsContainer;
183183
PointsContainerPointer m_CornersContainer;
184184
mutable BoundsArrayType m_Bounds;

Modules/Core/Common/include/itkByteSwapper.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ template< typename T >
5050
class ITK_TEMPLATE_EXPORT ByteSwapper:public Object
5151
{
5252
public:
53+
ITK_DISALLOW_COPY_AND_ASSIGN(ByteSwapper);
54+
5355
/** Standard class type aliases. */
5456
using Self = ByteSwapper;
5557
using Superclass = Object;
@@ -158,9 +160,6 @@ class ITK_TEMPLATE_EXPORT ByteSwapper:public Object
158160
/** Swap and write a range of 8-byte words. Num is the number of four-byte
159161
* words to swap and write. */
160162
static void SwapWrite8Range(void *p, BufferSizeType num, OStreamType *fp);
161-
162-
private:
163-
ITK_DISALLOW_COPY_AND_ASSIGN(ByteSwapper);
164163
};
165164
} // end namespace itk
166165

Modules/Core/Common/include/itkCellInterfaceVisitor.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ template<
5050
class ITK_TEMPLATE_EXPORT CellInterfaceVisitor:public LightObject
5151
{
5252
public:
53+
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitor);
54+
5355
/** Standard class type aliases. */
5456
using Self = CellInterfaceVisitor;
5557
using Superclass = LightObject;
@@ -70,9 +72,6 @@ class ITK_TEMPLATE_EXPORT CellInterfaceVisitor:public LightObject
7072
protected:
7173
CellInterfaceVisitor() {}
7274
~CellInterfaceVisitor() override {}
73-
74-
private:
75-
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitor);
7675
};
7776

7877
/** \class CellInterfaceVisitorImplementation
@@ -111,6 +110,8 @@ class CellInterfaceVisitorImplementation:
111110
public CellInterfaceVisitor< TPixelType, TCellTraits >, public UserVisitor
112111
{
113112
public:
113+
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitorImplementation);
114+
114115
/** Standard class type aliases. */
115116
using Self = CellInterfaceVisitorImplementation;
116117
using Pointer = SmartPointer< Self >;
@@ -137,9 +138,6 @@ class CellInterfaceVisitorImplementation:
137138
protected:
138139
CellInterfaceVisitorImplementation() {}
139140
~CellInterfaceVisitorImplementation() override {}
140-
141-
private:
142-
ITK_DISALLOW_COPY_AND_ASSIGN(CellInterfaceVisitorImplementation);
143141
};
144142
} // end namespace itk
145143

Modules/Core/Common/include/itkColorTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ template< typename TPixel >
4040
class ITK_TEMPLATE_EXPORT ColorTable:public Object
4141
{
4242
public:
43+
ITK_DISALLOW_COPY_AND_ASSIGN(ColorTable);
44+
4345
/** Standard class type aliases. */
4446
using Self = ColorTable;
4547
using Superclass = Object;
@@ -114,8 +116,6 @@ class ITK_TEMPLATE_EXPORT ColorTable:public Object
114116
using ColorNameVectorType = std::vector< std::string >;
115117
using ColorVectorType = std::vector< RGBPixel< TPixel > >;
116118

117-
ITK_DISALLOW_COPY_AND_ASSIGN(ColorTable);
118-
119119
void DeleteColors();
120120

121121
unsigned int m_NumberOfColors;

0 commit comments

Comments
 (0)