Example #1
0
        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);
        }
Example #2
0
 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);
 }
Example #3
0
 public static void callOut(Component c, Action f, port.Meta m, String e)
 {
     traceOut(m, e);
     defer(m.provides.component, c, f);
 }
Example #4
0
 public static void callIn(Component c, Action f, port.Meta m, String e)
 {
     traceIn(m, e);
     handle(c, f);
     traceOut(m, "return");
 }
Example #5
0
 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)
 {
 }