Mercurial > hg > Database > Christie-sharp
changeset 5:5f2af64540be
fix
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 25 Aug 2020 19:05:46 +0900 |
parents | a6f7466473f5 |
children | 5c334a1fbc5e |
files | annotation/PeekFrom.cs annotation/TakeFrom.cs datagear/DataGearManager.cs datagear/DataGears.cs datagear/command/Command.cs datagear/command/CommandType.cs datagear/dg/DataGears.cs |
diffstat | 7 files changed, 88 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/annotation/PeekFrom.cs Tue Jun 23 19:27:24 2020 +0900 +++ b/annotation/PeekFrom.cs Tue Aug 25 19:05:46 2020 +0900 @@ -5,7 +5,7 @@ public class PeekFrom : Attribute { private string _name; - public String value() { + public String Value() { return _name; } }
--- a/annotation/TakeFrom.cs Tue Jun 23 19:27:24 2020 +0900 +++ b/annotation/TakeFrom.cs Tue Aug 25 19:05:46 2020 +0900 @@ -5,7 +5,7 @@ public class TakeFrom : Attribute { private string _name; - public String value() { + public String Value() { return _name; } }
--- a/datagear/DataGearManager.cs Tue Jun 23 19:27:24 2020 +0900 +++ b/datagear/DataGearManager.cs Tue Aug 25 19:05:46 2020 +0900 @@ -1,4 +1,5 @@ using System; +using Christie_net.datagear.command; using Christie_net.datagear.dg; namespace Christie_net.datagear {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datagear/DataGears.cs Tue Aug 25 19:05:46 2020 +0900 @@ -0,0 +1,29 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; + +namespace Christie_net.datagear.dg { + public class DataGears { + protected SortedDictionary<string, BlockingCollection<DataGear<Type>>> dataGears = + new SortedDictionary<string, BlockingCollection<DataGear<Type>>>(); + private object syncObject = new object(); + + public void Put(string key, DataGear<Type> dg) { + lock (syncObject) { + + } + } + + public object Peek(string key) { + return dataGears. + } + + public object GetData(Command cm) { + switch (cm.type) { + + } + } + + public void SetData() + } +} \ No newline at end of file
--- a/datagear/command/Command.cs Tue Jun 23 19:27:24 2020 +0900 +++ b/datagear/command/Command.cs Tue Aug 25 19:05:46 2020 +0900 @@ -1,5 +1,39 @@ +using System; +using System.Data.Common; +using Christie_net.codegear; +using Christie_net.datagear.dg; + namespace Christie_net.datagear.command { public abstract class Command { - public CommandTy + public CommandType type; + public string key = null; + public string toDgmName = null; // for take + public string fromDgmName = "local"; // for remotetake/reply + public int cgmID = -1; // for localtake + public CodeGear cg = null; // for localtake + public DataGear<Type> dg = null; // for put/localtake/reply + public Type clazz = null; // for remote + public Connection connection = null; // for reply + + public Command(CommandBuilder cb) { + this.type = type; + this.key = null; + this.toDgmName = null; + this.fromDgmName = "local"; + this.cgmID = null; + this.cg = null; + this.dg = null; + this.clazz = null; + this.connection = null; + } + + // instead of any Constoractor args + protected void CheckNeedParam(ComanndBuilder cb) { + + } + + public abstract void Execute(); + + public abstract } } \ No newline at end of file
--- a/datagear/command/CommandType.cs Tue Jun 23 19:27:24 2020 +0900 +++ b/datagear/command/CommandType.cs Tue Aug 25 19:05:46 2020 +0900 @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace Christie_net.datagear.command { public enum CommandType { PUT, @@ -11,6 +13,24 @@ }; public static class CommandTypeEtx { - + public static int id; // command ID + public static Dictionary<int, CommandType> hash = new Dictionary<int, CommandType>(); + private static int lastID = 0; // total command number + + private CommandTypeEtx() { + this.id = id; + } + + private static int IncrementLastID() { + return ++lastID; + } + + public static CommandType GetCommandTypeFromID(int id) { + return hash[id]; + } + + static { + for(CommandType type: CommandType.va) + } } } \ No newline at end of file
--- a/datagear/dg/DataGears.cs Tue Jun 23 19:27:24 2020 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; - -namespace Christie_net.datagear.dg { - public class DataGears { - protected SortedDictionary<string, BlockingCollection<DataGear<Type>>> dataGears = - new SortedDictionary<string, BlockingCollection<DataGear<Type>>>(); - private object syncObject = new object(); - - public void Put(string key, DataGear<Type> dg) { - lock (syncObject) { - - } - } - - public object Peek(string key) { - return dataGears. - } - - public object GetData(Command cm) { - switch (cm.type) { - - } - } - - public void SetData() - } -} \ No newline at end of file