public static RegisterCurrentThread ( ) : void | ||
return | void |
public void InForiegnFrame(Action action) { PrologCLR.RegisterCurrentThread(); uint fid = libpl.PL_open_foreign_frame(); try { action(); } finally { // if (fid > 0) libpl.PL_close_foreign_frame(fid); } }
public override object CallPrologFast(object[] paramz) { PrologCLR.RegisterCurrentThread(); var results = paramz; PlTerm plC = PlTerm.PlVar(); libpl.PL_recorded(closureTerm, plC.TermRef); PlTerm ctestVars = plC.Arg(0); PlTerm ctestCode = plC.Arg(1); PlTerm[] terms = PrologCLR.ToTermArray(ctestVars); int idx = terms.Length - 1; int resdex = results.Length - 1;; while (idx >= 0 && resdex >= 0) { terms[idx--].FromObject(results[resdex--]); } PrologCLR.PlCall("user", "call", new PlTermV(ctestCode, 1)); return(null); }
public IEnumerator <T> GetEnumerator() { PrologCLR.RegisterCurrentThread(); return(new PrologBackedCollectionEnumerator(this)); }
/// <summary> /// Returns an enumerator that iterates through the collection. /// </summary> /// <returns> /// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection. /// </returns> /// <filterpriority>1</filterpriority> public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator() { PrologCLR.RegisterCurrentThread(); return(new PrologBackedDictionaryEnumerator(this)); }