changeset 2:839e355f92ed

update DataGear.cs
author riono <e165729@ie.u-ryukyu.ac.jp>
date Sun, 21 Jun 2020 15:43:48 +0900
parents 740b80680d75
children f27db91a852e
files codegear/InputDataGear.cs datagear/DataGearManager.cs datagear/WrapperClass.cs datagear/dg/MessagePackDataGear.cs
diffstat 4 files changed, 51 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/codegear/InputDataGear.cs	Sun Jun 21 01:48:25 2020 +0900
+++ b/codegear/InputDataGear.cs	Sun Jun 21 15:43:48 2020 +0900
@@ -1,9 +1,11 @@
+using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using Christie_net.datagear.dg;
 
 namespace Christie_net.codegear {
     public class InputDataGear {
-        public ConcurrentDictionary<string, DataGear> inputValue = new ConcurrentDictionary<string, DataGear>();
+        public ConcurrentDictionary<string, DataGear<Type>> inputValue = new ConcurrentDictionary<string, DataGear<Type>>();
         public CodeGearManager cgm;
         public CodeGear cg;
         private int count = 0;
@@ -25,7 +27,7 @@
             }
         }
 
-        public void SetInputs(string key, DataGear dg) {
+        public void SetInputs(string key, DataGear<Type> dg) {
             inputValue.AddOrUpdate(key, dg);
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/datagear/DataGearManager.cs	Sun Jun 21 15:43:48 2020 +0900
@@ -0,0 +1,15 @@
+using System;
+using Christie_net.datagear.dg;
+
+namespace Christie_net.datagear {
+    public abstract class DataGearManager {
+        protected DataGears dataGears = new DataGears();
+        public WaitList WaitList = new WaitList();
+        public abstract void put(string key, object data);
+        public abstract void runCommand(Command cm);
+        public abstract void resolveWaitCommand(string key, DataGear<Type> dg);
+        public abstract void finish();
+        public abstract void close();
+        public abstract void shutdown();
+    }
+}
\ No newline at end of file
--- a/datagear/WrapperClass.cs	Sun Jun 21 01:48:25 2020 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Christie_net.datagear {
-    public class WrapperClass {
-        // public static Type wGetWrapperClass<T> (Type c) {
-        //     return c.IsPrimitive ? 
-        // }
-
-        //public static const Dictionary<Type, Type> map = new Dictionary<Type, Type>();
-
-        
-    }
-}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/datagear/dg/MessagePackDataGear.cs	Sun Jun 21 15:43:48 2020 +0900
@@ -0,0 +1,32 @@
+using System;
+
+namespace Christie_net.datagear.dg {
+    public class MessagePackDataGear<T> : DataGear<T> {
+        private byte[] messagePack = null;
+        private int dataSize;
+        //private byte[] messagepack =
+        private 
+
+        public MessagePackDataGear(T data) : base(data){
+            GetMessagePack();
+        }
+
+        public MessagePackDataGear(Type clazz) : base(clazz) {
+        }
+
+        // public byte[] GetMessagePack() {
+        //     if (messagePack != null) {
+        //         return messagePack;
+        //     }
+        //     else {
+        //         try {
+        //             messagePack = 
+        //         }
+        //         catch (Exception e) {
+        //             Console.WriteLine(e);
+        //             throw;
+        //         }
+        //     }
+        // }
+    }
+}
\ No newline at end of file