Hi Forum
At my previous company I used EA already for C++ code generation, now at my new job I made my manager to buy EA (professional 9.2)
Somehow the C++ code generation in 9.2 does not generate pointers in arguments to operations. the Selector "direction" (in,inout,out,return) on the parameter has simply no effect.
In the model it is displayed correctly:
inout and out parameters have a asterisk *
but the generated code looks like this:
unsigned char anOp(const unsigned int paramIn, unsigned int paraminOut, unsigned int paramOut);
In C++ code engineering option the "default reference type" is set to Pointer (*)
BTW, C code engineering also does not produce pointers for function parameters.
Pointers however are created for members.
Could it be due to the fact, that I had first installed a 30-day trial version? If so, how can i purge all EA settings?
UPDATE:
- deleted \AppData\Roaming\Sparx Systems
- re-installed EA (build 922)
--> same thing, no pointers.
Imported classes with methods using pointers generates in EA operations with all parameters direction to "in".
The type of the parameter for this functions is not e.g. int but int* .
I had a look at the code generation templates, seems there is no code that checks the direction of a parameter.
Can any one with EA 8.xx please check the code generation templates, I am sure it worked a year ago.....
Update 2:
seems I have found a workaround, apparently the "paramKind"is not evaluated in the code templates. I included:
%if paramKind != "in"%
*
%endIf%
It now at least generates code what I want to generate but I have still no clue how I could now genererate something that uses references (Type &)
Seems to me somebody at Sparx copied code form Java or other language templates that do not need to specify references/pointes
Best regards
Thomas