[Uml-devel] code generation changes

Oliver.Kellogg at t-online.de Oliver.Kellogg at t-online.de
Mon Jul 18 14:47:00 UTC 2005


On Monday 18 July 2005 07:01, Paulo Sehn wrote:
> I'm posting some changes I've done in umbrello to increase the
> coverage of cpp code generation, this changes are not to be sent to
> subversion yet, I've just wold like to receive comments about this.
>
> Changes:
> ======
> 1) assign void to operations that don't have return type and aren't
> constructors/destructors

As long as you're only doing this within cppsourcecodeoperation.cpp and
friends then that's fine.
BTW,  to identify a destructor in several places you write something like
   ... methodName.find(i18n("~")) ...
That i18n() is superfluous - the tilde is part of the C++ syntax and as such
should not be localized?
Also some documentation of the arguments of applyStereotypes() in
cppheadercodeoperation.h wouldn't hurt.

> 2) removal of the generate makefile entry in the cpp code generation
> wizard - code generation options dialog - language options tab. It was
> not working.

IMHO that's fine - If nobody objects then I'll commit it.

> 3) changes in the xmi file generation in order to remove the entries
> for native data types. Just to see what I'm talking about: open
> umbrello, set the language to cpp, save the empty file, open the xmi
> file and search for fileName. You'll see things like int, float, and
> so. I don't think we should have ,h/.cpp entries for native types. So,
> I've removed this and the makefile entry too.

I believe it could be okay as long as you're only doing this inside the
<codegeneration> part of <XMI.extension>, but I haven't tested it yet.
(I.e. I haven't yet changed the "#if 0" in ClassifierCodeDocument::
saveToXMI() into "#if 1")

> 4) I've changed the the cpp code generation wizard - code generation
> options dialog to manage the options generate accessors, accessors are
> inline and operations are inline.

Okay.

> 5) I've changed the umloperationdialog changing the stereotype editbox
> for a stereotype combobox, this combo is filled with stereotypes
> generated by the codegenerator (i.e. cppcodegenerator) plus the
> stereotypes the user had defined.

Haven't tried it yet.

> 6) I've defined the friend, virtual and constructor stereotypes to the
> cpp language

Neat.

> 7) I've changed the cppcodegenerator to handle these stereotypes, now
> we can create friend operations, we can identify constructors, and we
> can generate virtual operations that aren't abstract.

Wonderful.

> 8) I've changed the cpp code import classes to identify constructors
> and friend operations.

Ditto.

> I would like to get a feedback about these changes and to know if I
> have broken somethingelse :)

One thing - I notice that when using the old C++ generator (see the checkbox
in General Settings/Miscellaneous) a constructor is generated twice, one with
"void" in front and one without.

I'm appending the diff against current svn trunk with some minor changes.
I was in the directory kdesdk/umbrello/umbrello when making this diff.
Please send your patches as proper text attachments or gzipped -
I had a hard time cutting and pasting the diff from your mail.

Oliver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cppcodegen.diff.gz
Type: application/x-gzip
Size: 6537 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20050718/f5538bdb/attachment.gz>


More information about the umbrello-devel mailing list