|C++ Code Generation and variable multiplicity [message #1803898]
||Wed, 13 March 2019 11:02
| Yoann Farre
Registered: November 2017
Hello everyone, |
I'm trying to use variables with a multiplicity which is undefined (more than 1) and generate C++ code.
If the multiplicity field is set to 0..* , the code generator set an array. It's fine if the multiplicity is known and defined (for instance 3), but if 0..* is set, the code cannot compile.
As in C++, tables have fixed size, I propose that in the case where the multiplicity is set to *, the property would be generated as std::vector.
For example, if I defined a property like this in the model :
The code result could be:
Currently, the generated code cannot be compiled :
I know that I can create an external type which uses std::vector to type the property but I think this is a lack for the multiplicity management of a variable. Could you give your opinion and maybe other ideas ?
Powered by FUDForum
. Page generated in 0.03805 seconds