changeset 1103:de43f312b51f draft

fix.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 31 Dec 2010 17:22:33 +0900
parents 8d2a1f5edf10
children 3e7cb5546075
files example/ResizeWritebuf/spe/Resize.cc example/ResizeWritebuf/spe/Resize.h
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/example/ResizeWritebuf/spe/Resize.cc	Fri Dec 31 17:21:37 2010 +0900
+++ b/example/ResizeWritebuf/spe/Resize.cc	Fri Dec 31 17:22:33 2010 +0900
@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include "SchedTask.h"
+#include "../Container.h"
 #include "Resize.h"
 #include "Func.h"
 
@@ -8,6 +10,17 @@
 static int
 resize(SchedTask *smanager, void *rbuf, void *wbuf)
 {
+    long length = (long)smanager->get_param(0);
 
+    smanager->set_outputSize(0, sizeof(Container)+sizeof(int)*(length-1));
+    smanager->setup_outputData();
+
+    ContainerPtr wcontainer = (ContainerPtr)smanager->get_output(wbuf, 0);
+    
+    for (int i =0; i < length;i++){
+	wcontainer->data[i] = i;
+    }
+
+    wcontainer->length = length;
     return 0;
 }
--- a/example/ResizeWritebuf/spe/Resize.h	Fri Dec 31 17:21:37 2010 +0900
+++ b/example/ResizeWritebuf/spe/Resize.h	Fri Dec 31 17:22:33 2010 +0900
@@ -1,9 +1,7 @@
 #ifndef INCLUDED_TASK_RESIZE
 #define INCLUDED_TASK_RESIZE
 
-#ifndef INCLUDED_SCHED_TASK
-#  include "SchedTask.h"
-#endif
+#include "SchedTask.h"
 
 
 #endif