Archived issue #0024487

Getting rid of generic CDL classes

Open CASCADEOCCT:Codingclosed5 public notes

Search issues

Description

In context of planned elimination of WOK and CDL it is necessary to get rid of generic CDL classes in OCCT or at least to minimize their number as possible.

The problem is that generic classes are defined through CDL and instantiated to C++ via macro substitution. Each instantiation is represented by two automatically generated files (hxx and cxx) which define this substitution and #include original code. This will be difficult to track and maintain without WOK.

Other major problem with generic classes is that they are practically not usable in debugging: debugger does not recognize relation between source code and symbols in object code.

The steps to be done are:

1. Build a list of existing generic classes and check where each is used

2. Classes which are not used (and other unused stuff found in the process) to be removed

3. Generic classes used in single place should be converted to plan C++ classes

4. Instantiations of TCollection classes should be replaced by NCollection equivalents

5. Remaining classes should be converted to C++ templates or kept as-is (in any case GXX files should be removed from inc folder)

Public activity

5 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Changes are ready for review in CR24487 branch.
02Commenter 2
I have redefined this issue as general for dealing with generic classes; particular fixes are to be done within separate issues, children of this one
03Commenter 3
I have attached file Attachment 1 (TXT), which is result of executing the following command on the current master:

> cd inc; ls -1 *.gxx | gawk '{print($1); system("grep " $1 " ../src/*/* ../drv/*/* ../inc/* /dev/null")}' >../gxx

The log thus shows where each of GXX files found in inc folder is used.

The files which are not used anywhere (e.g. AppBlend_Line.gxx) and relevant classes can be removed immediately, I suppose (to be checked: perhaps they are still used indirectly somehow? e.g. pure abstract classes...)

The files used once (such as AppParCurves_Variational.gxx) highlight generic classes which are first candidates for conversion to plain C++ classes.

The files referred from src and/or inc folder (such as GCPnts_AbscissaPoint.gxx) most likely do not correspond to real CDL generic classes but just a way to abuse WOK. They should be analyzed on case-by-case basis.
04Commenter 4
Considered as fixed with OCCT 7.0 since there are no CDL there. Remains of generic classes will be removed later in the frames of separate issues.
05Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records