It is currently Wed Feb 08, 2012 4:55 pm

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Customize the name of rootState_dispatchEvent
PostPosted: Tue Feb 09, 2010 7:00 am 

Joined: Thu Oct 02, 2008 11:40 am
Posts: 11
Hello,
I am using RiC v 7.5. I just need to customize, ie change or append, the name of the function rootState_dispatchEvent automatically generated by Rhapsody. All I wanted to do is append the object name also in the function name as follows myObject_rootState_dispatchEvent for my Object-model-element "myObject".

I explored the properties on CG::Framework .. C_CG:: etc.. but couldnt find how to do it? Is this possible?

I think it is possible since if I select FunctionalC profile, the same method is generated with <File> element name appended.. ie myFile_rootState_dispatchEvent for my FILE-model-element "myFile".

May I ask if anyone could help me?

Thanks,
Kars


Offline
 Profile  
 
 Post subject: Re: Customize the name of rootState_dispatchEvent
PostPosted: Wed Sep 08, 2010 9:58 pm 

Joined: Wed Oct 31, 2007 3:09 pm
Posts: 58
Location: Milkyway, classic 9-planet solar system
Even that this is an "old" question now, and may be it is not of relevance any more...

Why would you want to do that?

It seems to me, that you try to bypass the framework code and to call a globally known, modified rootState_dispatchEvent() directly?

If this is the case, then there are three options to achieve that (each with pros and cons):

1. Create a public wrapper operation to then call that private static operation.
This can be done either manually by adding an operation (the single case solution) or by defining a rule for a "standard operation", which could be assigned via a stereotype (the reusable pattern solution).

2. Use Rhapsody's post processing option via Property CG:File:InvokePostProcessor to modify the generated code for such classes (behavior may be assigned to individual classes via Stereotype). Keep in mind that changing just the name may not be sufficient to make the code compilable.
You should also:
* remove the "static" modifier keyword
* generate a forward declaration in the class.h file
* change the entry in the generated vtable to reflect that change in the table.
* think about the rootState_entDef() operation in the same way.

3. Use the CG Simplify option (see properties C_CG:Configuration:ShowCgSimplifiedModelPackage and C_CG:Class:Simplify=ByUserPostDefault) in order to modify the generated simplified model elements before generating code. There are examples model in the installation directory under Rhapsody\Samples\CustomCG Samples\CppSimplifiers that show how to do that via Rhapsody's Java API.

The easiest and quickest approach is probably #1, while #3 is the most elegant and flexible one. I'm not a fan of code postprocessing like in approach #2.

-Luke.



_________________
May the force be with you ...
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

cron

suspicion-preferred