Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Rhapsody Properties
Topic Summary:
Created On: 23-May-2006 12:26
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 23-May-2006 12:26
User is offline View Users Profile Print this message


Default User

Posts: 2
Joined: 27-Mar-2006

Hello,


I?m writing a Windows-based GUI Application using C++/CLI standard with Rhapsody in C++. This standard uses new C++ language features (http://msdn2.microsoft.com/en-us/xey702bw(VS.80).aspx). One of these features is interface classes (http://msdn2.microsoft.com/en-us/737cydt1(VS.80).aspx). What I?m trying to do is to create interface class under the C++/CLI terms. At the moment, if I appoint the stereotype ?interface? to the class, I receive the following code:

class ClassInterfaceName {


//// Operations ////
public :

//## operation Function1()
virtual void Function1()=0;

};

This is, of course, an interface in terms of C++ language. But in terms of C++/CLI extensions the interface would look as follows:

interface class ClassInterfaceName {


//// Operations ////
public :

//## operation Function1()
void Function1();

};

I need to know, what properties of the stereotype ?interface? do I need to change to achieve such syntax. Are these properties situated in factoryC++.prp or in siteC++.prp?


Many Thanks
Report this to a Moderator Report this to a Moderator
 25-May-2006 14:45
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi

If you're using Rhapsody 6.1 (I think) or higher, you can customise code generation using RulesComposer. However, this entails extra license purchases.

An alternative is to write your own stereotype (eg. «CliInterface») with the following properties set:

[CODE]CG::Class::GenerateImplicitConstructors = false
CPP_CG::Class::GenerateDestructor = false
CPP_CG::Class::ImplementationEpilog = "#endif //_NEVERDEFINED
"
CPP_CG::Class::ImplementationProlog = "#ifdef _NEVERDEFINED
"
CPP_CG::Class::SpecificationProlog = "interface"
CPP_CG:peration::Kind = common
[/CODE]

I've enclosed a model (for Rhapsody 6.0) to illustrate. The generated code is:

[CODE]//## class ClassInterfaceName
interface class ClassInterfaceName {


//// Operations ////
public :

//## operation Function1()
void Function1(void);


};[/CODE]

HOWEVER, you'll notice that every time you add a new operation to the class, its CPP_CG:peration::Kind property will be overridden to "abstract". There are two ways around this:

[list=1]
[*]Unoverride the property every time you add an operation
[*]Rename your stereotype so it doesn't include the string "Interface"
[/list]

:eek: Yep, you read that right. It's pretty clearly a defect. Obviously the intent is for all the operations in their «Interface» classes to be abstract, but Rhapsody should achieve this by having the property set on the «Interface» stereotype itself, not by custom-code that name-checks the stereotype and overrides properties on operations!!! :rolleyes:

Anyway, I hope that helps....

regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life

Edited: 28-Feb-2008 at 19:52 by Simon Morrish
Report this to a Moderator Report this to a Moderator
 29-May-2006 08:11
User is offline View Users Profile Print this message


Default User

Posts: 2
Joined: 27-Mar-2006

Thank you very much for your answer. I'll try it
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.