On Wed, Feb 01, 2006 at 11:32:06PM +0100, Martin Dvh wrote:
> I implemented complex versions of agc and single pole iir filter.
> To do this I had add an extra calc_type parameter to the gr_single_pole_iir
> template.
> (I changed all blocks that use this accordingly)
> If this extra parameter is not wanted I could still implement a complex iir
> filter but then I am forced to use also a complex value for the tap.
> Which is not quite intuitive, and also has a higher computational load as
> result.
Hi Martin,
I think you can get what you want without adding the extra template
parameter by using "partial specialization" (or at least not having
the user have to mess with the extra template parameter) See C++ docs.
Basically you want some template hackery that is equivalent to:
if i_type is gr_complex and tap_type is float or double
do special case 1
default
do it the way it is now
I think you can get the template instantiation logic to infer calc_type for you.
Eric
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio