![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Rhapsody Properties Topic Summary: Created On: 23-May-2006 12:26 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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: ![]() [/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: ![]() [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 |
|
![]() |
|
![]() |
|
Thank you very much for your answer. I'll try it
![]() |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Rhapsody Properties
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.