sumit_tuwien Posted January 31, 2015 Report Share Posted January 31, 2015 Dear All, I have an use case as follows: # include <systemc> # ifndef M_SIGNAL_H_ # define M_SIGNAL_H_ template < typename T > class m_signal : public sc_core::sc_signal < T > { public : m_signal (const char* portName_) { std::cout << this->name() << std::endl ; // I need to assign name! } }; # endif int sc_main(int argc, char* argv[]) { m_signal < sc_dt::sc_uint < 21 > > thisSignal("thisSignal") ; std::cout << thisSignal.name() << std::endl ; std::cout << thisSignal.basename() << std::endl ; std::cout << thisSignal.kind() << std::endl ; return EXIT_SUCCESS ; } I want to give access name() of the parent class. An idea to inherit it will be great and appreciated. This is very important for tracing to work accordingly. Regards, Sumit Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted January 31, 2015 Report Share Posted January 31, 2015 Hi, not sure if this is what you are searching for but how about the following: template < typename T > class my_sig_type : public sc_core::sc_signal<T> { typedef sc_core::sc_signal<inner_type> base_type; my_sig_type(const char * name) : base_type(name) {} }; Greetings Ralph sumit_tuwien and maehne 2 Quote Link to comment Share on other sites More sharing options...
sumit_tuwien Posted January 31, 2015 Author Report Share Posted January 31, 2015 Thanks Ralph 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.