From 7889847eed1e8bc003b88b0d6ad4f7904873d2ac Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 5 Jun 2013 10:44:00 -0700 Subject: gras: created duck typed API for posting msgs Uses templates and template overloads in c++ User python duck typing in the python case. Cleans up post for #84 --- include/gras/block.i | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/gras/block.i') diff --git a/include/gras/block.i b/include/gras/block.i index 8e1a635..cce0d15 100644 --- a/include/gras/block.i +++ b/include/gras/block.i @@ -26,6 +26,15 @@ def get(self, key): return self._get_property(key)() + + def post_output_msg(self, which_output, value): + if not isinstance(value, PMCC): value = PMC_M(value) + self._post_output_msg(which_output, value) + + def post_input_msg(self, which_input, value): + if not isinstance(value, PMCC): value = PMC_M(value) + self._post_input_msg(which_input, value) + %} } -- cgit