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:
@@ -19,6 +19,10 @@
|
||||
|
||||
static StepData_Field nulfild;
|
||||
|
||||
StepData_FieldList::~StepData_FieldList()
|
||||
{
|
||||
}
|
||||
|
||||
StepData_FieldList::StepData_FieldList () { }
|
||||
|
||||
Standard_Integer StepData_FieldList::NbFields () const
|
||||
|
@@ -36,6 +36,8 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Destructor is virtual
|
||||
Standard_EXPORT virtual ~StepData_FieldList();
|
||||
|
||||
//! Creates a FieldList of 0 Field
|
||||
Standard_EXPORT StepData_FieldList();
|
||||
@@ -52,28 +54,6 @@ public:
|
||||
|
||||
//! Fills an iterator with the entities shared by <me>
|
||||
Standard_EXPORT void FillShared (Interface_EntityIterator& iter) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _StepData_FieldList_HeaderFile
|
||||
|
@@ -32,6 +32,3 @@ StepData_Field& StepData_FieldList1::CField (const Standard_Integer num)
|
||||
if (num != 1) Standard_OutOfRange::Raise("StepData_FieldList1 : CField");
|
||||
return thefield;
|
||||
}
|
||||
|
||||
void StepData_FieldList1::Destroy () {}
|
||||
|
||||
|
@@ -49,18 +49,6 @@ public:
|
||||
//! modify its content
|
||||
Standard_EXPORT virtual StepData_Field& CField (const Standard_Integer num) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
Standard_EXPORT virtual ~StepData_FieldList1() { Destroy(); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
@@ -39,6 +39,3 @@ StepData_Field& StepData_FieldListD::CField (const Standard_Integer num)
|
||||
if (thefields.IsNull()) Standard_OutOfRange::Raise("StepData_FieldListD::Field");
|
||||
return thefields->ChangeValue(num);
|
||||
}
|
||||
|
||||
void StepData_FieldListD::Destroy () {}
|
||||
|
||||
|
@@ -53,18 +53,6 @@ public:
|
||||
//! Returns the field n0 <num> between 1 and NbFields, in order to
|
||||
//! modify its content
|
||||
Standard_EXPORT virtual StepData_Field& CField (const Standard_Integer num) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
Standard_EXPORT virtual ~StepData_FieldListD() { Destroy(); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -31,6 +31,3 @@ StepData_Field& StepData_FieldListN::CField (const Standard_Integer num)
|
||||
{
|
||||
return thefields.ChangeValue(num);
|
||||
}
|
||||
|
||||
void StepData_FieldListN::Destroy() {}
|
||||
|
||||
|
@@ -50,18 +50,6 @@ public:
|
||||
//! Returns the field n0 <num> between 1 and NbFields, in order to
|
||||
//! modify its content
|
||||
Standard_EXPORT virtual StepData_Field& CField (const Standard_Integer num) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
Standard_EXPORT virtual ~StepData_FieldListN() { Destroy(); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -188,4 +188,5 @@ Standard_Real StepData_SelectType::Real () const
|
||||
thevalue = sm;
|
||||
}
|
||||
|
||||
void StepData_SelectType::Destroy(){}
|
||||
StepData_SelectType::~StepData_SelectType()
|
||||
{}
|
||||
|
@@ -157,17 +157,7 @@ public:
|
||||
|
||||
Standard_EXPORT void SetReal (const Standard_Real val, const Standard_CString name = "");
|
||||
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
Standard_EXPORT virtual ~StepData_SelectType() { Destroy(); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT virtual ~StepData_SelectType();
|
||||
|
||||
private:
|
||||
|
||||
|
Reference in New Issue
Block a user