1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027067: Avoid use of virtual methods for implementation of destructors in legacy classes

Redundant methods Delete() and Desroy(), created in CDL as a hack to define destructor for the class, are removed; their definitions are converted to definition of destructors. In a couple of places methods Destroy() are preserved (bug made non-virtual) because they are called explicitly.
This commit is contained in:
abv
2016-01-03 07:11:46 +03:00
parent 18f7c9a5c2
commit e6f550da99
116 changed files with 150 additions and 467 deletions

View File

@@ -82,8 +82,7 @@ public:
//! Is used to redifine the operator <<.
Standard_EXPORT void Dump (Standard_OStream& o) const;
//! Destructor alias.
void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_BissecNewton();

View File

@@ -14,10 +14,6 @@
#include <StdFail_NotDone.hxx>
inline void math_BissecNewton::Delete() const
{
}
inline Standard_Boolean math_BissecNewton::IsSolutionReached(math_FunctionWithDerivative&)
{
return Abs(dx) <= XTol;

View File

@@ -51,8 +51,7 @@ public:
//! It has to be used if F(Bx) is known.
Standard_EXPORT math_BrentMinimum(const Standard_Real TolX, const Standard_Real Fbx, const Standard_Integer NbIterations = 100, const Standard_Real ZEPS = 1.0e-12);
//! Destructor alias.
void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_BrentMinimum();

View File

@@ -14,11 +14,6 @@
#include <StdFail_NotDone.hxx>
inline void math_BrentMinimum::Delete() const
{
}
inline Standard_Boolean math_BrentMinimum::IsSolutionReached(math_Function&)
{
const Standard_Real TwoTol = 2.0 * (XTol * fabs(x) + EPSZ);

View File

@@ -48,8 +48,7 @@ public:
//! Warning: constructor does not perform computations.
Standard_EXPORT math_FRPR(const math_MultipleVarFunctionWithGradient& theFunction, const Standard_Real theTolerance, const Standard_Integer theNbIterations = 200, const Standard_Real theZEPS = 1.0e-12);
//! Destructor alias.
Standard_EXPORT void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_FRPR();

View File

@@ -15,10 +15,6 @@
#include <StdFail_NotDone.hxx>
#include <math_Vector.hxx>
inline void math_FRPR::Delete() const
{
}
inline Standard_Boolean math_FRPR::IsSolutionReached(math_MultipleVarFunctionWithGradient&)
{
return 2.0 * fabs(TheMinimum - PreviousMinimum) <=

View File

@@ -666,7 +666,6 @@ math_FunctionSetRoot::math_FunctionSetRoot(math_FunctionSetWithDerivatives& theF
//=======================================================================
math_FunctionSetRoot::~math_FunctionSetRoot()
{
Delete();
}
//=======================================================================

View File

@@ -61,8 +61,7 @@ public:
//! constructor.
Standard_EXPORT math_FunctionSetRoot(math_FunctionSetWithDerivatives& F, const Standard_Integer NbIterations = 100);
//! Destructor alias.
Standard_EXPORT void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_FunctionSetRoot();
//! Initializes the tolerance values.

View File

@@ -15,11 +15,6 @@
#include <StdFail_NotDone.hxx>
#include <Standard_DimensionError.hxx>
inline void math_FunctionSetRoot::Delete() const
{
}
inline Standard_Boolean math_FunctionSetRoot::IsSolutionReached(math_FunctionSetWithDerivatives&)
{
for (Standard_Integer i = 1; i <= Sol.Length(); ++i)

View File

@@ -60,8 +60,7 @@ public:
//! The method SetTolerance must be called before performing the algorithm.
Standard_EXPORT math_NewtonFunctionSetRoot(math_FunctionSetWithDerivatives& theFunction, const Standard_Real theFTolerance, const Standard_Integer theNbIterations = 100);
//! Destructor alias.
Standard_EXPORT void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_NewtonFunctionSetRoot();
//! Initializes the tolerance values for the unknowns.

View File

@@ -14,10 +14,6 @@
#include <StdFail_NotDone.hxx>
inline void math_NewtonFunctionSetRoot::Delete() const
{
}
inline Standard_Boolean math_NewtonFunctionSetRoot::IsSolutionReached(math_FunctionSetWithDerivatives&)
{
for (Standard_Integer i = DeltaX.Lower(); i <= DeltaX.Upper(); ++i)

View File

@@ -52,8 +52,7 @@ public:
//! Search the solution.
Standard_EXPORT void Perform (math_MultipleVarFunctionWithHessian& theFunction, const math_Vector& theStartingPoint);
//! Destructor alias.
void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_NewtonMinimum();

View File

@@ -16,10 +16,6 @@
#include <StdFail_NotDone.hxx>
inline void math_NewtonMinimum::Delete() const
{
}
inline Standard_Boolean math_NewtonMinimum::IsConverged() const
{
return ( (TheStep.Norm() <= XTol ) ||

View File

@@ -47,8 +47,7 @@ public:
//! Constructor. Initialize new entity.
Standard_EXPORT math_Powell(const math_MultipleVarFunction& theFunction, const Standard_Real theTolerance, const Standard_Integer theNbIterations = 200, const Standard_Real theZEPS = 1.0e-12);
//! Destructor alias
void Delete() const;
//! Destructor
Standard_EXPORT virtual ~math_Powell();

View File

@@ -15,10 +15,6 @@
#include <StdFail_NotDone.hxx>
#include <math_Vector.hxx>
inline void math_Powell::Delete() const
{
}
inline Standard_Boolean math_Powell::IsSolutionReached(math_MultipleVarFunction&)
{
return 2.0 * fabs(PreviousMinimum - TheMinimum) <=