![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
profile :
search :
help :
dashboard :
calendar :
home
|
||
|
Topic Title: Ports (C++) Topic Summary: Created On: 19-Mar-2008 19:43 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Let's say I have a link between a port on A (call it 'pB') and a port on B (call it 'pA').
pA provides an interface called 'IBtoA' and requires 'IAtoB' similarly pB provides an interface called 'IAtoB' and requires 'IBtoA' If I'm in A and call getPA() (which returns a pA_C*)...how can I 'get' to B? pA_C::getOutBound()::getItsIAtoB() seems to return the port's interal reactive 'framework' object. How can I go from there to what 'owns' the port, namely 'B'? Thanks, -Garrett |
|
![]() |
|
![]() |
|
Hi Garrett
getPA()->getOutBound()->getItsIAtoB() will return a pointer to pB's "Inbound" object. If you call the getItsIAtoB operation on that, you will have a pointer to B, ie: However, this approach may not be your best option. In your implementation, you know that the pointer is to a "B". However, in general, getItsIAtoB may return another Inbound port object, if you are forwarding messages/events through a hierarchy of objects. Port interfaces are intended to decouple objects. But if you really need to get a pointer to the eventual destination of a port connection, I'd consider adding an operation to the port interface specifically for that purpose. This message will automatically get forwarded on through any chained port connections. What do you think? best regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|
![]() |
|
![]() |
|
You're right, after writing this post, I decided to do exactly what you say. What I want to do is query all of the objects connected to ports on 'A' in order to decide which one to send a message to.
Adding an API to the port's interface is probably the best way to go, there. |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Ports (C++)
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.