diff options
Diffstat (limited to 'python/gras')
-rw-r--r-- | python/gras/GRAS_Block.i | 22 | ||||
-rw-r--r-- | python/gras/GRAS_HierBlock.i | 3 | ||||
-rw-r--r-- | python/gras/GRAS_ThreadPool.i | 3 | ||||
-rw-r--r-- | python/gras/__init__.py | 2 |
4 files changed, 22 insertions, 8 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) + %} diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i index 1a55f02..7745be6 100644 --- a/python/gras/GRAS_HierBlock.i +++ b/python/gras/GRAS_HierBlock.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 - //////////////////////////////////////////////////////////////////////// // http://www.swig.org/Doc2.0/Library.html#Library_stl_exceptions //////////////////////////////////////////////////////////////////////// @@ -59,6 +57,7 @@ struct PyTSPhondler #include <gras/top_block.hpp> %} +%include <gras/gras.hpp> %include <gras/element.i> %include <gras/io_signature.i> diff --git a/python/gras/GRAS_ThreadPool.i b/python/gras/GRAS_ThreadPool.i index a50e8a8..12138af 100644 --- a/python/gras/GRAS_ThreadPool.i +++ b/python/gras/GRAS_ThreadPool.i @@ -14,12 +14,11 @@ // 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 - %{ #include <gras/thread_pool.hpp> %} %include <std_string.i> +%include <gras/gras.hpp> %include <gras/thread_pool.hpp> diff --git a/python/gras/__init__.py b/python/gras/__init__.py index 4d74879..b348ca3 100644 --- a/python/gras/__init__.py +++ b/python/gras/__init__.py @@ -1,3 +1,3 @@ -from GRAS_Block import Block +from GRAS_Block import Block, Tag from GRAS_HierBlock import HierBlock, TopBlock from GRAS_ThreadPool import ThreadPoolConfig, ThreadPool |