changeset 711:41d605d48780

add StackTest2Impl.cbc
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 25 Aug 2020 19:46:19 +0900
parents 0d35a152b4e7
children df34d44aceca
files src/parallel_execution/examples/pop_and_push/StackTest2Impl.cbc
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/parallel_execution/examples/pop_and_push/StackTest2Impl.cbc	Tue Aug 25 19:46:19 2020 +0900
@@ -0,0 +1,26 @@
+#include "../../../context.h"
+#interface "StackTest2.h"
+
+// ----
+// typedef struct StackTest2Impl <Type, Isa> impl StackTest2 {
+//   __code next(...);
+// } StackTest2Impl;
+// ----
+
+StackTest2* createStackTest2Impl(struct Context* context) {
+    struct StackTest2* stackTest2  = new StackTest2();
+    struct StackTest2Impl* stack_test2impl = new StackTest2Impl();
+    stackTest2->stackTest2 = (union Data*)stack_test2impl;
+    stackTest2->insertTest1 = C_insertTest1_StackTest2Impl;
+    return stackTest2;
+}
+
+__code insertTest1_StackTest2Impl(struct StackTest2Impl* stackTest2, struct Stack* stack, union Data* data1, __code next(...)) {
+    goto stack->push(data1, next);
+}
+
+__code gotoOtherInterface(struct StackTest2Impl* stackTest2, struct Stack* stack, union Data* data1, struct StackTest* stackTest, __code next(...)) {
+  goto stack->push(data1, stackTest->pop2Test);
+}
+
+