Book a Demo

Author Topic: C Code Generation typedef struct  (Read 3327 times)

D. Schmid

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
C Code Generation typedef struct
« on: July 11, 2013, 09:45:43 pm »
Hi @ all,

I've got a Problem regarding the Code Generation of C-Code

The following Class Combination will get me follwing Code Fragment

---------------                     ---------------
| <<typedef>> |                   |  <<struct>>  |
|     Class1      |----------|>  |  Class2         |
----------------                   |--------------|
                                         | Attr1: int      |
                                         ----------------

Sorry for the crude graphics but I don't have a space available where I can put a screenshot right now.

The connection between the 2 Classes is a Generalization. This will produce the follwoing code:

Code: [Select]
struct Class2
{
 int Attr1;
};

typedef Class2 Class1;

Since this Code will not compile I'm searching for the right command to add the missing

typedef struct Class2 Class1;
(Sorry nesting color inside Code obviously doesn't work here  ;D)

Can anyone point me in the right direction because all I've found up to this point is that somewhere in the "Linked Class Base" Template before the %linkParentName% I should have %linkParentStereotype% but this Attribute doesn't exist  :'(.

Any help is appreciated

Best regards

Dominik



Using EA 12 (1215) | C | C++ | C# | Java | UML 2

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: C Code Generation typedef struct
« Reply #1 on: July 12, 2013, 07:49:03 am »
Hi Dominik,

I have some draft tutorial how to handle c code generation with additional requirements. Send me a PN with your eMail-Address and I can supply what I have about this subject so far.

Best regards,
Günther
« Last Edit: July 12, 2013, 07:49:50 am by g.makulik »
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/