leoeltipo Posted March 7, 2014 Report Share Posted March 7, 2014 Hello, I would like to be able to overload operator<< to be able to print transaction information (assuming tlm_generic_payload for transaction type). I think on two alternatives: 1) ostream& operator<<(ostream& os, tlm_generic_payload& trans): the problem is that operator<< should be declared a friend function inside the definition of class tlm_generic_payload, and that is not the case. 2) Define a new class derived from tlm_generic_payload with the friend declaration. The problem is that I sould change the transaction type all over the design, and that attempts against interoperability because tlm_generic_payload is not the type in use. What do you think is the right way of doing this? Thank you in advance. Leandro Quote Link to comment Share on other sites More sharing options...
David Black Posted March 7, 2014 Report Share Posted March 7, 2014 You should be able to use the accessor methods of the tlm_generic_payload to get all the information needed for operator<<. 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.