Bug 371274 - Code generator does not generate typedefs
Summary: Code generator does not generate typedefs
Status: ASSIGNED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.20.1 (KDE Applications 16.08.1)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on: 371400
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-20 10:43 UTC by Ralf Habacker
Modified: 2016-10-21 10:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
typedef-import.h (import testcase) (453 bytes, text/x-chdr)
2016-10-20 10:44 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2016-10-20 10:43:26 UTC
Umbrello does not generating code if a class or namespace contains a typedef.


Reproducible: Always

Steps to Reproduce:
1. start umbrello
2. import the appended test case
3. generate code for all classes

Actual Results:  
The datatypes created in the namespace or class are not generated

Expected Results:  
The datatypes should be created
Comment 1 Ralf Habacker 2016-10-20 10:44:04 UTC
Created attachment 101656 [details]
typedef-import.h (import testcase)
Comment 2 Ralf Habacker 2016-10-21 07:59:32 UTC
Git commit 828f7dac7316cf8b0b13e290b51fcd114b3e06d1 by Ralf Habacker.
Committed on 21/10/2016 at 07:57.
Pushed by habacker into branch 'master'.

Introduce class UMLDatatype.

M  +1    -0    umbrello/CMakeLists.txt
M  +2    -2    umbrello/codegenerators/ada/adawriter.cpp
M  +4    -4    umbrello/codegenerators/codegenerator.cpp
M  +1    -1    umbrello/codegenerators/cpp/cppheadercodedocument.cpp
M  +1    -1    umbrello/codegenerators/d/dclassifiercodedocument.cpp
M  +1    -1    umbrello/codegenerators/d/dwriter.cpp
M  +1    -1    umbrello/codegenerators/idl/idlwriter.cpp
M  +1    -1    umbrello/codegenerators/java/javaclassifiercodedocument.cpp
M  +1    -1    umbrello/codegenerators/java/javawriter.cpp
M  +1    -1    umbrello/codegenerators/pascal/pascalwriter.cpp
M  +1    -1    umbrello/codegenerators/perl/perlwriter.cpp
M  +4    -3    umbrello/codeimport/import_utils.cpp
M  +2    -1    umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
M  +10   -7    umbrello/dialogs/pages/classgeneralpage.cpp
M  +3    -4    umbrello/object_factory.cpp
M  +1    -1    umbrello/umldoc.cpp
M  +2    -58   umbrello/umlmodel/classifier.cpp
M  +0    -10   umbrello/umlmodel/classifier.h
A  +101  -0    umbrello/umlmodel/datatype.cpp     [License: GPL (v2+)]
A  +45   -0    umbrello/umlmodel/datatype.h     [License: GPL (v2+)]
M  +2    -0    umbrello/umlmodel/umlobject.cpp
M  +3    -0    umbrello/umlmodel/umlobject.h
M  +7    -6    umbrello/umlscene.cpp

http://commits.kde.org/umbrello/828f7dac7316cf8b0b13e290b51fcd114b3e06d1
Comment 3 Ralf Habacker 2016-10-21 07:59:33 UTC
Git commit d4f45447822d251e6ff780da47f158c05e74474a by Ralf Habacker.
Committed on 21/10/2016 at 07:59.
Pushed by habacker into branch 'master'.

Write out typedefs located in classes for default code generator.

M  +24   -0    umbrello/codegenerators/cpp/cppwriter.cpp
M  +1    -0    umbrello/codegenerators/cpp/cppwriter.h

http://commits.kde.org/umbrello/d4f45447822d251e6ff780da47f158c05e74474a
Comment 4 Ralf Habacker 2016-10-21 10:17:00 UTC
With the last commits writing out typedefs located in classes are implemented. 

Writing out data types defined in a namespace needs a little more work.  Umbrello writes out classes into files named according to the exported class. As typedefs in namespaces may be used in more than one class from the related namespace or from classes outside the namespace umbrello requires some hints where to place those typedefs. There are a few variants possible:
1. Generate an extra header file in the namespace containing all related typedefs and include it in all header files generated for this namespace. 
2. Extend umbrello to be able to assign UML objects to filenames which is then used by the code generator to place the typedefs in the related header.  Code import can also use this feature to generate UML object to filename tracking which is required for round trip engineering.