public static Knowledge Initialize(Cdn.Network network) { if (s_instance == null || s_instance.Network != network) { s_instance = new Knowledge(network); s_instance.Init(); } return(s_instance); }
public Validator(Cdn.Network network) { d_network = network; InitRand(); if (!Options.Instance.PrintCompileSource) { RunCodyn(); } }
public unsafe bool Load(Cdn.Network network, Cdn.Node parent) { IntPtr error = IntPtr.Zero; bool raw_ret = cdn_import_load(Handle, network == null ? IntPtr.Zero : network.Handle, parent == null ? IntPtr.Zero : parent.Handle, out error); bool ret = raw_ret; if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
public Layout(Cdn.Network network) : base(IntPtr.Zero) { if (GetType() != typeof(Layout)) { ArrayList vals = new ArrayList(); ArrayList names = new ArrayList(); if (network != null) { names.Add("network"); vals.Add(new GLib.Value(network)); } CreateNativeObject((string[])names.ToArray(typeof(string)), (GLib.Value[])vals.ToArray(typeof(GLib.Value))); return; } Raw = cdn_layout_new(network == null ? IntPtr.Zero : network.Handle); }
public unsafe Import(Cdn.Network network, Cdn.Node parent, string id, string path) : base(IntPtr.Zero) { if (GetType() != typeof(Import)) { throw new InvalidOperationException("Can't override this constructor."); } IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup(id); IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path); IntPtr error = IntPtr.Zero; Raw = cdn_import_new_from_path(network == null ? IntPtr.Zero : network.Handle, parent == null ? IntPtr.Zero : parent.Handle, native_id, native_path, out error); GLib.Marshaller.Free(native_id); GLib.Marshaller.Free(native_path); if (error != IntPtr.Zero) { throw new GLib.GException(error); } }
public NetworkSerializer(Cdn.Network network, Cdn.Node root) : base(IntPtr.Zero) { if (GetType() != typeof(NetworkSerializer)) { ArrayList vals = new ArrayList(); ArrayList names = new ArrayList(); if (network != null) { names.Add("network"); vals.Add(new GLib.Value(network)); } if (root != null) { names.Add("root"); vals.Add(new GLib.Value(root)); } CreateNativeObject((string[])names.ToArray(typeof(string)), (GLib.Value[])vals.ToArray(typeof(GLib.Value))); return; } Raw = cdn_network_serializer_new(network == null ? IntPtr.Zero : network.Handle, root == null ? IntPtr.Zero : root.Handle); }
public Monitor(Cdn.Network network, Cdn.Variable property) : base(IntPtr.Zero) { if (GetType() != typeof(Monitor)) { ArrayList vals = new ArrayList(); ArrayList names = new ArrayList(); if (network != null) { names.Add("network"); vals.Add(new GLib.Value(network)); } if (property != null) { names.Add("property"); vals.Add(new GLib.Value(property)); } CreateNativeObject((string[])names.ToArray(typeof(string)), (GLib.Value[])vals.ToArray(typeof(GLib.Value))); return; } Raw = cdn_monitor_new(network == null ? IntPtr.Zero : network.Handle, property == null ? IntPtr.Zero : property.Handle); }
private Cdn.Variable FindSame(Cdn.Network nout, Cdn.Variable v) { var parent = v.Object; Stack <Cdn.Object> parents = new Stack <Object>(); while (parent != null && parent.Parent != null) { parents.Push(parent); parent = parent.Parent; } Cdn.Object outParent = nout; while (outParent != null && parents.Count > 0) { parent = parents.Pop(); var node = outParent as Cdn.Node; if (node != null) { outParent = node.GetChild(parent.Id); } else { outParent = null; } } if (outParent != null) { return(outParent.Variable(v.Name)); } else { return(null); } }
private Cdn.Network LoadNetwork(string filename) { Cdn.Network n; try { n = new Cdn.Network(filename); } catch (GLib.GException e) { throw new Exception("Failed to load network: {0}", e.Message); } CompileError error = new CompileError(); if (!n.Compile(null, error)) { throw new Exception("Failed to compile network: {0}", error.FormattedString); } return(n); }
private void LoadNetwork() { if (Options.Instance.Validate) { Cdn.InstructionRand.UseStreams = true; Cdn.Function.RandAsArgument = true; } try { d_network = new Cdn.Network(d_filename); } catch (GLib.GException e) { throw new Exception("Failed to load network: {0}", e.Message); } CompileError error = new CompileError(); if (!d_network.Compile(null, error)) { throw new Exception("Failed to compile network: {0}", error.FormattedString); } }
public string[] Bind(Cdn.Network ninp, Cdn.Network nout, IEnumerable <Binder.Binding> bindings) { return(null); }
protected Network(Cdn.Network obj) : base(obj) { }
public Knowledge(Cdn.Network network) { d_network = network; }