|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This update adds two classes called Section and Sections. These classes
replace the FastSection and Section structs that used to be in
codemarker.h, and they also replace the section building functions that
used to be in codemarker.cpp and cppcodemarker.cpp.
Basically, the two structs FastSection and Section are combined into the
single new class Section. FastSection was used to collect all the
members for a section in a map with the node names as the keys and the
nodes as the values. This allowed the names to be sorted as the map is
built. When completed, themap was used to build the Section, where the
map keys were copied to a list in the Section, and the map values were
copied to another list. The values in these lists were already sorted.
Then the Section structs were copied into a list of Sections and the
list was returned. The code was becoming too messy to maintain and
impossible to use for implementing custom sections for QTBUG-45725.
Now the new class Section combines the deleted structs FastSection and
Section. The procedure for building an instance of class Section is much
the same as the old procedure for building a struct FastSection and then
using the FastSection to build a struct Section. In the old procedure, 4
separate passes over all the child nodes of a class were required to
build the FastSections and Sections for the Summay lists, the Details
lists, the All Members list, and the Obsolete members lists. In the new
procedure, only a single pass is required. This single pass is the
purpose for the other new class Sections, which manages several static
instances of QVector<Section>. All the required Section objects are
built at the same time, and the never have to be copied. When the docs
for a class, namespace, etc have been written, each Section is cleared
but not deleted. The static instances of QVector<Section> are kept in
their constructed state.
I thought this would speed up qdoc some, because there is much less
allocating and deallocating of objects, but it seems to have actually
slowed down a bit, and I can't see why. But the code is a lot simpler
and reusable for the custom sections proposal, so I will continue with
it and hopefully find the cause of the slowdown.
Change-Id: I49f592c631ccc6182d1dae742985c7b2bb15c81b
Reviewed-by: Martin Smith <martin.smith@qt.io>
|
|
qdoc outputs a standard list of sections for C++ classes, namespaces,
header files, etc, and for QML types. The code for constructing the
lists of section data structures was include in the CodeMarker class
hierarchy, but it should not have been located there because it doesn't
have anything to do with documentation markup. The result was that the
CodeMarker classes (CodeMarker & CppCodeMarker) contained many member
functions that should have been isolated in separate classes.
This update creates those separate classes and refactors CodeMarker
and CppCodeMarker by removing the classes used for creating the lists
of sections into a separate Sections class. This refactoring not only
makes the code cleaner, it also enables implementation of the custom
sections idea described in QTBUG-45725.
There is a lot more work to be done for this task.
Change-Id: I950a78aa31c6b5f206854efa16363b992e9bfea5
Task-number: QTBUG-45725
Reviewed-by: Martin Smith <martin.smith@qt.io>
|