|
Re: template parameter [message #760718 is a reply to message #760715] |
Sun, 04 December 2011 18:26 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Bruce
My sympathies. When the tools fail to abstract the details you have to
understand the details which are not easy. Once you understand what you
would like your UML model to look like, you should then understand how
to control it with Papyrus. Beware that the UML model has magic
synonyms, so parameteredElement and ownedParameteredElement are related.
You may find some working examples of templates in
org.eclipse.ocl/model/OCL.uml and org.eclipse.ocl.uml/model/OCLUML.uml.
Regards
Ed Willink
On 04/12/2011 18:08, Bruce wrote:
> Hello,
>
> I need to define a class template, whose argument is a generic class
> T. That is, the easiest thing. Something that in C++ code would be
>
> template <class T> class MyClass {...
>
> I created the class, added the RedefinableTemplateSignature and
> finally added the ClassifierTemplateParameter to such signature.
>
> It displays <UNDEFINED>; I understand that I have to set one of the
> properties of the parameter (which one? "parametered element"?) to
> make it "point" to an actual type. If I try it, I need to select
> either an existing element of my diagram or create a new one.
> This is confusing, since I know that there would be another step
> ("constraining classifier") to constrain the template parameter to
> some specific element (which is a very important feature); but now I
> do not understand what I am supposed to choose at this stage, if I
> want my template parameter to be just a generic class T.
>
> Any hint appreciated
>
> Thank you.
> B
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03310 seconds