summaryrefslogtreecommitdiff
path: root/include/gras/block.i
diff options
context:
space:
mode:
authorJosh Blum2013-06-05 10:44:00 -0700
committerJosh Blum2013-06-05 10:44:00 -0700
commit7889847eed1e8bc003b88b0d6ad4f7904873d2ac (patch)
tree4497b862f1e28faf585214e13ed124cf856323a5 /include/gras/block.i
parent4201e46df896d88ef39a3ccb3b57f7517932d5a2 (diff)
downloadsandhi-7889847eed1e8bc003b88b0d6ad4f7904873d2ac.tar.gz
sandhi-7889847eed1e8bc003b88b0d6ad4f7904873d2ac.tar.bz2
sandhi-7889847eed1e8bc003b88b0d6ad4f7904873d2ac.zip
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
Diffstat (limited to 'include/gras/block.i')
-rw-r--r--include/gras/block.i9
1 files changed, 9 insertions, 0 deletions
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)
+
%}
}