public static R callIn <R>(Component c, Func <R> f, port.Meta m, String e) where R : struct, IComparable, IConvertible { traceIn(m, e); R r = valued_helper(c, f); String s; if (r.GetType().Equals(typeof(bool))) { s = (bool)Convert.ChangeType(r, typeof(bool)) ? "true" : "false"; } else if (r.GetType().Equals(typeof(int))) { s = r.ToString(); } else { s = r.GetType().Name + "_" + Enum.GetName(r.GetType(), r); } traceOut(m, s); return(r); }
public static void traceOut(port.Meta m, String e) { System.Console.Error.WriteLine(path(m.provides.meta, m.provides.name) + "." + e + " -> " + path(m.requires.meta, m.requires.name) + "." + e); }
public static void callOut(Component c, Action f, port.Meta m, String e) { traceOut(m, e); defer(m.provides.component, c, f); }
public static void callIn(Component c, Action f, port.Meta m, String e) { traceIn(m, e); handle(c, f); traceOut(m, "return"); }
public binding_error(port.Meta m, string msg) : base("not connected: " + MetaHelper.path(m.provides.component != null ? m.provides.meta : m.requires.meta, m.provides.component != null ? m.provides.name : m.requires.name) + "." + msg) { }