Jump to content

How does simple_initiator_socket get access to b_transport?

Recommended Posts

I am a bit confused by the usage of the b_transport function in the file examples/tlm/common/src/lt_initiator.cpp. The lt_initiator class has a simple_socket_initiator member that is calling the b_transport function, and I’m trying to figure out how the simple_socket_initiator class is getting access to this function. The only connection in the inheritance hierarchy I’ve been able to find between simple_socket_initiator and the b_transport function is a distant link through a friend declaration in the tlm_base_target_initiator class. I’ve drawn a diagram showing this connection. This diagram is attached. I could be wrong, but I don’t think that this connection would allow the simple_socket_initiator to access b_transport. I am lead to the conclusion that I think there is some other connection between simple_socket_initiator and b_transport that I am not seeing.


At runtime, simple_socket_initiator’s b_transport function call is getting resolved to simple_target_socket’s implementation. I’m just not sure how this resolution is happening.


Any help anyone can offer is appreciated.


Link to comment
Share on other sites



Thanks for the response. This is very helpful. This makes sense now. I had noticed the use of the dereference operator, and it had caught my attention since the initiator_socket hadn't been declared as a pointer. But it didn't occur to me to look into that further. I think perhaps I was too distracted with my search through the inheritance hierarchy.


Thanks again,


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...