Hi!
In fact this is not done by the ANSI C++ plugin (known from up to Rose2001A). But this
can be achieved by scripting.
I have written the attached two functions some months ago and they may be a basis for
a scripting component in Rose. They are written for the "old" C++ addin (addin name is
"cg") and must be adapted
for your needs (the ansi c++ addin uses "Cplusplus" as name), especially the cloned
properties.
You find similar scripts on the Rose scripting pages.
Hope this helps
Thomas
-----
Thomas Loeffler
Loeffler IT-Consulting GbR
mailto: [EMAIL PROTECTED]
Working for Lucent Technologies
mailto: [EMAIL PROTECTED]
=============================================================
Sub CloneProperty (inOp As Operation, cloneOp As Operation, propName$ )
Dim b As Boolean
If Not inOp.IsDefaultProperty("cg",propName$) Then
b =
cloneOp.OverrideProperty("cg",propName$,inOp.GetPropertyValue("cg",propName$))
End If
End Sub
Sub CloneOperation (inClass As Class, inOp As Operation)
Dim cloneOp As Operation
Dim param As Parameter
Dim b As Boolean
Set cloneOp = inClass.AddOperation (inOp.name, inOp.ReturnType)
cloneOp.Virtual = inOp.Virtual
cloneOp.Preconditions = inOp.Preconditions
cloneOp.Semantics = inOp.Semantics
cloneOp.Postconditions = inOp.Postconditions
cloneOp.Protocol = inOp.Protocol
cloneOp.Qualification = inOp.Qualification
cloneOp.Exceptions = inOp.Exceptions
cloneOp.Time = inOp.Time
cloneOp.Size = inOp.Size
cloneOp.ExportControl = inOp.ExportControl
For j% = 1 To inOp.Parameters.Count
Set param = inOp.Parameters.GetAt(j%)
Set x = cloneOp.AddParameter (param.name, param.Type, param.InitValue,
j%)
Next j%
' set the same property set
b =
cloneOp.SetCurrentPropertySetName("cg",inOp.GetCurrentPropertySetName("cg"))
' make the cloned operation virtual
b = cloneOp.OverrideProperty("cg","OperationKind","Virtual")
CloneProperty inOp, cloneOp, "CodeName"
CloneProperty inOp, cloneOp, "OperationIsConst"
CloneProperty inOp, cloneOp, "OperationIsExplicit"
CloneProperty inOp, cloneOp, "Inline"
CloneProperty inOp, cloneOp, "EntryCode"
CloneProperty inOp, cloneOp, "ExitCode"
CloneProperty inOp, cloneOp, "CCRegion"
CloneProperty inOp, cloneOp, "GenerateEmptyRegions"
CloneProperty inOp, cloneOp, "BodyAnnotations"
CloneProperty inOp, cloneOp, "SpecialDeclReturnType"
End Sub
Heide Marc wrote:
>
> Hi!
>
> No, i mean the generation of the implementing class. In Java Rose adds
> automatically
> all functions from interface to the implementing class. Is this possible in
> ANSI-C++
> too? It doesnt seems so. This means u have to copy all methods by hand to
> your
> implementing class.
>
> --
> Marc Heide
> address : Siemens AG, ICM N PG ES PD A
> Siemensdamm 50,13623 Berlin
> email : [EMAIL PROTECTED]
> phone : +49 30386 33229
> fax : +49 30 386 28658
>
> > -----Original Message-----
> > From: Thomas Loeffler [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, March 21, 2002 6:01 PM
> > To: Heide Marc
> > Subject: Re: (ROSE) ANSI C++ question
> >
> >
> > Hi,
> >
> > I assume you mean to create a C++ class containing pure
> > virtual functions only with the ANSI C++ plugin of Rose. To
> > achieve this, just use the stereotype <<abstract>> for all
> > interface methods.
> >
> > Hope this helps
> >
> > Thomas
> > -----
> > Thomas Loeffler
> > Loeffler IT-Consulting GbR
> > mailto: [EMAIL PROTECTED]
> >
> > Working for Lucent Technologies
> > mailto: [EMAIL PROTECTED]
> >
> > > Heide Marc wrote:
> > >
> > > Hi all!
> > >
> > > We have a project that has mixed Java/C++ code. And i have
> > the following question.
> > > Is it possible that Rose generates the methods of a class
> > that implements an interface
> > > class for ANSI C++, like it does this for Java classes that
> > implement an Java interface?
> > > Or i have to copy and paste all methods from the interface class?
> > >
> > > I know that a real interface definition is not part of C++,
> > but in UML this exists.
> > >
> > > Somebody can help me?
> > >
> > > ciao
> > >
> > > --
> > > Marc Heide
> > > address : Siemens AG, ICM N PG ES PD A
> > > Siemensdamm 50,13623 Berlin
> > > email : [EMAIL PROTECTED]
> > > phone : +49 30386 33229
> > > fax : +49 30 386 28658
> > >
> > >
> >
> ************************************************************************
> * Rose Forum is a public venue for ideas and discussions.
> * For technical support, visit http://www.rational.com/support
> *
> * Post or Reply to: [EMAIL PROTECTED]
> * Subscription Requests: [EMAIL PROTECTED]
> * Archive of messages:
> * http://www.rational.com/support/usergroups/rose/rose_forum.jsp
> * Other Requests: [EMAIL PROTECTED]
> *
> * To unsubscribe from the list, please send email
> * To: [EMAIL PROTECTED]
> * Subject: <BLANK>
> * Body: unsubscribe rose_forum
> *************************************************************************
--
Thomas Loeffler
mailto:[EMAIL PROTECTED]
phone: ++49 911 526 3423
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
* http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
* To: [EMAIL PROTECTED]
* Subject: <BLANK>
* Body: unsubscribe rose_forum
*************************************************************************