summaryrefslogtreecommitdiff
path: root/python/gras/GRAS_Block.i
diff options
context:
space:
mode:
Diffstat (limited to 'python/gras/GRAS_Block.i')
-rw-r--r--python/gras/GRAS_Block.i22
1 files changed, 19 insertions, 3 deletions
diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i
index 9503af8..54f2186 100644
--- a/python/gras/GRAS_Block.i
+++ b/python/gras/GRAS_Block.i
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#define GRAS_API
-
////////////////////////////////////////////////////////////////////////
// SWIG director shit - be explicit with all virtual methods
////////////////////////////////////////////////////////////////////////
@@ -29,7 +27,6 @@
%feature("nodirector") gras::BlockPython::notify_topology;
%feature("nodirector") gras::BlockPython::work;
-
////////////////////////////////////////////////////////////////////////
// http://www.swig.org/Doc2.0/Library.html#Library_stl_exceptions
////////////////////////////////////////////////////////////////////////
@@ -95,6 +92,7 @@ struct PyGILPhondler
////////////////////////////////////////////////////////////////////////
// Pull in the implementation goodies
////////////////////////////////////////////////////////////////////////
+%include <gras/gras.hpp>
%include <gras/element.i>
%include <gras/io_signature.i>
%include <gras/sbuffer.hpp>
@@ -225,6 +223,15 @@ def sig_to_dtype_sig(sig):
if sig is None: sig = ()
return map(numpy.dtype, sig)
+Tag__ = Tag
+
+class Tag(object):
+ def __init__(self, offset=0, key=None, value=None, srcid=None):
+ self.offset = offset
+ self.key = key
+ self.value = value
+ self.srcid = srcid
+
class Block(BlockPython):
def __init__(self, name='Block', in_sig=None, out_sig=None):
BlockPython.__init__(self, name)
@@ -288,4 +295,13 @@ class Block(BlockPython):
def stop(self): return True
+ def post_output_tag(self, which_output, tag):
+ t = Tag__(
+ tag.offset,
+ Py2PMC(tag.key),
+ Py2PMC(tag.value),
+ Py2PMC(tag.srcid),
+ )
+ BlockPython.post_output_tag(self, which_output, t)
+
%}