Book a Demo

Author Topic: Code Generation and Default Reference Type (C++)  (Read 3550 times)

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Code Generation and Default Reference Type (C++)
« on: September 21, 2005, 09:47:16 am »
Hi folks,

again I have a problem with Code generation.

I have had the same problem as described in [inout] C++ References.

After I've changed my code templates it worked well. All my [inout] and [out] parameters was passed by reference.

Then I've decided to change the default reference type from "Reference (&)" to "Pointer (*)". I've created the code again but the parameters are still passed by reference (instead as pointer). :(

After I've noticed this, I've created a new diagram, with a new class. And created code for this class. In for this new class the code is generated correct.  ???

Is this a bug or a feature?  :-/
bye
Andreas

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Code Generation and Default Reference Type (C+
« Reply #1 on: September 21, 2005, 01:07:40 pm »
Interesting...

Were the Classes created by different version of EA?  For example, one in EA 4.5 and one in 5.0  or even one with build 767 and the other with 770?

The templates should point you are where the point of difference is.  As they used to say in the school exams:  "Compare and Contrast" ;)

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation and Default Reference Type (C+
« Reply #2 on: September 21, 2005, 04:14:32 pm »
I can tell you what I think is causing it.

It is possible to set options for individual classes.  If you set any option at all1 by clicking advanced from the generation dialog, you are setting options for that class, and all the options will be set.

Assuming you didn't intend to set these class level options, you can clear them by following the instructions at http://sparxsystems.com.au/EAUserGuide/index.html?resetoptions.htm.

Simon

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: Code Generation and Default Reference Type (C+
« Reply #3 on: September 22, 2005, 12:08:55 am »
Hi Simon!

It seems this was the problem. I didn't know that it's possible to set seperate generation settings for each class.

You live and learn!

Thanks!
bye
Andreas