![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Injecting events from global space Topic Summary: Created On: 5-Sep-2006 21:08 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 ![]() 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 |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Injecting events from global space
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.