Author Topic: C++ enum and typedef in EA  (Read 1675 times)

mihan

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
C++ enum and typedef in EA
« on: December 19, 2001, 06:20:49 am »
Hi!

Can anybody say how to show in Diagram C++ enum and typedef.

Thanks.

Si Perry

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: C++ enum and typedef in EA
« Reply #1 on: December 19, 2001, 06:44:12 am »
Hi

Both things can be done, sort of, but the code generation will NOT generate the correct code from them.

Enums

Represent as a class with stereotype <<enumeration>> (which is available in the drop-down stereotype list). The name of the class is set to the name of the enumeration. Add an attribute for each enum value.

typdefs

Represent as a class with stereotype <<datatype>> (which you will have to type into the Stereotype control). The name of the class is set to the name of the datatype

Any range information etc for the type should be added as a constraint on the class.

To get the constraint info displayed on a class diagram, I add a note and link it to the constraint. (The help documentation covers linking notes to element items).

Hope this helps.
Regards
Si