Hello,
I am working on a C++ block which will call the set_center_freq method of a uhd_usrp_source or uhs_usrp_sink passed to the block with a pointer. Both the source and sink contain the set_current_freq method, so from an identity standpoint it really doesn't matter which one is passed to the block. The issue is that I have to set a type for the object to be passed in the function call. I was wondering if there is a parent class which encompasses both the source and sink types that I could use for passing the pointer? If it is not possible to do this I could always pass the pointers to the block as distinctly for a source or sink, but for the sake of generic code I thought it would be better not to limit the block to one or the other. I'm thinking about making it so that the user can pass an array or vector of pointers to the block and the block would then call this method for all pointers passed. This would allow use with multiple devices as well. Any thoughts on how this could be done? I thought that perhaps a template would work but I have not had any success with this method so far. I don't think that a template will let me call an method defined in a strongly typed class.

--
Daniel Labarowski


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to