|
Re: Adding Container To Class Diagram [message #1791766 is a reply to message #1791763] |
Thu, 05 July 2018 06:41 |
|
Hi Ron,
there is nothing like a vector container in UML.
But you have several choices to express multiplicity
1. you want to completely abstract away the fact multiplicity is provided by using a vector container. In that case you just have to choose "0..*" as multiplicity of the attribute.
2. you want to express multiplicity is somehow provided by using a vector container. In this case I would suggest you to define a "Vector" stereotype and apply that very stereotype to the attribute.
3. you want to express some or all of the the operations of the vector container. In this case I would suggest you to provide the vector container's interface as UML Interface.
/Carsten
|
|
|
|
|
|
Re: Adding Container To Class Diagram [message #1791991 is a reply to message #1791935] |
Mon, 09 July 2018 11:41 |
|
There has been a similar thread here. Papyrus SW designer contains a small subset of the C++ STL library, including the vector class. However, the STL model library is just a set of empty classes within a package tagged as "ExternLibrary" which assures that a suitable #include will be produced. You can find this library via "import registered library", if SW designer and C++ support is installed. From a pragmatical viewpoint, you can define bound types such as vector<double> by creating a new empty class with a suitable name (vector<double>) and add a "TemplateBinding" relationship towards the class vector from the STL library. Make sure that the new type is in a package with ExternLibrary as well to assure that no code will be generated for it (il will still be referenced using its name in application classes that use it).
However, this is not very clean as the template binding cannot contain a suitable parameter substitution, since vector in the STL model library has currently no template signature (as it probably should).
|
|
|
|
Re: Adding Container To Class Diagram [message #1816573 is a reply to message #1816473] |
Thu, 31 October 2019 15:30 |
|
Hi Steve,
yes, this is still the case. In the Papyrus for Robotics customization, we use template signatures for communication patterns and enable the automatic creation of an actual and a template binding from the palette. If I find the time, I can do something similar for STL.
Concerning the 2nd part of your message: some time ago it was possible (I think) to create a template binding towards a class without a template signature. This is apparently no longer possible, but this is rather good and not a bug as a template binding makes only sense in in the presence of a template class. Except that the pragmatical work-around does not work any more, i.e. it would be much better to add the missing template signatures.
Ansgar
[Updated on: Thu, 31 October 2019 15:41] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04517 seconds