Skip to content

Commit

Permalink
STYLE: Default default-constructors of class templates in Core/Common
Browse files Browse the repository at this point in the history
Defaulted default-constructors that just set all data members to zero or null,
and those that only just call their base class.
  • Loading branch information
N-Dekker authored and dzenanz committed Jan 25, 2023
1 parent 2c5dec1 commit c2c67ac
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ITK_TEMPLATE_EXPORT Array : public vnl_vector<TValue>
public:
/** Default constructor. It is created with an empty array
* it has to be allocated later by assignment */
Array();
Array() = default;

/** Copy constructor. Uses VNL copy constructor with correct
* setting for memory management. */
Expand Down
6 changes: 0 additions & 6 deletions Modules/Core/Common/include/itkArray.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
namespace itk
{

template <typename TValue>
Array<TValue>::Array()
: vnl_vector<TValue>()
{}


template <typename TValue>
Array<TValue>::Array(const Self & rhs)
: vnl_vector<TValue>(rhs)
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ITK_TEMPLATE_EXPORT BoundingBox : public Object
DeepCopy() const;

protected:
BoundingBox();
BoundingBox() = default;
~BoundingBox() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
7 changes: 0 additions & 7 deletions Modules/Core/Common/include/itkBoundingBox.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ BoundingBox<TPointIdentifier, VPointDimension, TCoordRep, TPointsContainer>::Get
}
#endif

/** */
template <typename TPointIdentifier, unsigned int VPointDimension, typename TCoordRep, typename TPointsContainer>
BoundingBox<TPointIdentifier, VPointDimension, TCoordRep, TPointsContainer>::BoundingBox()
: m_PointsContainer(nullptr)
{
m_Bounds.Fill(NumericTraits<CoordRepType>::ZeroValue());
}

template <typename TPointIdentifier, unsigned int VPointDimension, typename TCoordRep, typename TPointsContainer>
bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ITK_TEMPLATE_EXPORT ConicShellInteriorExteriorSpatialFunction
itkBooleanMacro(Polarity);

protected:
ConicShellInteriorExteriorSpatialFunction();
ConicShellInteriorExteriorSpatialFunction() = default;
~ConicShellInteriorExteriorSpatialFunction() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@

namespace itk
{
template <unsigned int VDimension, typename TInput>
ConicShellInteriorExteriorSpatialFunction<VDimension, TInput>::ConicShellInteriorExteriorSpatialFunction()

{
m_Origin.Fill(0.0);
m_OriginGradient.Fill(0.0);
}

template <unsigned int VDimension, typename TInput>
void
ConicShellInteriorExteriorSpatialFunction<VDimension, TInput>::SetOriginGradient(GradientType grad)
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkFrustumSpatialFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ITK_TEMPLATE_EXPORT FrustumSpatialFunction : public InteriorExteriorSpatia
itkSetMacro(RotationPlane, FrustumRotationPlaneType);

protected:
FrustumSpatialFunction();
FrustumSpatialFunction() = default;
~FrustumSpatialFunction() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
6 changes: 0 additions & 6 deletions Modules/Core/Common/include/itkFrustumSpatialFunction.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@

namespace itk
{
template <unsigned int VDimension, typename TInput>
FrustumSpatialFunction<VDimension, TInput>::FrustumSpatialFunction()
{
m_Apex.Fill(0.0f);
}

template <unsigned int VDimension, typename TInput>
auto
FrustumSpatialFunction<VDimension, TInput>::Evaluate(const InputType & position) const -> OutputType
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkHeavisideStepFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ITK_TEMPLATE_EXPORT HeavisideStepFunction : public HeavisideStepFunctionBa
EvaluateDerivative(const InputType & input) const override;

protected:
HeavisideStepFunction();
HeavisideStepFunction() = default;
~HeavisideStepFunction() override = default;
};
} // namespace itk
Expand Down
4 changes: 0 additions & 4 deletions Modules/Core/Common/include/itkHeavisideStepFunction.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

namespace itk
{
template <typename TInput, typename TOutput>
HeavisideStepFunction<TInput, TOutput>::HeavisideStepFunction()
: Superclass()
{}

template <typename TInput, typename TOutput>
auto
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkImageDuplicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ITK_TEMPLATE_EXPORT ImageDuplicator : public Object
Update();

protected:
ImageDuplicator();
ImageDuplicator() = default;
~ImageDuplicator() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
8 changes: 0 additions & 8 deletions Modules/Core/Common/include/itkImageDuplicator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
namespace itk
{

template <typename TInputImage>
ImageDuplicator<TInputImage>::ImageDuplicator()
{
m_InputImage = nullptr;
m_DuplicateImage = nullptr;
m_InternalImageTime = 0;
}

template <typename TInputImage>
void
ImageDuplicator<TInputImage>::Update()
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkPriorityQueueContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ITK_TEMPLATE_EXPORT MaxPriorityQueueElementWrapper
using ElementIdentifierType = TElementIdentifier;

using Superclass = MinPriorityQueueElementWrapper<ElementType, ElementPriorityType, ElementIdentifierType>;
MaxPriorityQueueElementWrapper();
MaxPriorityQueueElementWrapper() = default;

MaxPriorityQueueElementWrapper(ElementType element, ElementPriorityType priority);

Expand Down
4 changes: 0 additions & 4 deletions Modules/Core/Common/include/itkPriorityQueueContainer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ MinPriorityQueueElementWrapper<TElement, TElementPriority, TElementIdentifier>::
// -----------------------------------------------------------------------------
// MaxPriorityQueueElementWrapper
// -----------------------------------------------------------------------------
template <typename TElement, typename TElementPriority, typename TElementIdentifier>
MaxPriorityQueueElementWrapper<TElement, TElementPriority, TElementIdentifier>::MaxPriorityQueueElementWrapper()
: Superclass()
{}
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ITK_TEMPLATE_EXPORT TorusInteriorExteriorSpatialFunction
itkSetMacro(MinorRadius, double);

protected:
TorusInteriorExteriorSpatialFunction();
TorusInteriorExteriorSpatialFunction() = default;
~TorusInteriorExteriorSpatialFunction() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@

namespace itk
{
template <unsigned int VDimension, typename TInput>
TorusInteriorExteriorSpatialFunction<VDimension, TInput>::TorusInteriorExteriorSpatialFunction()

{
m_Origin.Fill(0.0);
}

template <unsigned int VDimension, typename TInput>
auto
TorusInteriorExteriorSpatialFunction<VDimension, TInput>::Evaluate(const InputType & position) const -> OutputType
Expand Down

0 comments on commit c2c67ac

Please sign in to comment.