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: How to override 'OMThread::execute()'
Topic Summary:
Created On: 20-Sep-2007 13:29
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.
 20-Sep-2007 13:29
User is offline View Users Profile Print this message


Arto Kiremitdjian

Posts: 8
Joined: 3-Jan-2007

We are overriding '[COLOR=Navy]OMThread::execute()[/COLOR]' in our project, but without much guidance. I found none in the Rhapsody documentation, and saw only [URL=http://modelingcommunity.telel...p?postid=6511#post6511]one thread related to it[/URL] in these forums.

Please let me know if there is a better way than the following:
(1) Copy the original implementation from "$OMRoot/LangCpp/oxf/omthread.cpp". Are any other sample implementations available?
(2) To simplify things, delete all the animation-related code. Would this break the animation feature for our project?
(3) Insert our code anywhere in the implementation. Are there any parts where we should not insert custom code?
(4) Since the starting point is Rhapsody's original implementation, check and update the overridden version every time Rhapsody is upgraded. How can we try to be forward-compatible instead?

The project is under Rhapsody in C++ v7.1.1.

Thanks a lot.
Report this to a Moderator Report this to a Moderator
 21-Sep-2007 09:53
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Arto

I've never had to do this myself, but your question reminded me of something I'd spotted in the Properties reference months ago...

You can write your own "ArtoThread" to specialise OMThread, overriding just those bits you need to, and get Rhapsody's code generator to use it instead of the built-in OMThread. The way to do this is to set properties as follows:
[CODE]CPP_CG::Framework::ActiveBase = "ArtoThread"
CPP_CG::Framework::ActiveIncludeFiles = "<oxf/arto/ArtoThread.h>"[/CODE]You'll also (obviously) need to link your code in. For simplicity of use, consider building your code into a separate library then updating your [FONT=Courier New]CPP_CG::<env>::MakeFileContent[/FONT] property to add your library to the build. (You might wish to set these properties in your [FONT=Courier New]sitec++.prp[/FONT] file to apply to all projects, or in a profile if you wish them to apply to certain projects only.)

I hope that's helpful. As I said, I've not actually done this myself, but I'd be really interested in whether this works or how you eventually get it working!

best regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 25-Sep-2007 13:06
User is offline View Users Profile Print this message


Arto Kiremitdjian

Posts: 8
Joined: 3-Jan-2007

Hi, Simon.

Thanks for the information about those properties ('ActiveBase' and 'ActiveIncludeFiles'). I didn't know that Rhapsody provided such a mechanism for specializing OMThread across projects. In our case, the class derived from OMThread lives in just one package of a project, so the site file and the OXF libraries remain unchanged.

For the override of 'execute()', we copied and modified the Rhapsody implementation (item 1 from the original post in this thread). However, we are making such modifications without the benefit of guidance. :confused: Even in the best case, upgrading to newer versions of Rhapsody might break our implementation.
Report this to a Moderator Report this to a Moderator
 3-Oct-2007 09:07
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Arto

Yes, there isn't much guidance available, is there?

One source of information, which I'll assume from your post you haven't already seen, is the OXF model. You can find it under $OMRoot\LangCpp\oxf\model. The implementation of OMThread is in Design:: oxf::Core::CoreImplementation, and there are some Use Cases and Sequence diagrams under Analysis::ThreadsManagement.

I got very excited when I first heard about this model, but if you feel the same rush of enthusiasm, restrain yourself! It's pretty light on detail and I certainly wouldn't hold it up as a best-practice example model! The Use Cases, for example, are one-liners. Still, it's worth hunting for clues...

The specific stated aim of the model is to allow end-users to understand and customise the framework. So if you don't get what you need, I'd recommend pressuring the Modelling Unit guys to add more description to it!

Let me know if you get anywhere!

best regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
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.