Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Creating Classes with Templates In Class Diagrams
Creating Classes with Templates In Class Diagrams [message #1295833] Mon, 14 April 2014 16:15 Go to next message
Ali Ghorashi is currently offline Ali GhorashiFriend
Messages: 20
Registered: July 2009
Junior Member
Hello All,
I'm trying to create a templatized class (e.g. vector<T>, map<K,E>, etc) in my class diagram but I'm running into a problem.

I have created the class on the diagram and added a RedefinableTemplateSignature to it. When I try to add a TemplateParameter, I get the TemplateParameterConfiguration dialogbox (attached picture). After clicking the red button, I get to pick from an empty list of "Elements".

I'm not sure where to go from there. How do I get Elements on the list?
Re: Creating Classes with Templates In Class Diagrams [message #1295917 is a reply to message #1295833] Mon, 14 April 2014 17:38 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1206
Registered: July 2009
Location: Canada
Senior Member

Hi,

The latest nightly builds of the up-coming Luna release should have
improvements in this dialog.

Note that the set of elements you can choose from depends on the kind
of template parameter (ClassifierTemplateParameter,
ConnectableElementTemplateParameter, etc.) Each kind of parameter will
constrain the kinds of parametered elements that you can choose in the
dialog. For example, if you need to expose a an attribute of the
templated class as a parameter, then you need to create a
ConnectableElementTemplateParameter.

I think there may be a problem with the treatment of the plain
TemplateParameter metaclass, however. I would expect it to allow
selection of any kind of ParameterableElement, but the dialog seems to
allow selection only of elements that are not covered by the
special-case parameters: things like ValueSpecifications that are not
Classifiers nor Operations nor ConnectableElements.

HTH,

Christian


On 2014-04-14 16:15:27 +0000, Ali Ghorashi said:

> Hello All,
> I'm trying to create a templatized class (e.g. vector<T>, map<K,E>,
> etc) in my class diagram but I'm running into a problem.
>
> I have created the class on the diagram and added a
> RedefinableTemplateSignature to it. When I try to add a
> TemplateParameter, I get the TemplateParameterConfiguration dialogbox
> (attached picture). After clicking the red button, I get to pick from
> an empty list of "Elements".
>
> I'm not sure where to go from there. How do I get Elements on the list?
> <image>
Re: Creating Classes with Templates In Class Diagrams [message #1296225 is a reply to message #1295917] Mon, 14 April 2014 22:35 Go to previous messageGo to next message
Ali Ghorashi is currently offline Ali GhorashiFriend
Messages: 20
Registered: July 2009
Junior Member
It appears that Papyrus (0.10.2.v201402191554) cannot handle Templates parameters of type 'Class' which is what map, list, and vector libraries use. It insists on setting the template type to an integer.
Re: Creating Classes with Templates In Class Diagrams [message #1297296 is a reply to message #1296225] Tue, 15 April 2014 15:13 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1206
Registered: July 2009
Location: Canada
Senior Member

Hi,

Did you create a ClassifierTemplateParameter to expose your class
parameter? Or did you create a simple TemplateParameter?

Cheers,

Christian

On 2014-04-14 22:35:23 +0000, Ali Ghorashi said:

> It appears that Papyrus (0.10.2.v201402191554) cannot handle Templates
> parameters of type 'Class' which is what map, list, and vector
> libraries use. It insists on setting the template type to an integer.
Previous Topic:How to assign NFP values to properties of MARTE stereotypes in (Papyrus) UML models
Next Topic:Hyperlink Windows
Goto Forum:
  


Current Time: Thu Jul 09 09:36:45 GMT 2020

Powered by FUDForum. Page generated in 0.02188 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top