summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/swig
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-08-14 22:28:47 -0400
committerTom Rondeau <trondeau@vt.edu>2012-08-17 21:17:34 -0400
commit76a6f912706313fdc256b09aa17eeaf275e1fbc4 (patch)
treecb9712b03fc576126dca834b4aaa1e5e53538d5a /gnuradio-core/src/lib/swig
parentc537cf7d85f59db21c98ac859bc08fbe55031314 (diff)
swig: adds a macro to allow us to specify different factory functions besides 'make' for a block.
digital: converted cpmmod to new style. gmskmod inherits directly from cpmmod with just preset args. Defining another factory function, make_gmks_bc, here to make this all handled internally.
Diffstat (limited to 'gnuradio-core/src/lib/swig')
-rw-r--r--gnuradio-core/src/lib/swig/gr_swig_block_magic.i8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i
index 4016ae7727..6d1af6136d 100644
--- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i
+++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i
@@ -48,3 +48,11 @@ BASE_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(),
BASE_NAME = BASE_NAME.make;
%}
%enddef
+
+%define GR_SWIG_BLOCK_MAGIC_FACTORY(PKG, BASE_NAME, FACTORY)
+%template(FACTORY ## _sptr) boost::shared_ptr<gr:: ## PKG ## :: ## BASE_NAME>;
+%pythoncode %{
+FACTORY ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id())
+FACTORY = BASE_NAME ## _make_ ## FACTORY;
+%}
+%enddef