Bug 581530 - CPP Ptr stereotype behaviour with ListHint
Summary: CPP Ptr stereotype behaviour with ListHint
Status: UNCONFIRMED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Designer (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-15 02:46 EST by Graham Lund CLA
Modified: 2023-02-20 04:38 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Lund CLA 2023-02-15 02:46:35 EST
If the Ptr stereotype is applied to a parameter/property with multiplicity > 1 and the ListHint stereotype has been applied, then the generated code is not as I expected, for example:
std::vector<MyClass>* rather than std::vector<MyClass*>
Comment 1 Ansgar Radermacher CLA 2023-02-20 04:33:46 EST
It is not so clear what the code generator should do in that case. It is also possible that the user wants to pass the vector itself as a pointer.
In order to pass a vector of pointers, the user can currently define a primitive type MyClassPtr and use the stereotype <<Typedef>>.
I will ask the opinion of my colleagues before deciding whether to change the current code generator.
Comment 2 Graham Lund CLA 2023-02-20 04:38:34 EST
Using a 'fake' type is my current workaround, but this seems to mess up the detection of whether to forward declare or include the class in the header.