plafratt Posted June 4, 2015 Report Share Posted June 4, 2015 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. Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted June 9, 2015 Report Share Posted June 9, 2015 An initiator socket is first of all a SystemC port, enabling access to its bound interface (here of type tlm_fw_transport_if) via the operator->. Did you notice, that you call "socket->b_transport()", not socket.b_transport()? hth, Philipp plafratt 1 Quote Link to comment Share on other sites More sharing options...
plafratt Posted June 10, 2015 Author Report Share Posted June 10, 2015 Philipp, 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, Patrick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.