Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - D. Schmid

Pages: [1]
1
General Board / 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




2
Hi again,

short Update. Just tested with 1215 and all works fine. Thank you all.

Regards

Dominik

3
Hi @all,

thank you for the quick Responses. The Workaround is working fine. I will test the script using 1215 today and will send a quick Feedback here and if necessary a little Bug Report. We currently use 1210 and there it didn't work.

Regards

Dominik

4
Hi @all,

I'm currently trying to add a realization from a class to an interface with a script.

Unfortunatelly this:

Code: [Select]
     
var eRealization;
eRealization = eClass.Realizes.AddNew (eInterface.ElementID, "Interface");
eRealization.Update ();
eClass.Realizes.Refresh();
eClass.Update();
eClass.Refresh ();
won't work

also this:

Code: [Select]
var eAssociation as EA.Connector;
eAssociation = eClass.Connectors.AddNew ("", "Realization");
eAssociation.SupplierID = eInterface.ElementID;
eAssociation.Direction = "Source -> Destination";
eAssociation.Update();
will throw an error at the update saying the Realization is not allowed "class --> interface"

How can I add a realization to a class using a script? In both cases the interface will also be created by the script.

Regards

Dominik

5
Hi @all,

I'd like to create a new MDG with adapted C-Code Templates unfortunatelly I can't choose C Language when choosing the appropriate Code Modules in the MDG Technology Wizard. And if create a new Language I can't choose a Header Extension for this new Language.

All Iwant to achive is that we get a new Company wide C Code generation Template that gets Updated automatically if I change it.

Best regards

Dominik

Pages: [1]