[Top][All Lists]

[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 09:37:52 -0400

On Aug 30, 2007, at 1:09 AM, Michael Dickens wrote:
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).

< http://www.nd.edu/~mdickens/GNURadio/demo_sig_source/ >

I created the template C++ / SWIG interface, updated the sig_source class to use templates and SWIG MAGIC, and updated the "qa" test for "sig_source" to use my updated code instead of "gr"s code. My code passes all of the qa-tests that the "gr" code passes.

You can get the gist of how to do all of this from this example. Expanding to include other templates is straight forward - though possibly adding even more template C++ code to deal with the added number of explicit expansion possibilities: suppose there are 4 types per template [s, i, f, c]; then using 1 template results in 4 possibly explicit expansions; 2 templates in up to 16; 3 in up to 64! While not all combinations will be used or even desirable, clearly this could be an issue.

Please note the comments about automating template expansion and such (in the .h and .cc files). There's probably a quick and easy way to do this, but I wanted to get the code out. I'll think about how to clean it up so that the expansion is more automated and less difficult to the user. - MLD

reply via email to

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