homepage › Forums › BridgePoint/xtUML Usage and Training › Adding members to MC C generated structures.
- This topic has 6 replies, 2 voices, and was last updated 3 weeks ago by
Schmill.
-
AuthorPosts
-
November 13, 2023 at 9:49 am #7727
Schmill
ParticipantHello,
From MC perspective, is it safe and legitimate to add members to the generated structures of Classes?In this example I add att3 to the generated struct:
struct SomeDomain_RD
{
Escher_StateNumber_t current_state;
Escher_UniqueID_t ThingID;
i_t att1;
c_t att2[ESCHER_SYS_MAX_STRING_LEN];
struct some_type* att3; /* - can this be added to the gen? */
};
Thank you.
November 13, 2023 at 10:59 am #7728cort
KeymasterYou simply add more attributes to the class in the data model.
Or are you wanting to modify the generated code?
November 13, 2023 at 11:02 am #7729Schmill
ParticipantCorrect, I would like to add pointers to structs that are not known to the data model. by modifying the generated code.
-
This reply was modified 3 weeks ago by
Schmill.
November 13, 2023 at 11:06 am #7731cort
KeymasterThere is documentation in the MC-3020 User Guide for doing this. But the summary is:
1. Copy generated code from the /src folder to the /gen folder.
2. Edit the code in the /gen folder.
3. Now, each time you generate code, the edited file will get copied _over_ the generated file in the src folder.If you modify the model behind the generated code, you may want to re-generate and re-edit.
November 13, 2023 at 11:11 am #7732Schmill
ParticipantVery well, I have the documentation. just wanted to make sure I don’t do anything that is criminal to the Class structures ;)
November 13, 2023 at 11:22 am #7733cort
KeymasterThis is the start. Pretty soon you will be asking how to change the model compiler itself to add the various patterns you are applying to the classes. :)
November 13, 2023 at 11:26 am #7734Schmill
ParticipantI’m still dealing with the very basics, but thank you so much)
-
This reply was modified 3 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.