Author Topic: Model array, structs and enums within a C++ Class for Generating code  (Read 1747 times)

adeebulhafiz

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Hi Community

I am trying to generate and build the code for an executable state machine. The class should have a user defined enum variable, an array and a struct type variable. However the code generated is not correct and throws error on compilation.
How do I model this correctly in UML so that it compiles well?
I created a data type and enum separately and then added a composition link from class to these elements. Then I used enum and the data type in the Class as an Attribute. However during code build, I am thrown with bunch of errors basically meaning that these data types are not defined anywhere.

Note: I don't want a separate Classes for the each data type element. I want them to be included in the same file as .c or .cpp file depending on the language


Class Diagram:
https://ibb.co/C5g6DX2

Error and relevant code snippet generated:
https://ibb.co/sQGVWvk
https://ibb.co/tcFCDJD

C++ Error:
https://ibb.co/0y565fB

UML level: Beginner
EA version: 15.2

Thanks
Syed Adeebul Hafiz
« Last Edit: July 07, 2022, 11:32:50 pm by adeebulhafiz »