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: Injecting events from global space
Topic Summary:
Created On: 5-Sep-2006 21:08
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.
 5-Sep-2006 21:08
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Hi guys,

I was wondering if anyone have a nice streamlined way (lets call i a pattern) to inject an event on a C++ reactive class from an "old fashion" C function.

As I have done it this far, I have used a <<Singleton>> class (lets call it A) with a link to the reactive class instance in question (lets call it B).

Then the C function would do something like
[CODE]A::instance()->injectSomeEvent();[/CODE] - where injectSomeEvent() uses the GEN() macro:
[CODE]injectSomeEvent()
{
itsB->GEN(evSomeEvent);
}
[/CODE]Any other suggestions?

-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
Report this to a Moderator Report this to a Moderator
 6-Sep-2006 08:09
User is offline View Users Profile Print this message


Lars Denker Jørgensen

Posts: 14
Joined: 1-Mar-2006

Hi Jesper

The article [url]http://www.embedded.com/columns/showArticle.jhtml?articleID=9900245[/url] describes a way to convert interrupts (C functions) into the OO world.

Hope this will inspire you :0)

Best regards
Denker
Report this to a Moderator Report this to a Moderator
 8-Sep-2006 13:06
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Jesper

I hope you're well!

I highly recommend the following article:

[COLOR=Navy]http://www.codeproject.com/cpp/FastDelegate.asp[/COLOR]

Not only is it a very interesting read, but the solution is excellent. Although there are some compromises in the internal design (explained by the Author) the result is a very lightweight, fast and compatible means of calling a member function on a particular object without having to "cross the global space", so to speak.

I'd be interested to know what you think of it!

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
 11-Sep-2006 07:46
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Thank you for your suggestions, Lars and Simon

I'll get back to you when I get to try the solutions.

Simon:
I'm very well , and you?

I have been wandering the danish countryside, sharing my experience with those who would listen, regarding Model Driven Development and Rhapsody. I'm getting the feeling that I ought to be on the Telelogic payroll .

-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
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.