Archived issue #0010033
WOK: Avoid defining new() and delete() for classes derived from other
Description
Currently when WOK generates header file for a CDL class, it includes there
definitions for operators new() and delete().
This is not needed in most cases and even more -- it is bad when class is
derived from another for several reasons:
- These operators are inherited from the base class
- Redefinition of these operators in derived class is dangerous, since when the
object is deleted using pointer to a base class, the method delete() of the base
class will be called instead of the same method of derived class. (See attached
CPP file for example.)
- The documentation generated by Doxygen is polluted by these ridiculous methods
- This increases size of header files and number of definitions to be processed
by compiler
Thus the proposal is to avoid generating these methods in classes that inherit
from others (note that they are actually useful in very basic classes such as
Standard_Transient)
definitions for operators new() and delete().
This is not needed in most cases and even more -- it is bad when class is
derived from another for several reasons:
- These operators are inherited from the base class
- Redefinition of these operators in derived class is dangerous, since when the
object is deleted using pointer to a base class, the method delete() of the base
class will be called instead of the same method of derived class. (See attached
CPP file for example.)
- The documentation generated by Doxygen is polluted by these ridiculous methods
- This increases size of header files and number of definitions to be processed
by compiler
Thus the proposal is to avoid generating these methods in classes that inherit
from others (note that they are actually useful in very basic classes such as
Standard_Transient)
Additional information
Documentation remark, added by Author 2006-10-05 10:48:37:
New features:
Improvements:
Automatic generation of methods new() and delete() in the classes that inherit
from others is now avoided.
Changes:
Modified entities:
New features:
Improvements:
Automatic generation of methods new() and delete() in the classes that inherit
from others is now avoided.
Changes:
Modified entities:
Public activity
No public notes
Participants are labeled by their role within this record.
Related records