Adding members to MC C generated structures.

homepage Forums BridgePoint/xtUML Usage and Training Adding members to MC C generated structures.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7727
    Schmill
    Participant

    Hello,
    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.

    #7728
    cort
    Keymaster

    You simply add more attributes to the class in the data model.

    Or are you wanting to modify the generated code?

    #7729
    Schmill
    Participant

    Correct, 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.
    #7731
    cort
    Keymaster

    There 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.

    #7732
    Schmill
    Participant

    Very well, I have the documentation. just wanted to make sure I don’t do anything that is criminal to the Class structures ;)

    #7733
    cort
    Keymaster

    This 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. :)

    #7734
    Schmill
    Participant

    I’m still dealing with the very basics, but thank you so much)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.