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: Ports (C++)
Topic Summary:
Created On: 19-Mar-2008 19:43
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.
 19-Mar-2008 19:43
User is offline View Users Profile Print this message


Garrett Wampole

Posts: 7
Joined: 30-Jan-2008

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
Report this to a Moderator Report this to a Moderator
 20-Mar-2008 11:04
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

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:

getPA()->getOutBound()->getItsIAtoB()->getItsIAtoB()

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.

IAtoB* IAtoB::getReceivingObjectPointer()

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
Report this to a Moderator Report this to a Moderator
 20-Mar-2008 17:00
User is offline View Users Profile Print this message


Garrett Wampole

Posts: 7
Joined: 30-Jan-2008

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.
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.