Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: sergiyn on August 27, 2003, 02:14:24 pm
-
C++ code generation for parametrized class creates .h and .cpp file. .cpp file contains (as usual) implementation of the defined functions which doesn't make any sense in case of a template since it's not linkable... Is there a way to create the implementation in the .h file?
thnx
-
Hi sergiyn,
In the current release of EA (618), it's not possible to move the implementation to the .h file. However, if you have access to the beta version of EA 3.60 (see the Registered Users page), you can specify the template class's functions to be inline. Set the tagged value "inline" to be "true", for the relevant functions.
This will still create a .cpp (empty), but will place the function body stubs in the class declaration on initial forward generation.
I've only had a quick play around with this using the beta and it seems to do what your after. If you care to modify the default code generation templates, there are probably simpler ways to achieve this than setting each method to inline in the model... for example using a class-level tagged value and checking this in the code generation templates.
Hope this will prove useful.
Regards,
Ben
-
Hi Ben,
thank you very much for the prompt answer.
Unfortunatelly I don't have access to the "Registered Users" area, since I'm evaluating the product...
I guess code generation templates are also part of the new release? Couldn't find them in the EA 3.51.
Regards,
Sergej.
-
Hi sergiyn,
That's right. The code generation templates will be part of the EA 3.60 release- not available in EA 3.51.
Regards,
Ben