Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

swig: shrunk the size of the generated swig file

Dont need to declare the class again for every make_* function,
simple declare it once, and then export each factory function.
  • Loading branch information...
commit b089505c1f3ef61a093069c1833ea70a5cc992f9 1 parent d53dc65
@guruofquality authored
View
10 swig/extras_factory.i
@@ -28,6 +28,7 @@
//----------------------------------------------------------------------\
%define GR_EXTRAS_SWIG_BLOCK_FACTORY(NAME)
+ GR_EXTRAS_SWIG_BLOCK_FACTORY_DECL(NAME)
GR_EXTRAS_SWIG_BLOCK_FACTORY3(NAME, make, NAME)
%enddef
@@ -36,9 +37,14 @@
%enddef
%define GR_EXTRAS_SWIG_BLOCK_FACTORY3(CLASS_NAME, FACTORY_NAME, PYTHON_NAME)
- %template(PYTHON_NAME ## _sptr) boost::shared_ptr<CLASS_NAME>;
%pythoncode %{
- PYTHON_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id ())
PYTHON_NAME = CLASS_NAME.FACTORY_NAME
%}
%enddef
+
+%define GR_EXTRAS_SWIG_BLOCK_FACTORY_DECL(CLASS_NAME)
+ %template(CLASS_NAME ## _sptr) boost::shared_ptr<CLASS_NAME>;
+ %pythoncode %{
+ CLASS_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id ())
+ %}
+%enddef
View
1  swig/extras_fir.i
@@ -33,5 +33,6 @@
////////////////////////////////////////////////////////////////////////
using namespace gnuradio::extras;
+GR_EXTRAS_SWIG_BLOCK_FACTORY_DECL(decim_fir)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(decim_fir, fc32_fc32_fc32)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(decim_fir, f32_f32_f32)
View
1  swig/extras_ops.i
@@ -50,6 +50,7 @@
using namespace gnuradio::extras;
%define MAKE_ALL_THE_OP_TYPES(op)
+ GR_EXTRAS_SWIG_BLOCK_FACTORY_DECL(op)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(op, fc32_fc32)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(op, sc32_sc32)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(op, sc16_sc16)
View
1  swig/extras_sources.i
@@ -36,6 +36,7 @@
using namespace gnuradio::extras;
%define MAKE_ALL_THE_SOURCE_TYPES(src)
+ GR_EXTRAS_SWIG_BLOCK_FACTORY_DECL(src)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(src, fc32)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(src, sc32)
GR_EXTRAS_SWIG_BLOCK_FACTORY2(src, sc16)
Please sign in to comment.
Something went wrong with that request. Please try again.