discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Parent Class For UHD USRP Source/Sink


From: Daniel Labarowski
Subject: [Discuss-gnuradio] Parent Class For UHD USRP Source/Sink
Date: Tue, 17 Jul 2012 14:59:28 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]