discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] SWIG/C++ Template Expansion Info


From: Michael Dickens
Subject: Re: [Discuss-gnuradio] SWIG/C++ Template Expansion Info
Date: Thu, 30 Aug 2007 01:09:50 -0400

Another point: Each template type must be individually instantiated in the code. This is not automated in any way except for the SWIG MAGIC stuff, but some parts of it probably could be automated via #define's or something like that. All of this means that instead of defining some code ("XXX") and having the Makefile expand it, everything is in the code instead .. all of the instantiations, whether SWIG or C++. This makes it simple to change the code for new/ other template types (copy, paste, replace-string), but it's not as automated as that which the Makefile provides (via a list of expansion types). It's a trade-off; somewhere a list has to be put together to handle what the expand or instantiate.

On Aug 29, 2007, at 11:23 PM, Eric Blossom wrote:
Can you point us to the code

I'll post the code for demo_sig_source instead once it compiles and works, most likely later today (for me, now, since I'm up way too late).

, and show for example, how you'd handle
gr_sig_source*?

Since the X instantiations are 's', 'i', 'f', and 'c', and the only method that's non-standard is "::work", and there is only one "complex" type that I've ever seen used in GNU Radio ("gr_complex"), then I'll write the 'default' code for non-complex types since there are many more of them, and overload it for "gr_complex" specifically. The rest will be about the same as my current code for template expansion since all the other methods are common to all output types. This is the same method used for modifying the base name of the block (overloading a "make_name" method, one for each desired template type). - MLD




reply via email to

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