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: Inheritance RiC 7.0
Topic Summary:
Created On: 1-Feb-2008 00:39
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.
 1-Feb-2008 00:39
User is offline View Users Profile Print this message


mike t

Posts: 14
Joined: 7-Dec-2007

I have some problems with the CG mechanism regarding inheritance in RiC 7.0.

Situation:

Mainclass (CLASS MAIN)

Base class (CLASS A) with a link to the main class (itsMAINCLASS) and a state chart, which has references to the CLASS MAIN.

Derived class (CLASS B) from CLASS A. with the same state chart.

Problem:
The state chart of the CLASS A works fine but the state chart of the CLASS B reports an error because there is no link (itsMAINCLASS).

looks like the link is not inherited by the CLASS B (it does not appear in the source code either).
But if i try to create a link with the same name (itsMAINCLASS) it reports an error because "There is already a role with this name".

Of course i can rename the link to (itsMAINCLASS_1) but then i have to change all the references in the state chart too and i don't want to do that.

Maybe somebody already experienced such a problem with RiC7.0 and can explain me why the Inheritance does not work as i want it to

thanx in advance
MIKE

I could post a piece of code if i explained the problem to weakly.

Edited: 1-Feb-2008 at 00:41 by mike t
Report this to a Moderator Report this to a Moderator
 4-Feb-2008 11:11
User is offline View Users Profile Print this message


mike t

Posts: 14
Joined: 7-Dec-2007

maybe i was not very clear in my original post. So i try to explain it a little bit further.

I have a model with 3 classes (see attached)

The Main Class
struct Street {
...
int busy; /*## attribute busy */
struct CAR itsCAR; /*## classInstance itsCAR */
...
}

a class linked to the main class as a part in the CSD with a created link to the class Street

struct CAR {
...
struct Street* itsStreet;
...
}


now i can easily refer to the main class by using this link like:
me->itsStreet->busy = 2;

If i derive this class, the link is not derived as well
struct SportsCar {
.. no link to itsStreet
}


I i try to create the link manually i get an error "cannot add relation. case already has a relation with this name!"

so my only way is to create a relation with another name which is not a good option because then i have to change the code in every derived object if i want alter things in the Street class, or send an event to that class.

hope this time my explanation is better and somebody give me a hint of whats wrong.
lg Mike

p.s.:i attached the source files with the error in the derived class

CSD.JPG
CSD.JPG  (9 KB)
Project.rar
Project.rar  (163 KB)

Report this to a Moderator Report this to a Moderator
 4-Feb-2008 19:36
User is offline View Users Profile Print this message


Michael Lettner

Posts: 16
Joined: 7-Dec-2007

I was wondering if inheritance is supported in RiC (7.0) at all?

When I use some inheritance in my class diagram and try to generate code, all I get is following warning:
"Warning: Code generation ignores inheritance in C."

Is there a property that must be set, or is it not supported at all?

thanks!
Report this to a Moderator Report this to a Moderator
 6-Feb-2008 10:15
User is offline View Users Profile Print this message


Bernhard Gassner

Posts: 15
Joined: 27-Jun-2007

Inheritance is not supported, when using Rhapsody in C.

This is one of the main limitations when using the language C in Rhapsody, compared to C++.
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 13:33
User is offline View Users Profile Print this message


mike t

Posts: 14
Joined: 7-Dec-2007

IC i feared that this might be the problem. Hope that the Rhapsody Team finds a solution for that in future releases.
regards
mike
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 0 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.